govuk_publishing_components 34.7.0 → 34.7.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (101) hide show
  1. checksums.yaml +4 -4
  2. data/lib/govuk_publishing_components/presenters/related_navigation_helper.rb +0 -7
  3. data/lib/govuk_publishing_components/version.rb +1 -1
  4. data/node_modules/govuk-frontend/govuk/all.js +4029 -3792
  5. data/node_modules/govuk-frontend/govuk/all.js.map +1 -0
  6. data/node_modules/govuk-frontend/govuk/common/closest-attribute-value.js +52 -51
  7. data/node_modules/govuk-frontend/govuk/common/closest-attribute-value.js.map +1 -0
  8. data/node_modules/govuk-frontend/govuk/common/index.js +153 -145
  9. data/node_modules/govuk-frontend/govuk/common/index.js.map +1 -0
  10. data/node_modules/govuk-frontend/govuk/common/normalise-dataset.js +324 -321
  11. data/node_modules/govuk-frontend/govuk/common/normalise-dataset.js.map +1 -0
  12. data/node_modules/govuk-frontend/govuk/common.js +154 -146
  13. data/node_modules/govuk-frontend/govuk/common.js.map +1 -0
  14. data/node_modules/govuk-frontend/govuk/components/_all.scss +1 -1
  15. data/node_modules/govuk-frontend/govuk/components/accordion/_index.scss +23 -4
  16. data/node_modules/govuk-frontend/govuk/components/accordion/accordion.js +2059 -1654
  17. data/node_modules/govuk-frontend/govuk/components/accordion/accordion.js.map +1 -0
  18. data/node_modules/govuk-frontend/govuk/components/accordion/fixtures.json +11 -11
  19. data/node_modules/govuk-frontend/govuk/components/accordion/template.njk +1 -1
  20. data/node_modules/govuk-frontend/govuk/components/back-link/_index.scss +19 -19
  21. data/node_modules/govuk-frontend/govuk/components/breadcrumbs/_index.scss +21 -10
  22. data/node_modules/govuk-frontend/govuk/components/button/button.js +927 -917
  23. data/node_modules/govuk-frontend/govuk/components/button/button.js.map +1 -0
  24. data/node_modules/govuk-frontend/govuk/components/character-count/character-count.js +2050 -2040
  25. data/node_modules/govuk-frontend/govuk/components/character-count/character-count.js.map +1 -0
  26. data/node_modules/govuk-frontend/govuk/components/checkboxes/checkboxes.js +1155 -1147
  27. data/node_modules/govuk-frontend/govuk/components/checkboxes/checkboxes.js.map +1 -0
  28. data/node_modules/govuk-frontend/govuk/components/cookie-banner/fixtures.json +23 -23
  29. data/node_modules/govuk-frontend/govuk/components/cookie-banner/template.njk +1 -1
  30. data/node_modules/govuk-frontend/govuk/components/details/details.js +800 -799
  31. data/node_modules/govuk-frontend/govuk/components/details/details.js.map +1 -0
  32. data/node_modules/govuk-frontend/govuk/components/error-summary/error-summary.js +1058 -1045
  33. data/node_modules/govuk-frontend/govuk/components/error-summary/error-summary.js.map +1 -0
  34. data/node_modules/govuk-frontend/govuk/components/header/_index.scss +6 -0
  35. data/node_modules/govuk-frontend/govuk/components/header/header.js +646 -998
  36. data/node_modules/govuk-frontend/govuk/components/header/header.js.map +1 -0
  37. data/node_modules/govuk-frontend/govuk/components/notification-banner/notification-banner.js +760 -752
  38. data/node_modules/govuk-frontend/govuk/components/notification-banner/notification-banner.js.map +1 -0
  39. data/node_modules/govuk-frontend/govuk/components/pagination/fixtures.json +61 -0
  40. data/node_modules/govuk-frontend/govuk/components/pagination/template.njk +1 -1
  41. data/node_modules/govuk-frontend/govuk/components/phase-banner/macro-options.json +1 -1
  42. data/node_modules/govuk-frontend/govuk/components/radios/radios.js +1110 -1107
  43. data/node_modules/govuk-frontend/govuk/components/radios/radios.js.map +1 -0
  44. data/node_modules/govuk-frontend/govuk/components/skip-link/skip-link.js +1017 -1014
  45. data/node_modules/govuk-frontend/govuk/components/skip-link/skip-link.js.map +1 -0
  46. data/node_modules/govuk-frontend/govuk/components/summary-list/_index.scss +107 -0
  47. data/node_modules/govuk-frontend/govuk/components/summary-list/fixtures.json +318 -23
  48. data/node_modules/govuk-frontend/govuk/components/summary-list/macro-options.json +110 -0
  49. data/node_modules/govuk-frontend/govuk/components/summary-list/template.njk +72 -28
  50. data/node_modules/govuk-frontend/govuk/components/tabs/tabs.js +1392 -1264
  51. data/node_modules/govuk-frontend/govuk/components/tabs/tabs.js.map +1 -0
  52. data/node_modules/govuk-frontend/govuk/i18n.js +363 -364
  53. data/node_modules/govuk-frontend/govuk/i18n.js.map +1 -0
  54. data/node_modules/govuk-frontend/govuk/settings/_measurements.scss +5 -5
  55. data/node_modules/govuk-frontend/govuk/vendor/polyfills/DOMTokenList.js +242 -241
  56. data/node_modules/govuk-frontend/govuk/vendor/polyfills/DOMTokenList.js.map +1 -0
  57. data/node_modules/govuk-frontend/govuk/vendor/polyfills/Date/now.js +13 -12
  58. data/node_modules/govuk-frontend/govuk/vendor/polyfills/Date/now.js.map +1 -0
  59. data/node_modules/govuk-frontend/govuk/vendor/polyfills/Document.js +17 -16
  60. data/node_modules/govuk-frontend/govuk/vendor/polyfills/Document.js.map +1 -0
  61. data/node_modules/govuk-frontend/govuk/vendor/polyfills/Element/prototype/classList.js +547 -546
  62. data/node_modules/govuk-frontend/govuk/vendor/polyfills/Element/prototype/classList.js.map +1 -0
  63. data/node_modules/govuk-frontend/govuk/vendor/polyfills/Element/prototype/closest.js +37 -36
  64. data/node_modules/govuk-frontend/govuk/vendor/polyfills/Element/prototype/closest.js.map +1 -0
  65. data/node_modules/govuk-frontend/govuk/vendor/polyfills/Element/prototype/dataset.js +251 -250
  66. data/node_modules/govuk-frontend/govuk/vendor/polyfills/Element/prototype/dataset.js.map +1 -0
  67. data/node_modules/govuk-frontend/govuk/vendor/polyfills/Element/prototype/matches.js +21 -20
  68. data/node_modules/govuk-frontend/govuk/vendor/polyfills/Element/prototype/matches.js.map +1 -0
  69. data/node_modules/govuk-frontend/govuk/vendor/polyfills/Element/prototype/nextElementSibling.js +198 -197
  70. data/node_modules/govuk-frontend/govuk/vendor/polyfills/Element/prototype/nextElementSibling.js.map +1 -0
  71. data/node_modules/govuk-frontend/govuk/vendor/polyfills/Element/prototype/previousElementSibling.js +198 -197
  72. data/node_modules/govuk-frontend/govuk/vendor/polyfills/Element/prototype/previousElementSibling.js.map +1 -0
  73. data/node_modules/govuk-frontend/govuk/vendor/polyfills/Element.js +106 -105
  74. data/node_modules/govuk-frontend/govuk/vendor/polyfills/Element.js.map +1 -0
  75. data/node_modules/govuk-frontend/govuk/vendor/polyfills/Event.js +400 -399
  76. data/node_modules/govuk-frontend/govuk/vendor/polyfills/Event.js.map +1 -0
  77. data/node_modules/govuk-frontend/govuk/vendor/polyfills/Function/prototype/bind.js +239 -238
  78. data/node_modules/govuk-frontend/govuk/vendor/polyfills/Function/prototype/bind.js.map +1 -0
  79. data/node_modules/govuk-frontend/govuk/vendor/polyfills/Object/defineProperty.js +72 -71
  80. data/node_modules/govuk-frontend/govuk/vendor/polyfills/Object/defineProperty.js.map +1 -0
  81. data/node_modules/govuk-frontend/govuk/vendor/polyfills/String/prototype/trim.js +14 -13
  82. data/node_modules/govuk-frontend/govuk/vendor/polyfills/String/prototype/trim.js.map +1 -0
  83. data/node_modules/govuk-frontend/govuk/vendor/polyfills/Window.js +17 -16
  84. data/node_modules/govuk-frontend/govuk/vendor/polyfills/Window.js.map +1 -0
  85. data/node_modules/govuk-frontend/govuk-esm/all.mjs +2 -2
  86. data/node_modules/govuk-frontend/govuk-esm/common/index.mjs +17 -10
  87. data/node_modules/govuk-frontend/govuk-esm/common/normalise-dataset.mjs +3 -1
  88. data/node_modules/govuk-frontend/govuk-esm/components/accordion/accordion.mjs +135 -52
  89. data/node_modules/govuk-frontend/govuk-esm/components/button/button.mjs +11 -9
  90. data/node_modules/govuk-frontend/govuk-esm/components/character-count/character-count.mjs +10 -7
  91. data/node_modules/govuk-frontend/govuk-esm/components/checkboxes/checkboxes.mjs +24 -18
  92. data/node_modules/govuk-frontend/govuk-esm/components/details/details.mjs +23 -16
  93. data/node_modules/govuk-frontend/govuk-esm/components/error-summary/error-summary.mjs +15 -11
  94. data/node_modules/govuk-frontend/govuk-esm/components/header/header.mjs +3 -2
  95. data/node_modules/govuk-frontend/govuk-esm/components/notification-banner/notification-banner.mjs +3 -4
  96. data/node_modules/govuk-frontend/govuk-esm/components/radios/radios.mjs +10 -9
  97. data/node_modules/govuk-frontend/govuk-esm/components/skip-link/skip-link.mjs +5 -3
  98. data/node_modules/govuk-frontend/govuk-esm/components/tabs/tabs.mjs +165 -38
  99. data/node_modules/govuk-frontend/govuk-esm/i18n.mjs +9 -11
  100. data/node_modules/govuk-frontend/package.json +1 -1
  101. metadata +34 -2
@@ -98,6 +98,116 @@
98
98
  }
99
99
  ]
100
100
  },
101
+ {
102
+ "name": "card",
103
+ "type": "object",
104
+ "required": false,
105
+ "description": "Options for the summary card. If any of these options are present, a summary card will wrap around the summary list.",
106
+ "params": [
107
+ {
108
+ "name": "title",
109
+ "type": "object",
110
+ "required": false,
111
+ "description": "Data for the summary card header.",
112
+ "params": [
113
+ {
114
+ "name": "text",
115
+ "type": "string",
116
+ "required": false,
117
+ "description": "Text to use within the each title. If `html` is provided, the `text` option will be ignored."
118
+ },
119
+ {
120
+ "name": "html",
121
+ "type": "string",
122
+ "required": false,
123
+ "description": "Text to use within the each title. If `html` is provided, the `text` option will be ignored."
124
+ },
125
+ {
126
+ "name": "headingLevel",
127
+ "type": "integer",
128
+ "required": false,
129
+ "description": "Heading level, from `1` to `6`. Default is `2`."
130
+ },
131
+ {
132
+ "name": "classes",
133
+ "type": "string",
134
+ "required": false,
135
+ "description": "Classes to add to the title wrapper."
136
+ }
137
+ ]
138
+ },
139
+ {
140
+ "name": "actions",
141
+ "type": "object",
142
+ "required": false,
143
+ "description": "Data for the summary card actions",
144
+ "params": [
145
+ {
146
+ "name": "items",
147
+ "type": "array",
148
+ "required": false,
149
+ "description": "Array of action item objects.",
150
+ "params": [
151
+ {
152
+ "name": "href",
153
+ "type": "string",
154
+ "required": true,
155
+ "description": "The value of the link's `href` attribute for an action item."
156
+ },
157
+ {
158
+ "name": "text",
159
+ "type": "string",
160
+ "required": true,
161
+ "description": "If `html` is set, this is not required. Text to use within each action item. If `html` is provided, the `text` option will be ignored."
162
+ },
163
+ {
164
+ "name": "html",
165
+ "type": "string",
166
+ "required": true,
167
+ "description": "If `text` is set, this is not required. HTML to use within the each action item. If `html` is provided, the `text` option will be ignored."
168
+ },
169
+ {
170
+ "name": "visuallyHiddenText",
171
+ "type": "string",
172
+ "required": false,
173
+ "description": "Actions rely on context from the surrounding content so may require additional accessible text. Text supplied to this option is appended to the end. Use `html` for more complicated scenarios."
174
+ },
175
+ {
176
+ "name": "classes",
177
+ "type": "string",
178
+ "required": false,
179
+ "description": "Classes to add to the action item."
180
+ },
181
+ {
182
+ "name": "attributes",
183
+ "type": "object",
184
+ "required": false,
185
+ "description": "HTML attributes (for example data attributes) to add to the action item."
186
+ }
187
+ ]
188
+ },
189
+ {
190
+ "name": "classes",
191
+ "type": "string",
192
+ "required": false,
193
+ "description": "Classes to add to the actions wrapper."
194
+ }
195
+ ]
196
+ },
197
+ {
198
+ "name": "classes",
199
+ "type": "string",
200
+ "required": false,
201
+ "description": "Classes to add to the container."
202
+ },
203
+ {
204
+ "name": "attributes",
205
+ "type": "object",
206
+ "required": false,
207
+ "description": "HTML attributes (for example data attributes) to add to the container."
208
+ }
209
+ ]
210
+ },
101
211
  {
102
212
  "name": "classes",
103
213
  "type": "string",
@@ -7,38 +7,82 @@
7
7
  </a>
8
8
  {% endmacro -%}
9
9
 
10
+ {%- macro _summaryCard(params) %}
11
+ {%- set headingLevel = params.title.headingLevel if params.title.headingLevel else 2 -%}
12
+
13
+ <div class="govuk-summary-card {%- if params.classes %} {{ params.classes }}{% endif %}"{% for attribute, value in params.attributes %} {{attribute}}="{{value}}"{% endfor %}>
14
+ <div class="govuk-summary-card__title-wrapper">
15
+ {%- if params.title -%}
16
+ <h{{ headingLevel }} class="govuk-summary-card__title {%- if params.title.classes %} {{ params.title.classes }}{% endif %}">
17
+ {{- params.title.html | safe if params.title.html else params.title.text -}}
18
+ </h{{ headingLevel }}>
19
+ {%- endif -%}
20
+
21
+ {%- if params.actions.items.length -%}
22
+ {%- if params.actions.items.length == 1 -%}
23
+ <div class="govuk-summary-card__actions {%- if params.actions.classes %} {{ params.actions.classes }}{% endif %}">
24
+ {{- _actionLink(params.actions.items[0]) -}}
25
+ </div>
26
+ {%- else -%}
27
+ <ul class="govuk-summary-card__actions {%- if params.actions.classes %} {{ params.actions.classes }}{% endif %}">
28
+ {%- for action in params.actions.items -%}
29
+ <li class="govuk-summary-card__action">
30
+ {{- _actionLink(action) -}}
31
+ </li>
32
+ {%- endfor -%}
33
+ </ul>
34
+ {% endif -%}
35
+ {%- endif -%}
36
+ </div>
37
+
38
+ <div class="govuk-summary-card__content">
39
+ {{- caller() -}}
40
+ </div>
41
+ </div>
42
+ {% endmacro -%}
43
+
10
44
  {# Determine if we need 2 or 3 columns #}
11
45
  {% set anyRowHasActions = false %}
12
46
  {% for row in params.rows %}
13
47
  {% set anyRowHasActions = true if row.actions.items | length else anyRowHasActions %}
14
48
  {% endfor -%}
15
49
 
16
- <dl class="govuk-summary-list {%- if params.classes %} {{ params.classes }}{% endif %}"{% for attribute, value in params.attributes %} {{attribute}}="{{value}}"{% endfor %}>
17
- {% for row in params.rows %}
18
- {% if row %}
19
- <div class="govuk-summary-list__row {%- if anyRowHasActions and not row.actions.items %} govuk-summary-list__row--no-actions{% endif %} {%- if row.classes %} {{ row.classes }}{% endif %}">
20
- <dt class="govuk-summary-list__key {%- if row.key.classes %} {{ row.key.classes }}{% endif %}">
21
- {{ row.key.html | safe if row.key.html else row.key.text }}
22
- </dt>
23
- <dd class="govuk-summary-list__value {%- if row.value.classes %} {{ row.value.classes }}{% endif %}">
24
- {{ row.value.html | indent(8) | trim | safe if row.value.html else row.value.text }}
25
- </dd>
26
- {% if row.actions.items.length %}
27
- <dd class="govuk-summary-list__actions {%- if row.actions.classes %} {{ row.actions.classes }}{% endif %}">
28
- {% if row.actions.items.length == 1 %}
29
- {{ _actionLink(row.actions.items[0]) | indent(12) | trim }}
30
- {% else %}
31
- <ul class="govuk-summary-list__actions-list">
32
- {%- for action in row.actions.items -%}
33
- <li class="govuk-summary-list__actions-list-item">
34
- {{- _actionLink(action) | indent(18) | trim -}}
35
- </li>
36
- {%- endfor -%}
37
- </ul>
38
- {% endif %}
50
+ {%- set summaryList -%}
51
+ <dl class="govuk-summary-list {%- if params.classes %} {{ params.classes }}{% endif %}"{% for attribute, value in params.attributes %} {{attribute}}="{{value}}"{% endfor %}>
52
+ {% for row in params.rows %}
53
+ {% if row %}
54
+ <div class="govuk-summary-list__row {%- if anyRowHasActions and not row.actions.items %} govuk-summary-list__row--no-actions{% endif %} {%- if row.classes %} {{ row.classes }}{% endif %}">
55
+ <dt class="govuk-summary-list__key {%- if row.key.classes %} {{ row.key.classes }}{% endif %}">
56
+ {{ row.key.html | indent(4 if params.card else 0) | safe if row.key.html else row.key.text }}
57
+ </dt>
58
+ <dd class="govuk-summary-list__value {%- if row.value.classes %} {{ row.value.classes }}{% endif %}">
59
+ {{ row.value.html | indent(12 if params.card else 8) | trim | safe if row.value.html else row.value.text }}
39
60
  </dd>
40
- {% endif %}
41
- </div>
42
- {% endif %}
43
- {% endfor %}
44
- </dl>
61
+ {% if row.actions.items.length %}
62
+ <dd class="govuk-summary-list__actions {%- if row.actions.classes %} {{ row.actions.classes }}{% endif %}">
63
+ {% if row.actions.items.length == 1 %}
64
+ {{ _actionLink(row.actions.items[0]) | indent(16 if params.card else 12) | trim }}
65
+ {% else %}
66
+ <ul class="govuk-summary-list__actions-list">
67
+ {%- for action in row.actions.items -%}
68
+ <li class="govuk-summary-list__actions-list-item">
69
+ {{- _actionLink(action) | indent(22 if params.card else 18) | trim -}}
70
+ </li>
71
+ {%- endfor -%}
72
+ </ul>
73
+ {% endif %}
74
+ </dd>
75
+ {% endif %}
76
+ </div>
77
+ {% endif %}
78
+ {% endfor %}
79
+ </dl>
80
+ {%- endset %}
81
+
82
+ {%- if params.card -%}
83
+ {% call _summaryCard(params.card) -%}
84
+ {{ summaryList | safe }}
85
+ {%- endcall %}
86
+ {%- else -%}
87
+ {{ summaryList | safe }}
88
+ {%- endif %}