govuk_publishing_components 29.13.0 → 29.15.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (159) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/images/govuk_publishing_components/action-link-arrow--white.png +0 -0
  3. data/app/assets/images/govuk_publishing_components/action-link-arrow--white.svg +1 -0
  4. data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/gtm-page-views.js +5 -3
  5. data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/pii-remover.js +135 -0
  6. data/app/assets/javascripts/govuk_publishing_components/analytics-ga4.js +2 -0
  7. data/app/assets/javascripts/govuk_publishing_components/components/accordion.js +27 -22
  8. data/app/assets/javascripts/govuk_publishing_components/components/table.js +52 -0
  9. data/app/assets/stylesheets/govuk_publishing_components/components/_action-link.scss +7 -0
  10. data/app/assets/stylesheets/govuk_publishing_components/components/_previous-and-next-navigation.scss +1 -92
  11. data/app/models/govuk_publishing_components/audit_applications.rb +31 -9
  12. data/app/models/govuk_publishing_components/audit_comparer.rb +15 -9
  13. data/app/views/govuk_publishing_components/audit/_components.html.erb +20 -2
  14. data/app/views/govuk_publishing_components/components/_action_link.html.erb +2 -0
  15. data/app/views/govuk_publishing_components/components/_previous_and_next_navigation.html.erb +33 -36
  16. data/app/views/govuk_publishing_components/components/_table.html.erb +61 -30
  17. data/app/views/govuk_publishing_components/components/docs/accordion.yml +2 -1
  18. data/app/views/govuk_publishing_components/components/docs/action_link.yml +8 -0
  19. data/app/views/govuk_publishing_components/components/docs/back_link.yml +1 -1
  20. data/app/views/govuk_publishing_components/components/docs/big_number.yml +2 -2
  21. data/app/views/govuk_publishing_components/components/docs/breadcrumbs.yml +2 -2
  22. data/app/views/govuk_publishing_components/components/docs/button.yml +41 -40
  23. data/app/views/govuk_publishing_components/components/docs/cards.yml +2 -0
  24. data/app/views/govuk_publishing_components/components/docs/checkboxes.yml +216 -216
  25. data/app/views/govuk_publishing_components/components/docs/cookie_banner.yml +2 -1
  26. data/app/views/govuk_publishing_components/components/docs/copy_to_clipboard.yml +2 -2
  27. data/app/views/govuk_publishing_components/components/docs/details.yml +5 -1
  28. data/app/views/govuk_publishing_components/components/docs/document_list.yml +1 -2
  29. data/app/views/govuk_publishing_components/components/docs/error_alert.yml +4 -0
  30. data/app/views/govuk_publishing_components/components/docs/error_summary.yml +4 -6
  31. data/app/views/govuk_publishing_components/components/docs/image_card.yml +2 -1
  32. data/app/views/govuk_publishing_components/components/docs/intervention.yml +25 -25
  33. data/app/views/govuk_publishing_components/components/docs/organisation_logo.yml +1 -2
  34. data/app/views/govuk_publishing_components/components/docs/previous_and_next_navigation.yml +1 -1
  35. data/app/views/govuk_publishing_components/components/docs/print_link.yml +5 -1
  36. data/app/views/govuk_publishing_components/components/docs/select.yml +101 -98
  37. data/app/views/govuk_publishing_components/components/docs/table.yml +36 -1
  38. data/app/views/govuk_publishing_components/components/docs/tabs.yml +4 -0
  39. data/config/locales/ar.yml +6 -0
  40. data/config/locales/az.yml +6 -0
  41. data/config/locales/be.yml +6 -0
  42. data/config/locales/bg.yml +6 -0
  43. data/config/locales/bn.yml +6 -0
  44. data/config/locales/cs.yml +6 -0
  45. data/config/locales/cy.yml +6 -0
  46. data/config/locales/da.yml +6 -0
  47. data/config/locales/de.yml +6 -0
  48. data/config/locales/dr.yml +6 -0
  49. data/config/locales/el.yml +6 -0
  50. data/config/locales/en.yml +6 -0
  51. data/config/locales/es-419.yml +6 -0
  52. data/config/locales/es.yml +6 -0
  53. data/config/locales/et.yml +6 -0
  54. data/config/locales/fa.yml +6 -0
  55. data/config/locales/fi.yml +6 -0
  56. data/config/locales/fr.yml +6 -0
  57. data/config/locales/gd.yml +6 -0
  58. data/config/locales/gu.yml +6 -0
  59. data/config/locales/he.yml +6 -0
  60. data/config/locales/hi.yml +6 -0
  61. data/config/locales/hr.yml +6 -0
  62. data/config/locales/hu.yml +6 -0
  63. data/config/locales/hy.yml +6 -0
  64. data/config/locales/id.yml +6 -0
  65. data/config/locales/is.yml +6 -0
  66. data/config/locales/it.yml +6 -0
  67. data/config/locales/ja.yml +6 -0
  68. data/config/locales/ka.yml +6 -0
  69. data/config/locales/kk.yml +6 -0
  70. data/config/locales/ko.yml +6 -0
  71. data/config/locales/lt.yml +6 -0
  72. data/config/locales/lv.yml +6 -0
  73. data/config/locales/ms.yml +6 -0
  74. data/config/locales/mt.yml +6 -0
  75. data/config/locales/nl.yml +6 -0
  76. data/config/locales/no.yml +6 -0
  77. data/config/locales/pa-pk.yml +6 -0
  78. data/config/locales/pa.yml +6 -0
  79. data/config/locales/pl.yml +6 -0
  80. data/config/locales/ps.yml +6 -0
  81. data/config/locales/pt.yml +6 -0
  82. data/config/locales/ro.yml +6 -0
  83. data/config/locales/ru.yml +6 -0
  84. data/config/locales/si.yml +6 -0
  85. data/config/locales/sk.yml +6 -0
  86. data/config/locales/sl.yml +6 -0
  87. data/config/locales/so.yml +6 -0
  88. data/config/locales/sq.yml +6 -0
  89. data/config/locales/sr.yml +6 -0
  90. data/config/locales/sv.yml +6 -0
  91. data/config/locales/sw.yml +6 -0
  92. data/config/locales/ta.yml +6 -0
  93. data/config/locales/th.yml +6 -0
  94. data/config/locales/tk.yml +6 -0
  95. data/config/locales/tr.yml +6 -0
  96. data/config/locales/uk.yml +6 -0
  97. data/config/locales/ur.yml +6 -0
  98. data/config/locales/uz.yml +6 -0
  99. data/config/locales/vi.yml +6 -0
  100. data/config/locales/zh-hk.yml +6 -0
  101. data/config/locales/zh-tw.yml +6 -0
  102. data/config/locales/zh.yml +6 -0
  103. data/lib/govuk_publishing_components/app_helpers/table_helper.rb +4 -2
  104. data/lib/govuk_publishing_components/version.rb +1 -1
  105. data/node_modules/govuk-frontend/govuk/components/_all.scss +1 -0
  106. data/node_modules/govuk-frontend/govuk/components/accordion/_index.scss +1 -0
  107. data/node_modules/govuk-frontend/govuk/components/character-count/fixtures.json +2 -1
  108. data/node_modules/govuk-frontend/govuk/components/checkboxes/fixtures.json +102 -44
  109. data/node_modules/govuk-frontend/govuk/components/checkboxes/macro-options.json +7 -1
  110. data/node_modules/govuk-frontend/govuk/components/checkboxes/template.njk +3 -2
  111. data/node_modules/govuk-frontend/govuk/components/cookie-banner/fixtures.json +10 -10
  112. data/node_modules/govuk-frontend/govuk/components/fieldset/fixtures.json +92 -1
  113. data/node_modules/govuk-frontend/govuk/components/file-upload/fixtures.json +2 -1
  114. data/node_modules/govuk-frontend/govuk/components/header/_index.scss +3 -0
  115. data/node_modules/govuk-frontend/govuk/components/header/fixtures.json +14 -6
  116. data/node_modules/govuk-frontend/govuk/components/header/template.njk +9 -3
  117. data/node_modules/govuk-frontend/govuk/components/input/fixtures.json +2 -1
  118. data/node_modules/govuk-frontend/govuk/components/input/macro-options.json +1 -1
  119. data/node_modules/govuk-frontend/govuk/components/label/fixtures.json +76 -1
  120. data/node_modules/govuk-frontend/govuk/components/pagination/README.md +15 -0
  121. data/node_modules/govuk-frontend/govuk/components/pagination/_index.scss +244 -0
  122. data/node_modules/govuk-frontend/govuk/components/pagination/_pagination.scss +2 -0
  123. data/node_modules/govuk-frontend/govuk/components/pagination/fixtures.json +300 -0
  124. data/node_modules/govuk-frontend/govuk/components/pagination/macro-options.json +128 -0
  125. data/node_modules/govuk-frontend/govuk/components/pagination/macro.njk +3 -0
  126. data/node_modules/govuk-frontend/govuk/components/pagination/template.njk +62 -0
  127. data/node_modules/govuk-frontend/govuk/components/radios/fixtures.json +147 -43
  128. data/node_modules/govuk-frontend/govuk/components/radios/macro-options.json +7 -1
  129. data/node_modules/govuk-frontend/govuk/components/radios/template.njk +3 -2
  130. data/node_modules/govuk-frontend/govuk/components/select/fixtures.json +56 -2
  131. data/node_modules/govuk-frontend/govuk/components/select/macro-options.json +7 -1
  132. data/node_modules/govuk-frontend/govuk/components/select/template.njk +1 -1
  133. data/node_modules/govuk-frontend/govuk/components/textarea/fixtures.json +2 -1
  134. data/node_modules/govuk-frontend/govuk-esm/all.mjs +12 -12
  135. data/node_modules/govuk-frontend/govuk-esm/components/accordion/accordion.mjs +3 -3
  136. data/node_modules/govuk-frontend/govuk-esm/components/button/button.mjs +2 -2
  137. data/node_modules/govuk-frontend/govuk-esm/components/character-count/character-count.mjs +3 -3
  138. data/node_modules/govuk-frontend/govuk-esm/components/checkboxes/checkboxes.mjs +4 -4
  139. data/node_modules/govuk-frontend/govuk-esm/components/details/details.mjs +3 -3
  140. data/node_modules/govuk-frontend/govuk-esm/components/error-summary/error-summary.mjs +3 -3
  141. data/node_modules/govuk-frontend/govuk-esm/components/header/header.mjs +3 -3
  142. data/node_modules/govuk-frontend/govuk-esm/components/notification-banner/notification-banner.mjs +1 -1
  143. data/node_modules/govuk-frontend/govuk-esm/components/radios/radios.mjs +4 -4
  144. data/node_modules/govuk-frontend/govuk-esm/components/skip-link/skip-link.mjs +3 -3
  145. data/node_modules/govuk-frontend/govuk-esm/components/tabs/tabs.mjs +6 -6
  146. data/node_modules/govuk-frontend/govuk-esm/vendor/polyfills/{DOMTokenList.js → DOMTokenList.mjs} +0 -0
  147. data/node_modules/govuk-frontend/govuk-esm/vendor/polyfills/{Document.js → Document.mjs} +0 -0
  148. data/node_modules/govuk-frontend/govuk-esm/vendor/polyfills/Element/prototype/{classList.js → classList.mjs} +4 -4
  149. data/node_modules/govuk-frontend/govuk-esm/vendor/polyfills/Element/prototype/{closest.js → closest.mjs} +1 -1
  150. data/node_modules/govuk-frontend/govuk-esm/vendor/polyfills/Element/prototype/{matches.js → matches.mjs} +0 -0
  151. data/node_modules/govuk-frontend/govuk-esm/vendor/polyfills/Element/prototype/{nextElementSibling.js → nextElementSibling.mjs} +2 -2
  152. data/node_modules/govuk-frontend/govuk-esm/vendor/polyfills/Element/prototype/{previousElementSibling.js → previousElementSibling.mjs} +2 -2
  153. data/node_modules/govuk-frontend/govuk-esm/vendor/polyfills/{Element.js → Element.mjs} +1 -1
  154. data/node_modules/govuk-frontend/govuk-esm/vendor/polyfills/{Event.js → Event.mjs} +3 -3
  155. data/node_modules/govuk-frontend/govuk-esm/vendor/polyfills/Function/prototype/{bind.js → bind.mjs} +1 -1
  156. data/node_modules/govuk-frontend/govuk-esm/vendor/polyfills/Object/{defineProperty.js → defineProperty.mjs} +0 -0
  157. data/node_modules/govuk-frontend/govuk-esm/vendor/polyfills/{Window.js → Window.mjs} +0 -0
  158. data/node_modules/govuk-frontend/package.json +8 -2
  159. metadata +26 -15
@@ -19,7 +19,43 @@
19
19
  "hidden": false
20
20
  },
21
21
  {
22
- "name": "as page heading",
22
+ "name": "styled as xl text",
23
+ "options": {
24
+ "text": "National Insurance number",
25
+ "classes": "govuk-label--xl"
26
+ },
27
+ "html": "<label class=\"govuk-label govuk-label--xl\">\n National Insurance number\n</label>",
28
+ "hidden": false
29
+ },
30
+ {
31
+ "name": "styled as large text",
32
+ "options": {
33
+ "text": "National Insurance number",
34
+ "classes": "govuk-label--l"
35
+ },
36
+ "html": "<label class=\"govuk-label govuk-label--l\">\n National Insurance number\n</label>",
37
+ "hidden": false
38
+ },
39
+ {
40
+ "name": "styled as medium text",
41
+ "options": {
42
+ "text": "National Insurance number",
43
+ "classes": "govuk-label--m"
44
+ },
45
+ "html": "<label class=\"govuk-label govuk-label--m\">\n National Insurance number\n</label>",
46
+ "hidden": false
47
+ },
48
+ {
49
+ "name": "styled as small text",
50
+ "options": {
51
+ "text": "National Insurance number",
52
+ "classes": "govuk-label--s"
53
+ },
54
+ "html": "<label class=\"govuk-label govuk-label--s\">\n National Insurance number\n</label>",
55
+ "hidden": false
56
+ },
57
+ {
58
+ "name": "as page heading xl",
23
59
  "options": {
24
60
  "text": "National Insurance number",
25
61
  "classes": "govuk-label--xl",
@@ -28,6 +64,45 @@
28
64
  "html": "<h1 class=\"govuk-label-wrapper\">\n <label class=\"govuk-label govuk-label--xl\">\n National Insurance number\n </label>\n </h1>",
29
65
  "hidden": false
30
66
  },
67
+ {
68
+ "name": "as page heading l",
69
+ "options": {
70
+ "text": "National Insurance number",
71
+ "classes": "govuk-label--l",
72
+ "isPageHeading": true
73
+ },
74
+ "html": "<h1 class=\"govuk-label-wrapper\">\n <label class=\"govuk-label govuk-label--l\">\n National Insurance number\n </label>\n </h1>",
75
+ "hidden": false
76
+ },
77
+ {
78
+ "name": "as page heading m",
79
+ "options": {
80
+ "text": "National Insurance number",
81
+ "classes": "govuk-label--m",
82
+ "isPageHeading": true
83
+ },
84
+ "html": "<h1 class=\"govuk-label-wrapper\">\n <label class=\"govuk-label govuk-label--m\">\n National Insurance number\n </label>\n </h1>",
85
+ "hidden": false
86
+ },
87
+ {
88
+ "name": "as page heading s",
89
+ "options": {
90
+ "text": "National Insurance number",
91
+ "classes": "govuk-label--s",
92
+ "isPageHeading": true
93
+ },
94
+ "html": "<h1 class=\"govuk-label-wrapper\">\n <label class=\"govuk-label govuk-label--s\">\n National Insurance number\n </label>\n </h1>",
95
+ "hidden": false
96
+ },
97
+ {
98
+ "name": "as page heading without class",
99
+ "options": {
100
+ "text": "National Insurance number",
101
+ "isPageHeading": true
102
+ },
103
+ "html": "<h1 class=\"govuk-label-wrapper\">\n <label class=\"govuk-label\">\n National Insurance number\n </label>\n </h1>",
104
+ "hidden": false
105
+ },
31
106
  {
32
107
  "name": "empty",
33
108
  "options": {},
@@ -0,0 +1,15 @@
1
+ # Pagination
2
+
3
+ ## Installation
4
+
5
+ See the [main README quick start guide](https://github.com/alphagov/govuk-frontend#quick-start) for how to install this component.
6
+
7
+ ## Guidance and Examples
8
+
9
+ Find out when to use the pagination component in your service in the [GOV.UK Design System](https://design-system.service.gov.uk/components/pagination).
10
+
11
+ ## Component options
12
+
13
+ Use options to customise the appearance, content and behaviour of a component when using a macro, for example, changing the text.
14
+
15
+ See [options table](https://design-system.service.gov.uk/components/details/#options-pagination-example) for details.
@@ -0,0 +1,244 @@
1
+ @include govuk-exports("govuk/component/pagination") {
2
+ // Flexbox enhancement for small screen visual design
3
+ // Falls back to a float: left layout on non-flex browsers
4
+ .govuk-pagination {
5
+ @include govuk-responsive-margin(6, "bottom");
6
+ display: -ms-flexbox;
7
+ display: flex;
8
+ -ms-flex-direction: column;
9
+ flex-direction: column;
10
+ -ms-flex-align: center;
11
+ align-items: center;
12
+ -ms-flex-wrap: wrap;
13
+ flex-wrap: wrap;
14
+
15
+ @include govuk-media-query($from: tablet) {
16
+ -ms-flex-direction: row;
17
+ flex-direction: row;
18
+ -ms-flex-align: start;
19
+ align-items: flex-start;
20
+ }
21
+ }
22
+
23
+ .govuk-pagination__list {
24
+ margin: 0;
25
+ padding: 0;
26
+ list-style: none;
27
+ }
28
+
29
+ .govuk-pagination__item,
30
+ .govuk-pagination__next,
31
+ .govuk-pagination__prev {
32
+ @include govuk-font(19);
33
+ box-sizing: border-box;
34
+ position: relative;
35
+ min-width: 45px;
36
+ min-height: 45px;
37
+ padding: govuk-spacing(2) govuk-spacing(3);
38
+ float: left; // Float is ignored if flex is active for prev/next links
39
+
40
+ &:hover {
41
+ background-color: govuk-colour("light-grey", $legacy: "grey-4");
42
+ }
43
+ }
44
+
45
+ .govuk-pagination__item {
46
+ // Hide items on small screens except the prev/next items,
47
+ // non-link items and the first and last items
48
+ display: none;
49
+
50
+ // Center align pagination links in their parent list item so that they
51
+ // visually sit in the middle of their touch area
52
+ text-align: center;
53
+
54
+ @include govuk-media-query($from: tablet) {
55
+ display: block;
56
+ }
57
+ }
58
+
59
+ .govuk-pagination__prev,
60
+ .govuk-pagination__next {
61
+ @include govuk-typography-weight-bold;
62
+
63
+ // Use flex to get around a whitespace issue between the arrow svg and the link text
64
+ // without having to rely on whitespace control from backend tooling
65
+ .govuk-pagination__link {
66
+ display: -ms-flexbox;
67
+ display: flex;
68
+ -ms-flex-align: center;
69
+ align-items: center;
70
+ }
71
+ }
72
+
73
+ .govuk-pagination__prev {
74
+ padding-left: 0;
75
+ }
76
+
77
+ .govuk-pagination__next {
78
+ padding-right: 0;
79
+ }
80
+
81
+ // Only show first, last and non-link items on mobile
82
+ .govuk-pagination__item--current,
83
+ .govuk-pagination__item--ellipses,
84
+ .govuk-pagination__item:first-child,
85
+ .govuk-pagination__item:last-child {
86
+ display: block;
87
+ }
88
+
89
+ .govuk-pagination__item--current {
90
+ @include govuk-typography-weight-bold;
91
+ outline: 1px solid transparent;
92
+ background-color: $govuk-link-colour;
93
+
94
+ &:hover {
95
+ background-color: $govuk-link-colour;
96
+ }
97
+
98
+ .govuk-pagination__link {
99
+ @include govuk-link-style-inverse;
100
+ }
101
+ }
102
+
103
+ .govuk-pagination__item--ellipses {
104
+ @include govuk-typography-weight-bold;
105
+ color: $govuk-secondary-text-colour;
106
+
107
+ // Remove hover state for ellipsis items as they don't have links within them
108
+ &:hover {
109
+ background-color: transparent;
110
+ }
111
+ }
112
+
113
+ .govuk-pagination__link {
114
+ display: block;
115
+ min-width: govuk-spacing(3);
116
+
117
+ &:after {
118
+ content: "";
119
+ position: absolute;
120
+ top: 0;
121
+ right: 0;
122
+ bottom: 0;
123
+ left: 0;
124
+ }
125
+
126
+ // Add link hover decoration to prev/next text if no label present on prev/next only mode
127
+ // We do this so that we have a hover state in all possible instances
128
+ &:hover,
129
+ &:active {
130
+ .govuk-pagination__link-title--decorated {
131
+ @include govuk-link-decoration;
132
+ }
133
+
134
+ .govuk-pagination__link-label,
135
+ .govuk-pagination__link-title--decorated {
136
+ @include govuk-link-hover-decoration;
137
+ }
138
+ }
139
+
140
+ &:focus {
141
+ .govuk-pagination__icon {
142
+ color: $govuk-focus-text-colour;
143
+ }
144
+
145
+ .govuk-pagination__link-label {
146
+ text-decoration: none;
147
+ }
148
+
149
+ .govuk-pagination__link-title--decorated {
150
+ text-decoration: none;
151
+ }
152
+ }
153
+ }
154
+
155
+ .govuk-pagination__link-label {
156
+ @include govuk-font($size: 19, $weight: "regular");
157
+ @include govuk-link-decoration;
158
+ display: inline-block;
159
+ padding-left: govuk-spacing(6);
160
+ }
161
+
162
+ .govuk-pagination__icon {
163
+ // Set size using rems to make the icon scale with text if user resizes text in their browser
164
+ width: govuk-px-to-rem(15px);
165
+ height: govuk-px-to-rem(13px);
166
+ color: $govuk-secondary-text-colour;
167
+ fill: currentcolor;
168
+ forced-color-adjust: auto;
169
+ }
170
+
171
+ .govuk-pagination__icon--prev {
172
+ margin-right: govuk-spacing(3);
173
+ }
174
+
175
+ .govuk-pagination__icon--next {
176
+ margin-left: govuk-spacing(3);
177
+ }
178
+
179
+ // Block mode - position previous and next links above and below numbers
180
+ .govuk-pagination--block {
181
+ display: block;
182
+
183
+ .govuk-pagination__item {
184
+ padding: govuk-spacing(3);
185
+ float: none;
186
+ }
187
+
188
+ .govuk-pagination__next,
189
+ .govuk-pagination__prev {
190
+ padding-left: 0;
191
+ float: none;
192
+ }
193
+
194
+ .govuk-pagination__next {
195
+ padding-right: govuk-spacing(3);
196
+
197
+ .govuk-pagination__icon {
198
+ margin-left: 0;
199
+ }
200
+ }
201
+
202
+ // Only apply a border between prev and next if both are present
203
+ .govuk-pagination__prev + .govuk-pagination__next {
204
+ border-top: 1px solid $govuk-border-colour;
205
+ }
206
+
207
+ // Reset both these elements to their inline default, both to ensure that the focus state
208
+ // for block mode "shrink wraps" text as expected
209
+ .govuk-pagination__link,
210
+ .govuk-pagination__link-title {
211
+ display: inline;
212
+ }
213
+
214
+ // Set the after pseudo element to a block which makes the title visually display
215
+ // as block level whilst programmatically being inline
216
+ // We do this to get around an NVDA quirk where adjacent block level
217
+ // elements are always read out separately
218
+ .govuk-pagination__link-title:after {
219
+ content: "";
220
+ display: block;
221
+ }
222
+
223
+ .govuk-pagination__link {
224
+ text-align: left;
225
+
226
+ &:focus {
227
+ // apply focus styling to the label within the link as if it were being focused
228
+ // to get around a display issue with a focusable inline element containing a mixture
229
+ // of inline and inline-block level elements
230
+ .govuk-pagination__link-label {
231
+ @include govuk-focused-text;
232
+ }
233
+ }
234
+
235
+ &:not(:focus) {
236
+ text-decoration: none;
237
+ }
238
+ }
239
+
240
+ .govuk-pagination__icon {
241
+ margin-right: govuk-spacing(2);
242
+ }
243
+ }
244
+ }
@@ -0,0 +1,2 @@
1
+ @import "../../base";
2
+ @import "./index";