govuk_publishing_components 29.14.0 → 29.15.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (99) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/gtm-click-tracking.js +24 -13
  3. data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/gtm-page-views.js +9 -12
  4. data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/gtm-schemas.js +32 -0
  5. data/app/assets/javascripts/govuk_publishing_components/analytics-ga4.js +1 -0
  6. data/app/assets/javascripts/govuk_publishing_components/components/accordion.js +17 -22
  7. data/app/assets/javascripts/govuk_publishing_components/components/table.js +52 -0
  8. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_charts.scss +13 -2
  9. data/app/models/govuk_publishing_components/audit_applications.rb +31 -9
  10. data/app/models/govuk_publishing_components/audit_comparer.rb +15 -9
  11. data/app/views/govuk_publishing_components/audit/_components.html.erb +20 -2
  12. data/app/views/govuk_publishing_components/components/_table.html.erb +61 -30
  13. data/app/views/govuk_publishing_components/components/docs/back_link.yml +1 -1
  14. data/app/views/govuk_publishing_components/components/docs/big_number.yml +2 -2
  15. data/app/views/govuk_publishing_components/components/docs/breadcrumbs.yml +2 -2
  16. data/app/views/govuk_publishing_components/components/docs/button.yml +41 -40
  17. data/app/views/govuk_publishing_components/components/docs/cards.yml +2 -0
  18. data/app/views/govuk_publishing_components/components/docs/checkboxes.yml +216 -216
  19. data/app/views/govuk_publishing_components/components/docs/cookie_banner.yml +2 -1
  20. data/app/views/govuk_publishing_components/components/docs/copy_to_clipboard.yml +2 -2
  21. data/app/views/govuk_publishing_components/components/docs/details.yml +5 -1
  22. data/app/views/govuk_publishing_components/components/docs/document_list.yml +1 -2
  23. data/app/views/govuk_publishing_components/components/docs/error_alert.yml +4 -0
  24. data/app/views/govuk_publishing_components/components/docs/error_summary.yml +4 -6
  25. data/app/views/govuk_publishing_components/components/docs/govspeak.yml +6 -7
  26. data/app/views/govuk_publishing_components/components/docs/image_card.yml +3 -2
  27. data/app/views/govuk_publishing_components/components/docs/intervention.yml +25 -25
  28. data/app/views/govuk_publishing_components/components/docs/organisation_logo.yml +1 -2
  29. data/app/views/govuk_publishing_components/components/docs/print_link.yml +5 -1
  30. data/app/views/govuk_publishing_components/components/docs/select.yml +101 -98
  31. data/app/views/govuk_publishing_components/components/docs/table.yml +36 -1
  32. data/app/views/govuk_publishing_components/components/docs/tabs.yml +4 -0
  33. data/config/locales/ar.yml +4 -0
  34. data/config/locales/az.yml +4 -0
  35. data/config/locales/be.yml +4 -0
  36. data/config/locales/bg.yml +4 -0
  37. data/config/locales/bn.yml +4 -0
  38. data/config/locales/cs.yml +4 -0
  39. data/config/locales/cy.yml +4 -0
  40. data/config/locales/da.yml +4 -0
  41. data/config/locales/de.yml +4 -0
  42. data/config/locales/dr.yml +4 -0
  43. data/config/locales/el.yml +4 -0
  44. data/config/locales/en.yml +4 -0
  45. data/config/locales/es-419.yml +4 -0
  46. data/config/locales/es.yml +4 -0
  47. data/config/locales/et.yml +4 -0
  48. data/config/locales/fa.yml +4 -0
  49. data/config/locales/fi.yml +4 -0
  50. data/config/locales/fr.yml +4 -0
  51. data/config/locales/gd.yml +4 -0
  52. data/config/locales/gu.yml +4 -0
  53. data/config/locales/he.yml +4 -0
  54. data/config/locales/hi.yml +4 -0
  55. data/config/locales/hr.yml +4 -0
  56. data/config/locales/hu.yml +4 -0
  57. data/config/locales/hy.yml +4 -0
  58. data/config/locales/id.yml +4 -0
  59. data/config/locales/is.yml +4 -0
  60. data/config/locales/it.yml +4 -0
  61. data/config/locales/ja.yml +4 -0
  62. data/config/locales/ka.yml +4 -0
  63. data/config/locales/kk.yml +4 -0
  64. data/config/locales/ko.yml +4 -0
  65. data/config/locales/lt.yml +4 -0
  66. data/config/locales/lv.yml +4 -0
  67. data/config/locales/ms.yml +4 -0
  68. data/config/locales/mt.yml +4 -0
  69. data/config/locales/nl.yml +4 -0
  70. data/config/locales/no.yml +4 -0
  71. data/config/locales/pa-pk.yml +4 -0
  72. data/config/locales/pa.yml +4 -0
  73. data/config/locales/pl.yml +4 -0
  74. data/config/locales/ps.yml +4 -0
  75. data/config/locales/pt.yml +4 -0
  76. data/config/locales/ro.yml +4 -0
  77. data/config/locales/ru.yml +4 -0
  78. data/config/locales/si.yml +4 -0
  79. data/config/locales/sk.yml +4 -0
  80. data/config/locales/sl.yml +4 -0
  81. data/config/locales/so.yml +4 -0
  82. data/config/locales/sq.yml +4 -0
  83. data/config/locales/sr.yml +4 -0
  84. data/config/locales/sv.yml +4 -0
  85. data/config/locales/sw.yml +4 -0
  86. data/config/locales/ta.yml +4 -0
  87. data/config/locales/th.yml +4 -0
  88. data/config/locales/tk.yml +4 -0
  89. data/config/locales/tr.yml +4 -0
  90. data/config/locales/uk.yml +4 -0
  91. data/config/locales/ur.yml +4 -0
  92. data/config/locales/uz.yml +4 -0
  93. data/config/locales/vi.yml +4 -0
  94. data/config/locales/zh-hk.yml +4 -0
  95. data/config/locales/zh-tw.yml +4 -0
  96. data/config/locales/zh.yml +4 -0
  97. data/lib/govuk_publishing_components/app_helpers/table_helper.rb +4 -2
  98. data/lib/govuk_publishing_components/version.rb +1 -1
  99. metadata +5 -3
@@ -23,16 +23,14 @@ examples:
23
23
  items:
24
24
  - text: Descriptive link to the question with an error 1
25
25
  href: '#example-error-1'
26
- data_attributes:
27
- tracking: GTM-123AA
28
26
  - text: Descriptive link to the question with an error 2
29
27
  href: '#example-error-2'
30
- data_attributes:
31
- tracking: GTM-123AB
32
28
  - text: Description of error without link
33
- data_attributes:
34
- tracking: GTM-123AC
35
29
  with_data_attributes:
30
+ description: |
31
+ The example shown applies a tracking attribute specifically for use by Google Tag Manager in [Content Publisher](https://github.com/alphagov/content-publisher).
32
+
33
+ Other data attributes can also be applied as required. Note that the component does not include built in tracking. If this is required consider using the [track click script](https://github.com/alphagov/govuk_publishing_components/blob/main/docs/analytics/track-click.md).
36
34
  data:
37
35
  title: Message to alert the user to a problem goes here
38
36
  description: Optional description of the errors and how to correct them
@@ -181,6 +181,11 @@ examples:
181
181
  </tbody>
182
182
  </table>
183
183
  charts:
184
+ description: |
185
+ The Government Statistical Service (GSS) guidance recommends [a limit of four categories as best practice for basic data visualisations](https://gss.civilservice.gov.uk/policy-store/data-visualisation-colours-in-charts/#section-5).
186
+
187
+ Note that charts which have up to 7 categories, [chart with colours](http://govuk-publishing-components.dev.gov.uk/component-guide/govspeak/chart_with_colours/preview), for example, will display subsequent bars in `#3d3d3d`, `#a285d1` and the 7th bar in the default colour of `#0b0c0c` and will still meet the colour contrast requirements for adjacent colours.
188
+ Charts that have 8 or more categories will display additional bars in the default colour and will not meet colour contrast requirements for adjacent colours.
184
189
  data:
185
190
  block: |
186
191
  <table class='js-barchart-table mc-auto-outdent'>
@@ -214,8 +219,6 @@ examples:
214
219
  <th scope="col">Grapes</th>
215
220
  <th scope="col">Strawberries</th>
216
221
  <th scope="col">Plums</th>
217
- <th scope="col">Apricots</th>
218
- <th scope="col">Pineapples</th>
219
222
  </tr>
220
223
  </thead>
221
224
  <tbody>
@@ -228,8 +231,6 @@ examples:
228
231
  <td>24</td>
229
232
  <td>10</td>
230
233
  <td>62</td>
231
- <td>29</td>
232
- <td>81</td>
233
234
  </tr>
234
235
  <tr>
235
236
  <td>Numbers outside bar</td>
@@ -238,10 +239,8 @@ examples:
238
239
  <td>2</td>
239
240
  <td>1</td>
240
241
  <td>1</td>
241
- <td>3</td>
242
- <td>3</td>
243
- <td>1</td>
244
242
  <td>2</td>
243
+ <td>1</td>
245
244
  </tr>
246
245
  </tbody>
247
246
  </table>
@@ -188,14 +188,15 @@ examples:
188
188
  data:
189
189
  large: true
190
190
  href: "/still-not-a-page"
191
- image_src: "https://assets.publishing.service.gov.uk/government/uploads/system/uploads/feature/image/62756/s300_courts-of-justice.JPG"
191
+ image_src: "https://assets.publishing.service.gov.uk/government/uploads/system/uploads/feature/image/91397/s712_SG_Swear_in_1_.jpg"
192
192
  image_alt: "some meaningful alt text please"
193
193
  context:
194
194
  date: 2017-06-14 11:30:00
195
195
  text: "Announcement"
196
196
  heading_text: "Something has happened nearby possibly"
197
197
  description: "Following a news report that something has happened, further details are emerging of the thing that has happened and what that means for you."
198
- with_tracking:
198
+ with_data_attributes:
199
+ description: Data attributes can be applied as required. Note that the component does not include built in tracking. If this is required consider using the [track click script](https://github.com/alphagov/govuk_publishing_components/blob/main/docs/analytics/track-click.md).
199
200
  data:
200
201
  href: "/i-am-not-a-valid-link"
201
202
  href_data_attributes: {
@@ -20,31 +20,31 @@ shared_accessibility_criteria:
20
20
  examples:
21
21
  default:
22
22
  data:
23
- suggestion_text: "You should renew your permit every 6 months."
23
+ suggestion_text: You should renew your permit every 6 months.
24
24
 
25
25
  with_suggestion_link:
26
26
  data:
27
- suggestion_text: "Based on your browsing you might be interested in"
27
+ suggestion_text: Based on your browsing you might be interested in
28
28
  suggestion_link_text: "Travel abroad: step by step"
29
- suggestion_link_url: "/travel-abroad"
29
+ suggestion_link_url: /travel-abroad
30
30
 
31
31
  with_dismiss_link:
32
32
  data:
33
- suggestion_text: "You should renew your permit every 6 months."
34
- dismiss_text: "Hide this suggestion"
33
+ suggestion_text: You should renew your permit every 6 months.
34
+ dismiss_text: Hide this suggestion
35
35
 
36
36
  with_suggestion_link_only:
37
37
  data:
38
- suggestion_link_text: "You can now apply for a permit online."
39
- suggestion_link_url: "/permit"
38
+ suggestion_link_text: You can now apply for a permit online.
39
+ suggestion_link_url: /permit
40
40
 
41
41
  with_hide:
42
42
  description: |
43
43
  This example is for when we want to hide by default and display to the user based on some logic,
44
44
  either in the backend or with Javascript.
45
45
  data:
46
- suggestion_link_text: "You may be invited to fill in a questionnaire"
47
- suggestion_link_url: "/questionnaire"
46
+ suggestion_link_text: You may be invited to fill in a questionnaire
47
+ suggestion_link_url: /questionnaire
48
48
  hide: true
49
49
 
50
50
  open_suggestion_link_in_new_tab:
@@ -54,30 +54,30 @@ examples:
54
54
  Link text should tell the user that the link opens in a new tab.
55
55
  Note: "(opens in a new tab)" is added to link text if the phrase isn't included.
56
56
  data:
57
- suggestion_link_text: "You can now apply for a permit online"
58
- suggestion_link_url: "www.google.com/permit"
57
+ suggestion_link_text: You can now apply for a permit online
58
+ suggestion_link_url: www.google.com/permit
59
59
  new_tab: true
60
60
 
61
61
  with_data_attributes:
62
62
  description: |
63
63
  This example shows the use of `suggestion_data_attributes` and
64
64
  `dismiss_data_attributes` for click tracking.
65
+
66
+ Other data attributes can also be applied as required. Note that the component does not include built in tracking. If this is required consider using the [track click script](https://github.com/alphagov/govuk_publishing_components/blob/main/docs/analytics/track-click.md).
65
67
  data:
66
- suggestion_text: "Based on your browsing you might be interested in"
68
+ suggestion_text: Based on your browsing you might be interested in
67
69
  suggestion_link_text: "Travel abroad: step by step"
68
- suggestion_link_url: "/travel-abroad"
70
+ suggestion_link_url: /travel-abroad
69
71
  suggestion_data_attributes:
70
- module: "gem-track-click"
71
- track-category: "interventionBanner"
72
- track-action: "interventionClicked"
72
+ track-category: interventionBanner
73
+ track-action: interventionClicked
73
74
  track-dimension: "Travel abroad: step by step"
74
- track-dimension-index: "29"
75
- track-label: "clicked suggestion"
76
- dismiss_text: "Hide this suggestion"
75
+ track-dimension-index: 29
76
+ track-label: clicked suggestion
77
+ dismiss_text: Hide this suggestion
77
78
  dismiss_data_attributes:
78
- module: "gem-track-click"
79
- track-category: "interventionBanner"
80
- track-action: "interventionDismissed"
81
- track-dimension: "Hide this suggestion"
82
- track-dimension-index: "29"
83
- track-label: "hid the intervention"
79
+ track-category: interventionBanner
80
+ track-action: interventionDismissed
81
+ track-dimension: Hide this suggestion
82
+ track-dimension-index: 29
83
+ track-label: hide the intervention
@@ -6,8 +6,6 @@ body: |
6
6
 
7
7
  Alternatively a custom organisation logo can be provided as an image.
8
8
 
9
- Data tracking attributes can be provided to add tracking to each organisation logo. This will only apply to organisations with a link. Example here: [with_data_attributes](/component-guide/organisation_logo/with_data_attributes)
10
-
11
9
  The logo can optionally be wrapped in a heading.
12
10
 
13
11
  The logo can be set to not take up the full width of the parent container with the `inline` option.
@@ -147,6 +145,7 @@ examples:
147
145
  url: 'https://assets.publishing.service.gov.uk/government/uploads/system/uploads/organisation/logo/321/HMPS.jpg'
148
146
  alt_text: 'HM Prison Service'
149
147
  with_data_attributes:
148
+ description: Data attributes can be applied as required. Note that the component does not include built in tracking. If this is required consider using the [track click script](https://github.com/alphagov/govuk_publishing_components/blob/main/docs/analytics/track-click.md).
150
149
  data:
151
150
  organisation:
152
151
  name: Cabinet Office
@@ -8,7 +8,7 @@ shared_accessibility_criteria:
8
8
  - link
9
9
  examples:
10
10
  default:
11
- description: This component calls `print()` via the browser's DOM API. By default it relies on JavaScript and is not shown in environments where JavaScript is disabled. The \"link\" here is actually a button tag because this is not a navigation event.
11
+ description: This component calls `print()` via the browser's DOM API. By default it relies on JavaScript and is not shown in environments where JavaScript is disabled. The \"link\" here is actually a button tag because this is not a navigation event.
12
12
  with_different_text:
13
13
  data:
14
14
  text: "Print this manual"
@@ -17,6 +17,10 @@ examples:
17
17
  data:
18
18
  href: "/print"
19
19
  with_data_attributes:
20
+ description: |
21
+ Data attributes can be passed to the component as shown.
22
+
23
+ Note that the component does not include built in tracking. If this is required consider using the [track click script](https://github.com/alphagov/govuk_publishing_components/blob/main/docs/analytics/track-click.md).
20
24
  data:
21
25
  data_attributes:
22
26
  track-category: "printButton"
@@ -10,160 +10,163 @@ accessibility_criteria: |
10
10
  examples:
11
11
  default:
12
12
  data:
13
- id: 'dropdown1'
14
- label: 'My Dropdown'
13
+ id: dropdown1
14
+ label: My Dropdown
15
15
  options:
16
- - text: 'Option one'
17
- value: 'option1'
18
- - text: 'Option two'
19
- value: 'option2'
20
- - text: 'Option three'
21
- value: 'option3'
16
+ - text: Option one
17
+ value: option1
18
+ - text: Option two
19
+ value: option2
20
+ - text: Option three
21
+ value: option3
22
22
  with_different_id_and_name:
23
23
  description: If no name is provided, name defaults to the (required) value of id.
24
24
  data:
25
- id: 'dropdown1-1'
26
- label: 'My Dropdown'
27
- name: 'dropdown[1]'
25
+ id: dropdown1-1
26
+ label: My Dropdown
27
+ name: dropdown[1]
28
28
  options:
29
- - text: 'Option one'
30
- value: 'option1'
31
- - text: 'Option two'
32
- value: 'option2'
29
+ - text: Option one
30
+ value: option1
31
+ - text: Option two
32
+ value: option2
33
33
  with_preselect:
34
34
  data:
35
- id: 'dropdown2'
36
- label: 'Option 2 preselected'
35
+ id: dropdown2
36
+ label: Option 2 preselected
37
37
  options:
38
- - text: 'Option one'
39
- value: 'option1'
40
- - text: 'Option two'
41
- value: 'option2'
38
+ - text: Option one
39
+ value: option1
40
+ - text: Option two
41
+ value: option2
42
42
  selected: true
43
- - text: 'Option three'
44
- value: 'option3'
43
+ - text: Option three
44
+ value: option3
45
45
  with_hint:
46
46
  description: When a hint is included the `aria-describedby` attribute of the select is included to point to the hint. When an error and a hint are present, that attribute includes the IDs of both the hint and the error.
47
47
  data:
48
- id: 'dropdown2-1'
49
- label: 'Choose your preferred thing'
50
- hint: 'You might need some more information here'
51
- hint_id: 'optional-hint-id'
48
+ id: dropdown2-1
49
+ label: Choose your preferred thing
50
+ hint: You might need some more information here
51
+ hint_id: optional-hint-id
52
52
  options:
53
- - text: 'Something'
54
- value: 'option1'
55
- - text: 'Something else'
56
- value: 'option2'
53
+ - text: Something
54
+ value: option1
55
+ - text: Something else
56
+ value: option2
57
57
  with_tracking:
58
- description: 'Tracking can be enabled on the select component by passing a minimum of `data_track_category` and `data_track_action`. Other tracking attributes are optional. Note: tracking events do not currently fire within the component guide.'
58
+ description: |
59
+ Tracking can be enabled on the select component by passing a minimum of `data_track_category` and `data_track_action`. Other tracking attributes are optional. Tracking is provided by the [track-select-change](https://github.com/alphagov/govuk_publishing_components/blob/main/app/assets/javascripts/govuk_publishing_components/analytics/track-select-change.js) module.
60
+
61
+ Note: tracking events do not fire within the component guide.
59
62
  data:
60
- id: 'dropdown3'
61
- label: 'With tracking enabled'
63
+ id: dropdown3
64
+ label: With tracking enabled
62
65
  options:
63
- - text: 'Option one'
64
- value: 'option1'
66
+ - text: Option one
67
+ value: option1
65
68
  data_attributes:
66
- track_category: 'relatedLinkClicked'
69
+ track_category: relatedLinkClicked
67
70
  track_action: 1.1
68
- track_label: '/link-1'
71
+ track_label: /link-1
69
72
  track_options:
70
73
  dimension28: 1
71
- dimension29: 'Link 1'
72
- - text: 'Option two'
73
- value: 'option2'
74
+ dimension29: Link 1
75
+ - text: Option two
76
+ value: option2
74
77
  data_attributes:
75
- track_category: 'relatedLinkClicked'
78
+ track_category: relatedLinkClicked
76
79
  track_action: 1.2
77
- track_label: '/link-2'
80
+ track_label: /link-2
78
81
  track_options:
79
82
  dimension28: 2
80
- dimension29: 'Link 2'
81
- - text: 'Option three'
82
- value: 'option3'
83
+ dimension29: Link 2
84
+ - text: Option three
85
+ value: option3
83
86
  data_attributes:
84
- track_category: 'relatedLinkClicked'
87
+ track_category: relatedLinkClicked
85
88
  track_action: 1.3
86
- track_label: '/link-3'
89
+ track_label: /link-3
87
90
  track_options:
88
91
  dimension28: 3
89
- dimension29: 'Link 3'
92
+ dimension29: Link 3
90
93
  with_data_attributes:
91
94
  description: Other data attributes can be passed to the component if needed.
92
95
  data:
93
- id: 'dropdown4'
94
- label: 'With data attributes'
96
+ id: dropdown4
97
+ label: With data attributes
95
98
  options:
96
- - text: 'Option one'
97
- value: 'option1'
99
+ - text: Option one
100
+ value: option1
98
101
  data_attributes:
99
- another_attribute: "attribute 1"
100
- something_else: "attribute 2"
101
- - text: 'Option two'
102
- value: 'option2'
103
- - text: 'Option three'
104
- value: 'option3'
102
+ another_attribute: attribute 1
103
+ something_else: attribute 2
104
+ - text: Option two
105
+ value: option2
106
+ - text: Option three
107
+ value: option3
105
108
  with_error:
106
109
  description: If the user has to select an option, it is recommended that a radio button is used instead of a select, but this is not always possible. Note that `error_id` is optional, if it is not passed one will be generated automatically.
107
110
  data:
108
- id: 'dropdown4-1'
109
- label: 'How will you be travelling to the conference?'
110
- error_message: 'Please choose an option'
111
- error_id: 'error_id'
111
+ id: dropdown4-1
112
+ label: How will you be travelling to the conference?
113
+ error_message: Please choose an option
114
+ error_id: error_id
112
115
  options:
113
116
  - text: ""
114
117
  value: ""
115
- - text: 'Public transport'
116
- value: 'option1'
117
- - text: 'Will make own arrangements'
118
- value: 'option2'
118
+ - text: Public transport
119
+ value: option1
120
+ - text: Will make own arrangements
121
+ value: option2
119
122
  with_error_id_but_no_message:
120
123
  description: For some selects the error message should be rendered separately but an error state is still required (currently required in smart answers). In this scenario an `error_id` can be passed without an `error_message` to highlight the component and set `aria-describedby` correctly.
121
124
  data:
122
- id: 'dropdown4-2'
123
- label: 'What lunch option would you like?'
124
- error_id: 'error_id'
125
+ id: dropdown4-2
126
+ label: What lunch option would you like?
127
+ error_id: error_id
125
128
  options:
126
129
  - text: ""
127
130
  value: ""
128
- - text: 'Vegetarian'
129
- value: 'option1'
130
- - text: 'Meat'
131
- value: 'option2'
131
+ - text: Vegetarian
132
+ value: option1
133
+ - text: Meat
134
+ value: option2
132
135
  full_width:
133
136
  description: Make the select width 100%. This is used for facets in finder-frontend's search.
134
137
  data:
135
- id: 'dropdown5'
136
- label: 'Really wide'
138
+ id: dropdown5
139
+ label: Really wide
137
140
  full_width: true
138
141
  options:
139
- - text: 'Option one'
140
- value: 'option1'
141
- - text: 'Option two'
142
- value: 'option2'
143
- - text: 'Option three'
144
- value: 'option3'
142
+ - text: Option one
143
+ value: option1
144
+ - text: Option two
145
+ value: option2
146
+ - text: Option three
147
+ value: option3
145
148
  with_custom_label_size:
146
149
  description: Make the label different sizes. Valid options are `s`, `m`, `l` and `xl`.
147
150
  data:
148
- id: 'dropdown6'
149
- label: 'Bigger!'
150
- heading_size: 'xl'
151
+ id: dropdown6
152
+ label: Bigger!
153
+ heading_size: xl
151
154
  options:
152
- - text: 'Option one'
153
- value: 'option1'
154
- - text: 'Option two'
155
- value: 'option2'
156
- - text: 'Option three'
157
- value: 'option3'
155
+ - text: Option one
156
+ value: option1
157
+ - text: Option two
158
+ value: option2
159
+ - text: Option three
160
+ value: option3
158
161
  with_page_heading:
159
162
  description: This adds a `h1` element with a label element inside containing the text supplied.
160
163
  data:
161
- id: 'select-with-heading'
162
- label: 'This is a page heading'
163
- heading_size: 'xl'
164
+ id: select-with-heading
165
+ label: This is a page heading
166
+ heading_size: xl
164
167
  is_page_heading: true
165
168
  options:
166
- - text: 'Option one'
167
- value: 'option1'
168
- - text: 'Option two'
169
- value: 'option2'
169
+ - text: Option one
170
+ value: option1
171
+ - text: Option two
172
+ value: option2
@@ -87,7 +87,12 @@ examples:
87
87
  - text: £125
88
88
  format: numeric
89
89
  with_sortable_head:
90
- description: This option allows links to be added to the table headers for sorting. Sorting must be handled server side, it is not done by the component.
90
+ description: |
91
+ This option allows links to be added to the table headers for sorting. Sorting must be handled server side, it is not done by the component.
92
+
93
+ The example shown applies a tracking attribute specifically for use by Google Tag Manager in [Content Publisher](https://github.com/alphagov/content-publisher).
94
+
95
+ Other data attributes can also be applied as required. Note that the component does not include built in tracking. If this is required consider using the [track click script](https://github.com/alphagov/govuk_publishing_components/blob/main/docs/analytics/track-click.md).
91
96
  data:
92
97
  sortable: true
93
98
  head:
@@ -134,3 +139,33 @@ examples:
134
139
  format: numeric
135
140
  - text: £80
136
141
  format: numeric
142
+ with_filter:
143
+ description: This option allows table rows to be filtered by user input. Since this filtering is implemented client-side the filter section is not displayed by default but displays only when JavaScript is enabled. The label for the input field can be set when the coponent is rendered via the `label` key. if this is not set a fallback value will display.
144
+ data:
145
+ filterable: true
146
+ label: Filter months
147
+ head:
148
+ - text: Month you apply
149
+ - text: Rate for bicycles
150
+ format: numeric
151
+ - text: Rate for vehicles
152
+ format: numeric
153
+ rows:
154
+ -
155
+ - text: January
156
+ - text: £85
157
+ format: numeric
158
+ - text: £95
159
+ format: numeric
160
+ -
161
+ - text: February
162
+ - text: £75
163
+ format: numeric
164
+ - text: £55
165
+ format: numeric
166
+ -
167
+ - text: March
168
+ - text: £165
169
+ format: numeric
170
+ - text: £125
171
+ format: numeric
@@ -64,6 +64,10 @@ examples:
64
64
  content: |
65
65
  <p class="govuk-body-m">Here is a single piece of content, there should be no tabs.</p>
66
66
  with_data_attributes:
67
+ description: |
68
+ The example shown applies a tracking attribute specifically for use by Google Tag Manager in [Content Publisher](https://github.com/alphagov/content-publisher).
69
+
70
+ Other data attributes can also be applied as required. Note that the component does not include built in tracking. If this is required consider using the [track click script](https://github.com/alphagov/govuk_publishing_components/blob/main/docs/analytics/track-click.md).
67
71
  data:
68
72
  tabs:
69
73
  - id: "tab-with-data-attributes-1"
@@ -203,5 +203,9 @@ ar:
203
203
  summary_list:
204
204
  delete: حذف
205
205
  edit: تغيير
206
+ table:
207
+ filter_count:
208
+ filter_label:
209
+ filter_message:
206
210
  tabs:
207
211
  contents: المحتويات
@@ -199,5 +199,9 @@ az:
199
199
  summary_list:
200
200
  delete: Sil
201
201
  edit: Dəyiş
202
+ table:
203
+ filter_count:
204
+ filter_label:
205
+ filter_message:
202
206
  tabs:
203
207
  contents: Məzmunlar
@@ -206,5 +206,9 @@ be:
206
206
  summary_list:
207
207
  delete: Выдаліць
208
208
  edit: Змянiць
209
+ table:
210
+ filter_count:
211
+ filter_label:
212
+ filter_message:
209
213
  tabs:
210
214
  contents: Змест
@@ -204,5 +204,9 @@ bg:
204
204
  summary_list:
205
205
  delete: Изтриване
206
206
  edit: Промяна
207
+ table:
208
+ filter_count:
209
+ filter_label:
210
+ filter_message:
207
211
  tabs:
208
212
  contents: Съдържание
@@ -201,5 +201,9 @@ bn:
201
201
  summary_list:
202
202
  delete: মুছে ফেলুন
203
203
  edit: পরিবর্তন
204
+ table:
205
+ filter_count:
206
+ filter_label:
207
+ filter_message:
204
208
  tabs:
205
209
  contents: বিষয়সূচী
@@ -205,5 +205,9 @@ cs:
205
205
  summary_list:
206
206
  delete: Odstranit
207
207
  edit: Změna
208
+ table:
209
+ filter_count:
210
+ filter_label:
211
+ filter_message:
208
212
  tabs:
209
213
  contents: Obsah
@@ -204,5 +204,9 @@ cy:
204
204
  summary_list:
205
205
  delete: Dileu
206
206
  edit: Newid
207
+ table:
208
+ filter_count:
209
+ filter_label:
210
+ filter_message:
207
211
  tabs:
208
212
  contents: Cynnwys
@@ -201,5 +201,9 @@ da:
201
201
  summary_list:
202
202
  delete: Slet
203
203
  edit: Ændre
204
+ table:
205
+ filter_count:
206
+ filter_label:
207
+ filter_message:
204
208
  tabs:
205
209
  contents: Indhold
@@ -204,5 +204,9 @@ de:
204
204
  summary_list:
205
205
  delete: Löschen
206
206
  edit: Ändern
207
+ table:
208
+ filter_count:
209
+ filter_label:
210
+ filter_message:
207
211
  tabs:
208
212
  contents: Inhalte
@@ -202,5 +202,9 @@ dr:
202
202
  summary_list:
203
203
  delete: حذف کردن
204
204
  edit: تغییر دادن
205
+ table:
206
+ filter_count:
207
+ filter_label:
208
+ filter_message:
205
209
  tabs:
206
210
  contents: محتویات
@@ -200,5 +200,9 @@ el:
200
200
  summary_list:
201
201
  delete: Διαγραφή
202
202
  edit: Αλλαγή
203
+ table:
204
+ filter_count:
205
+ filter_label:
206
+ filter_message:
203
207
  tabs:
204
208
  contents: Περιεχόμενα