govuk_tech_docs 4.2.0 → 4.3.0

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 (73) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +8 -0
  3. data/govuk_tech_docs.gemspec +1 -1
  4. data/lib/assets/stylesheets/_govuk_tech_docs.scss +3 -0
  5. data/lib/govuk_tech_docs/version.rb +1 -1
  6. data/lib/source/layouts/core.erb +16 -5
  7. data/node_modules/govuk-frontend/dist/govuk/all.bundle.js +508 -209
  8. data/node_modules/govuk-frontend/dist/govuk/all.bundle.mjs +505 -208
  9. data/node_modules/govuk-frontend/dist/govuk/all.mjs +3 -1
  10. data/node_modules/govuk-frontend/dist/govuk/all.scss +6 -0
  11. data/node_modules/govuk-frontend/dist/govuk/common/configuration.mjs +169 -0
  12. data/node_modules/govuk-frontend/dist/govuk/common/govuk-frontend-version.mjs +1 -1
  13. data/node_modules/govuk-frontend/dist/govuk/common/index.mjs +4 -87
  14. data/node_modules/govuk-frontend/dist/govuk/{govuk-frontend-component.mjs → component.mjs} +5 -5
  15. data/node_modules/govuk-frontend/dist/govuk/components/accordion/accordion.bundle.js +161 -116
  16. data/node_modules/govuk-frontend/dist/govuk/components/accordion/accordion.bundle.mjs +160 -115
  17. data/node_modules/govuk-frontend/dist/govuk/components/accordion/accordion.mjs +5 -8
  18. data/node_modules/govuk-frontend/dist/govuk/components/button/button.bundle.js +161 -116
  19. data/node_modules/govuk-frontend/dist/govuk/components/button/button.bundle.mjs +160 -115
  20. data/node_modules/govuk-frontend/dist/govuk/components/button/button.mjs +5 -8
  21. data/node_modules/govuk-frontend/dist/govuk/components/character-count/_index.scss +8 -0
  22. data/node_modules/govuk-frontend/dist/govuk/components/character-count/character-count.bundle.js +187 -145
  23. data/node_modules/govuk-frontend/dist/govuk/components/character-count/character-count.bundle.mjs +186 -144
  24. data/node_modules/govuk-frontend/dist/govuk/components/character-count/character-count.mjs +18 -17
  25. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/checkboxes.bundle.js +9 -29
  26. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/checkboxes.bundle.mjs +8 -28
  27. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/checkboxes.mjs +2 -2
  28. data/node_modules/govuk-frontend/dist/govuk/components/error-summary/error-summary.bundle.js +161 -116
  29. data/node_modules/govuk-frontend/dist/govuk/components/error-summary/error-summary.bundle.mjs +160 -115
  30. data/node_modules/govuk-frontend/dist/govuk/components/error-summary/error-summary.mjs +6 -8
  31. data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/exit-this-page.bundle.js +161 -116
  32. data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/exit-this-page.bundle.mjs +160 -115
  33. data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/exit-this-page.mjs +5 -8
  34. data/node_modules/govuk-frontend/dist/govuk/components/file-upload/_index.scss +167 -0
  35. data/node_modules/govuk-frontend/dist/govuk/components/file-upload/file-upload.bundle.js +754 -0
  36. data/node_modules/govuk-frontend/dist/govuk/components/file-upload/file-upload.bundle.mjs +746 -0
  37. data/node_modules/govuk-frontend/dist/govuk/components/file-upload/file-upload.mjs +267 -0
  38. data/node_modules/govuk-frontend/dist/govuk/components/header/_index.scss +14 -10
  39. data/node_modules/govuk-frontend/dist/govuk/components/header/header.bundle.js +9 -29
  40. data/node_modules/govuk-frontend/dist/govuk/components/header/header.bundle.mjs +8 -28
  41. data/node_modules/govuk-frontend/dist/govuk/components/header/header.mjs +2 -2
  42. data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/notification-banner.bundle.js +161 -116
  43. data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/notification-banner.bundle.mjs +160 -115
  44. data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/notification-banner.mjs +6 -8
  45. data/node_modules/govuk-frontend/dist/govuk/components/password-input/password-input.bundle.js +161 -117
  46. data/node_modules/govuk-frontend/dist/govuk/components/password-input/password-input.bundle.mjs +160 -116
  47. data/node_modules/govuk-frontend/dist/govuk/components/password-input/password-input.mjs +5 -9
  48. data/node_modules/govuk-frontend/dist/govuk/components/radios/radios.bundle.js +9 -29
  49. data/node_modules/govuk-frontend/dist/govuk/components/radios/radios.bundle.mjs +8 -28
  50. data/node_modules/govuk-frontend/dist/govuk/components/radios/radios.mjs +2 -2
  51. data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/service-navigation.bundle.js +9 -29
  52. data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/service-navigation.bundle.mjs +8 -28
  53. data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/service-navigation.mjs +2 -2
  54. data/node_modules/govuk-frontend/dist/govuk/components/skip-link/skip-link.bundle.js +10 -30
  55. data/node_modules/govuk-frontend/dist/govuk/components/skip-link/skip-link.bundle.mjs +9 -29
  56. data/node_modules/govuk-frontend/dist/govuk/components/skip-link/skip-link.mjs +3 -3
  57. data/node_modules/govuk-frontend/dist/govuk/components/summary-list/_index.scss +12 -21
  58. data/node_modules/govuk-frontend/dist/govuk/components/tabs/tabs.bundle.js +9 -29
  59. data/node_modules/govuk-frontend/dist/govuk/components/tabs/tabs.bundle.mjs +8 -28
  60. data/node_modules/govuk-frontend/dist/govuk/components/tabs/tabs.mjs +2 -2
  61. data/node_modules/govuk-frontend/dist/govuk/core/_govuk-frontend-properties.scss +1 -1
  62. data/node_modules/govuk-frontend/dist/govuk/errors/index.mjs +1 -1
  63. data/node_modules/govuk-frontend/dist/govuk/govuk-frontend.min.js +1 -1
  64. data/node_modules/govuk-frontend/dist/govuk/helpers/_colour.scss +2 -2
  65. data/node_modules/govuk-frontend/dist/govuk/init.mjs +28 -24
  66. data/node_modules/govuk-frontend/dist/govuk/settings/_colours-organisations.scss +18 -5
  67. data/node_modules/govuk-frontend/dist/govuk/settings/_typography-responsive.scss +5 -10
  68. data/node_modules/govuk-frontend/dist/govuk-prototype-kit/init.scss +1 -1
  69. data/package-lock.json +8 -7
  70. data/package.json +1 -1
  71. metadata +12 -10
  72. data/node_modules/govuk-frontend/dist/govuk/common/normalise-dataset.mjs +0 -18
  73. data/node_modules/govuk-frontend/dist/govuk/common/normalise-string.mjs +0 -31
@@ -1,23 +1,21 @@
1
1
  import { closestAttributeValue } from '../../common/closest-attribute-value.mjs';
2
- import { mergeConfigs } from '../../common/index.mjs';
3
- import { normaliseDataset } from '../../common/normalise-dataset.mjs';
2
+ import { ConfigurableComponent } from '../../common/configuration.mjs';
4
3
  import { ElementError } from '../../errors/index.mjs';
5
- import { GOVUKFrontendComponent } from '../../govuk-frontend-component.mjs';
6
4
  import { I18n } from '../../i18n.mjs';
7
5
 
8
6
  /**
9
7
  * Password input component
10
8
  *
11
9
  * @preserve
10
+ * @augments ConfigurableComponent<PasswordInputConfig>
12
11
  */
13
- class PasswordInput extends GOVUKFrontendComponent {
12
+ class PasswordInput extends ConfigurableComponent {
14
13
  /**
15
14
  * @param {Element | null} $root - HTML element to use for password input
16
15
  * @param {PasswordInputConfig} [config] - Password input config
17
16
  */
18
17
  constructor($root, config = {}) {
19
- super($root);
20
- this.config = void 0;
18
+ super($root, config);
21
19
  this.i18n = void 0;
22
20
  this.$input = void 0;
23
21
  this.$showHideButton = void 0;
@@ -48,7 +46,6 @@ class PasswordInput extends GOVUKFrontendComponent {
48
46
  }
49
47
  this.$input = $input;
50
48
  this.$showHideButton = $showHideButton;
51
- this.config = mergeConfigs(PasswordInput.defaults, config, normaliseDataset(PasswordInput, this.$root.dataset));
52
49
  this.i18n = new I18n(this.config.i18n, {
53
50
  locale: closestAttributeValue(this.$root, 'lang')
54
51
  });
@@ -128,8 +125,7 @@ class PasswordInput extends GOVUKFrontendComponent {
128
125
  */
129
126
 
130
127
  /**
131
- * @typedef {import('../../common/index.mjs').Schema} Schema
132
- * @typedef {import('../../i18n.mjs').TranslationPluralForms} TranslationPluralForms
128
+ * @import { Schema } from '../../common/configuration.mjs'
133
129
  */
134
130
  PasswordInput.moduleName = 'govuk-password-input';
135
131
  PasswordInput.defaults = Object.freeze({
@@ -1,7 +1,7 @@
1
1
  (function (global, factory) {
2
2
  typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
3
3
  typeof define === 'function' && define.amd ? define(['exports'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.GOVUKFrontend = {}));
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.GOVUKFrontend = global.GOVUKFrontend || {}));
5
5
  })(this, (function (exports) { 'use strict';
6
6
 
7
7
  function isInitialised($root, moduleName) {
@@ -26,33 +26,13 @@
26
26
  function formatErrorMessage(Component, message) {
27
27
  return `${Component.moduleName}: ${message}`;
28
28
  }
29
-
30
- /**
31
- * Schema for component config
32
- *
33
- * @typedef {object} Schema
34
- * @property {{ [field: string]: SchemaProperty | undefined }} properties - Schema properties
35
- * @property {SchemaCondition[]} [anyOf] - List of schema conditions
36
- */
37
-
38
- /**
39
- * Schema property for component config
40
- *
41
- * @typedef {object} SchemaProperty
42
- * @property {'string' | 'boolean' | 'number' | 'object'} type - Property type
43
- */
44
-
45
- /**
46
- * Schema condition for component config
47
- *
48
- * @typedef {object} SchemaCondition
49
- * @property {string[]} required - List of required config fields
50
- * @property {string} errorMessage - Error message when required config fields not provided
51
- */
52
29
  /**
53
30
  * @typedef ComponentWithModuleName
54
31
  * @property {string} moduleName - Name of the component
55
32
  */
33
+ /**
34
+ * @import { ObjectNested } from './configuration.mjs'
35
+ */
56
36
 
57
37
  class GOVUKFrontendError extends Error {
58
38
  constructor(...args) {
@@ -98,10 +78,10 @@
98
78
  }
99
79
  }
100
80
  /**
101
- * @typedef {import('../common/index.mjs').ComponentWithModuleName} ComponentWithModuleName
81
+ * @import { ComponentWithModuleName } from '../common/index.mjs'
102
82
  */
103
83
 
104
- class GOVUKFrontendComponent {
84
+ class Component {
105
85
  /**
106
86
  * Returns the root element of the component
107
87
  *
@@ -152,16 +132,16 @@
152
132
  */
153
133
 
154
134
  /**
155
- * @typedef {typeof GOVUKFrontendComponent & ChildClass} ChildClassConstructor
135
+ * @typedef {typeof Component & ChildClass} ChildClassConstructor
156
136
  */
157
- GOVUKFrontendComponent.elementType = HTMLElement;
137
+ Component.elementType = HTMLElement;
158
138
 
159
139
  /**
160
140
  * Radios component
161
141
  *
162
142
  * @preserve
163
143
  */
164
- class Radios extends GOVUKFrontendComponent {
144
+ class Radios extends Component {
165
145
  /**
166
146
  * Radios can be associated with a 'conditionally revealed' content block –
167
147
  * for example, a radio for 'Phone' could reveal an additional form field for
@@ -20,33 +20,13 @@ function isSupported($scope = document.body) {
20
20
  function formatErrorMessage(Component, message) {
21
21
  return `${Component.moduleName}: ${message}`;
22
22
  }
23
-
24
- /**
25
- * Schema for component config
26
- *
27
- * @typedef {object} Schema
28
- * @property {{ [field: string]: SchemaProperty | undefined }} properties - Schema properties
29
- * @property {SchemaCondition[]} [anyOf] - List of schema conditions
30
- */
31
-
32
- /**
33
- * Schema property for component config
34
- *
35
- * @typedef {object} SchemaProperty
36
- * @property {'string' | 'boolean' | 'number' | 'object'} type - Property type
37
- */
38
-
39
- /**
40
- * Schema condition for component config
41
- *
42
- * @typedef {object} SchemaCondition
43
- * @property {string[]} required - List of required config fields
44
- * @property {string} errorMessage - Error message when required config fields not provided
45
- */
46
23
  /**
47
24
  * @typedef ComponentWithModuleName
48
25
  * @property {string} moduleName - Name of the component
49
26
  */
27
+ /**
28
+ * @import { ObjectNested } from './configuration.mjs'
29
+ */
50
30
 
51
31
  class GOVUKFrontendError extends Error {
52
32
  constructor(...args) {
@@ -92,10 +72,10 @@ class InitError extends GOVUKFrontendError {
92
72
  }
93
73
  }
94
74
  /**
95
- * @typedef {import('../common/index.mjs').ComponentWithModuleName} ComponentWithModuleName
75
+ * @import { ComponentWithModuleName } from '../common/index.mjs'
96
76
  */
97
77
 
98
- class GOVUKFrontendComponent {
78
+ class Component {
99
79
  /**
100
80
  * Returns the root element of the component
101
81
  *
@@ -146,16 +126,16 @@ class GOVUKFrontendComponent {
146
126
  */
147
127
 
148
128
  /**
149
- * @typedef {typeof GOVUKFrontendComponent & ChildClass} ChildClassConstructor
129
+ * @typedef {typeof Component & ChildClass} ChildClassConstructor
150
130
  */
151
- GOVUKFrontendComponent.elementType = HTMLElement;
131
+ Component.elementType = HTMLElement;
152
132
 
153
133
  /**
154
134
  * Radios component
155
135
  *
156
136
  * @preserve
157
137
  */
158
- class Radios extends GOVUKFrontendComponent {
138
+ class Radios extends Component {
159
139
  /**
160
140
  * Radios can be associated with a 'conditionally revealed' content block –
161
141
  * for example, a radio for 'Phone' could reveal an additional form field for
@@ -1,12 +1,12 @@
1
+ import { Component } from '../../component.mjs';
1
2
  import { ElementError } from '../../errors/index.mjs';
2
- import { GOVUKFrontendComponent } from '../../govuk-frontend-component.mjs';
3
3
 
4
4
  /**
5
5
  * Radios component
6
6
  *
7
7
  * @preserve
8
8
  */
9
- class Radios extends GOVUKFrontendComponent {
9
+ class Radios extends Component {
10
10
  /**
11
11
  * Radios can be associated with a 'conditionally revealed' content block –
12
12
  * for example, a radio for 'Phone' could reveal an additional form field for
@@ -1,7 +1,7 @@
1
1
  (function (global, factory) {
2
2
  typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
3
3
  typeof define === 'function' && define.amd ? define(['exports'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.GOVUKFrontend = {}));
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.GOVUKFrontend = global.GOVUKFrontend || {}));
5
5
  })(this, (function (exports) { 'use strict';
6
6
 
7
7
  function getBreakpoint(name) {
@@ -34,33 +34,13 @@
34
34
  function formatErrorMessage(Component, message) {
35
35
  return `${Component.moduleName}: ${message}`;
36
36
  }
37
-
38
- /**
39
- * Schema for component config
40
- *
41
- * @typedef {object} Schema
42
- * @property {{ [field: string]: SchemaProperty | undefined }} properties - Schema properties
43
- * @property {SchemaCondition[]} [anyOf] - List of schema conditions
44
- */
45
-
46
- /**
47
- * Schema property for component config
48
- *
49
- * @typedef {object} SchemaProperty
50
- * @property {'string' | 'boolean' | 'number' | 'object'} type - Property type
51
- */
52
-
53
- /**
54
- * Schema condition for component config
55
- *
56
- * @typedef {object} SchemaCondition
57
- * @property {string[]} required - List of required config fields
58
- * @property {string} errorMessage - Error message when required config fields not provided
59
- */
60
37
  /**
61
38
  * @typedef ComponentWithModuleName
62
39
  * @property {string} moduleName - Name of the component
63
40
  */
41
+ /**
42
+ * @import { ObjectNested } from './configuration.mjs'
43
+ */
64
44
 
65
45
  class GOVUKFrontendError extends Error {
66
46
  constructor(...args) {
@@ -106,10 +86,10 @@
106
86
  }
107
87
  }
108
88
  /**
109
- * @typedef {import('../common/index.mjs').ComponentWithModuleName} ComponentWithModuleName
89
+ * @import { ComponentWithModuleName } from '../common/index.mjs'
110
90
  */
111
91
 
112
- class GOVUKFrontendComponent {
92
+ class Component {
113
93
  /**
114
94
  * Returns the root element of the component
115
95
  *
@@ -160,16 +140,16 @@
160
140
  */
161
141
 
162
142
  /**
163
- * @typedef {typeof GOVUKFrontendComponent & ChildClass} ChildClassConstructor
143
+ * @typedef {typeof Component & ChildClass} ChildClassConstructor
164
144
  */
165
- GOVUKFrontendComponent.elementType = HTMLElement;
145
+ Component.elementType = HTMLElement;
166
146
 
167
147
  /**
168
148
  * Service Navigation component
169
149
  *
170
150
  * @preserve
171
151
  */
172
- class ServiceNavigation extends GOVUKFrontendComponent {
152
+ class ServiceNavigation extends Component {
173
153
  /**
174
154
  * @param {Element | null} $root - HTML element to use for header
175
155
  */
@@ -28,33 +28,13 @@ function isSupported($scope = document.body) {
28
28
  function formatErrorMessage(Component, message) {
29
29
  return `${Component.moduleName}: ${message}`;
30
30
  }
31
-
32
- /**
33
- * Schema for component config
34
- *
35
- * @typedef {object} Schema
36
- * @property {{ [field: string]: SchemaProperty | undefined }} properties - Schema properties
37
- * @property {SchemaCondition[]} [anyOf] - List of schema conditions
38
- */
39
-
40
- /**
41
- * Schema property for component config
42
- *
43
- * @typedef {object} SchemaProperty
44
- * @property {'string' | 'boolean' | 'number' | 'object'} type - Property type
45
- */
46
-
47
- /**
48
- * Schema condition for component config
49
- *
50
- * @typedef {object} SchemaCondition
51
- * @property {string[]} required - List of required config fields
52
- * @property {string} errorMessage - Error message when required config fields not provided
53
- */
54
31
  /**
55
32
  * @typedef ComponentWithModuleName
56
33
  * @property {string} moduleName - Name of the component
57
34
  */
35
+ /**
36
+ * @import { ObjectNested } from './configuration.mjs'
37
+ */
58
38
 
59
39
  class GOVUKFrontendError extends Error {
60
40
  constructor(...args) {
@@ -100,10 +80,10 @@ class InitError extends GOVUKFrontendError {
100
80
  }
101
81
  }
102
82
  /**
103
- * @typedef {import('../common/index.mjs').ComponentWithModuleName} ComponentWithModuleName
83
+ * @import { ComponentWithModuleName } from '../common/index.mjs'
104
84
  */
105
85
 
106
- class GOVUKFrontendComponent {
86
+ class Component {
107
87
  /**
108
88
  * Returns the root element of the component
109
89
  *
@@ -154,16 +134,16 @@ class GOVUKFrontendComponent {
154
134
  */
155
135
 
156
136
  /**
157
- * @typedef {typeof GOVUKFrontendComponent & ChildClass} ChildClassConstructor
137
+ * @typedef {typeof Component & ChildClass} ChildClassConstructor
158
138
  */
159
- GOVUKFrontendComponent.elementType = HTMLElement;
139
+ Component.elementType = HTMLElement;
160
140
 
161
141
  /**
162
142
  * Service Navigation component
163
143
  *
164
144
  * @preserve
165
145
  */
166
- class ServiceNavigation extends GOVUKFrontendComponent {
146
+ class ServiceNavigation extends Component {
167
147
  /**
168
148
  * @param {Element | null} $root - HTML element to use for header
169
149
  */
@@ -1,13 +1,13 @@
1
1
  import { getBreakpoint } from '../../common/index.mjs';
2
+ import { Component } from '../../component.mjs';
2
3
  import { ElementError } from '../../errors/index.mjs';
3
- import { GOVUKFrontendComponent } from '../../govuk-frontend-component.mjs';
4
4
 
5
5
  /**
6
6
  * Service Navigation component
7
7
  *
8
8
  * @preserve
9
9
  */
10
- class ServiceNavigation extends GOVUKFrontendComponent {
10
+ class ServiceNavigation extends Component {
11
11
  /**
12
12
  * @param {Element | null} $root - HTML element to use for header
13
13
  */
@@ -1,7 +1,7 @@
1
1
  (function (global, factory) {
2
2
  typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
3
3
  typeof define === 'function' && define.amd ? define(['exports'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.GOVUKFrontend = {}));
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.GOVUKFrontend = global.GOVUKFrontend || {}));
5
5
  })(this, (function (exports) { 'use strict';
6
6
 
7
7
  function getFragmentFromUrl(url) {
@@ -56,33 +56,13 @@
56
56
  function formatErrorMessage(Component, message) {
57
57
  return `${Component.moduleName}: ${message}`;
58
58
  }
59
-
60
- /**
61
- * Schema for component config
62
- *
63
- * @typedef {object} Schema
64
- * @property {{ [field: string]: SchemaProperty | undefined }} properties - Schema properties
65
- * @property {SchemaCondition[]} [anyOf] - List of schema conditions
66
- */
67
-
68
- /**
69
- * Schema property for component config
70
- *
71
- * @typedef {object} SchemaProperty
72
- * @property {'string' | 'boolean' | 'number' | 'object'} type - Property type
73
- */
74
-
75
- /**
76
- * Schema condition for component config
77
- *
78
- * @typedef {object} SchemaCondition
79
- * @property {string[]} required - List of required config fields
80
- * @property {string} errorMessage - Error message when required config fields not provided
81
- */
82
59
  /**
83
60
  * @typedef ComponentWithModuleName
84
61
  * @property {string} moduleName - Name of the component
85
62
  */
63
+ /**
64
+ * @import { ObjectNested } from './configuration.mjs'
65
+ */
86
66
 
87
67
  class GOVUKFrontendError extends Error {
88
68
  constructor(...args) {
@@ -128,10 +108,10 @@
128
108
  }
129
109
  }
130
110
  /**
131
- * @typedef {import('../common/index.mjs').ComponentWithModuleName} ComponentWithModuleName
111
+ * @import { ComponentWithModuleName } from '../common/index.mjs'
132
112
  */
133
113
 
134
- class GOVUKFrontendComponent {
114
+ class Component {
135
115
  /**
136
116
  * Returns the root element of the component
137
117
  *
@@ -182,17 +162,17 @@
182
162
  */
183
163
 
184
164
  /**
185
- * @typedef {typeof GOVUKFrontendComponent & ChildClass} ChildClassConstructor
165
+ * @typedef {typeof Component & ChildClass} ChildClassConstructor
186
166
  */
187
- GOVUKFrontendComponent.elementType = HTMLElement;
167
+ Component.elementType = HTMLElement;
188
168
 
189
169
  /**
190
170
  * Skip link component
191
171
  *
192
172
  * @preserve
193
- * @augments GOVUKFrontendComponent<HTMLAnchorElement>
173
+ * @augments Component<HTMLAnchorElement>
194
174
  */
195
- class SkipLink extends GOVUKFrontendComponent {
175
+ class SkipLink extends Component {
196
176
  /**
197
177
  * @param {Element | null} $root - HTML element to use for skip link
198
178
  * @throws {ElementError} when $root is not set or the wrong type
@@ -50,33 +50,13 @@ function isSupported($scope = document.body) {
50
50
  function formatErrorMessage(Component, message) {
51
51
  return `${Component.moduleName}: ${message}`;
52
52
  }
53
-
54
- /**
55
- * Schema for component config
56
- *
57
- * @typedef {object} Schema
58
- * @property {{ [field: string]: SchemaProperty | undefined }} properties - Schema properties
59
- * @property {SchemaCondition[]} [anyOf] - List of schema conditions
60
- */
61
-
62
- /**
63
- * Schema property for component config
64
- *
65
- * @typedef {object} SchemaProperty
66
- * @property {'string' | 'boolean' | 'number' | 'object'} type - Property type
67
- */
68
-
69
- /**
70
- * Schema condition for component config
71
- *
72
- * @typedef {object} SchemaCondition
73
- * @property {string[]} required - List of required config fields
74
- * @property {string} errorMessage - Error message when required config fields not provided
75
- */
76
53
  /**
77
54
  * @typedef ComponentWithModuleName
78
55
  * @property {string} moduleName - Name of the component
79
56
  */
57
+ /**
58
+ * @import { ObjectNested } from './configuration.mjs'
59
+ */
80
60
 
81
61
  class GOVUKFrontendError extends Error {
82
62
  constructor(...args) {
@@ -122,10 +102,10 @@ class InitError extends GOVUKFrontendError {
122
102
  }
123
103
  }
124
104
  /**
125
- * @typedef {import('../common/index.mjs').ComponentWithModuleName} ComponentWithModuleName
105
+ * @import { ComponentWithModuleName } from '../common/index.mjs'
126
106
  */
127
107
 
128
- class GOVUKFrontendComponent {
108
+ class Component {
129
109
  /**
130
110
  * Returns the root element of the component
131
111
  *
@@ -176,17 +156,17 @@ class GOVUKFrontendComponent {
176
156
  */
177
157
 
178
158
  /**
179
- * @typedef {typeof GOVUKFrontendComponent & ChildClass} ChildClassConstructor
159
+ * @typedef {typeof Component & ChildClass} ChildClassConstructor
180
160
  */
181
- GOVUKFrontendComponent.elementType = HTMLElement;
161
+ Component.elementType = HTMLElement;
182
162
 
183
163
  /**
184
164
  * Skip link component
185
165
  *
186
166
  * @preserve
187
- * @augments GOVUKFrontendComponent<HTMLAnchorElement>
167
+ * @augments Component<HTMLAnchorElement>
188
168
  */
189
- class SkipLink extends GOVUKFrontendComponent {
169
+ class SkipLink extends Component {
190
170
  /**
191
171
  * @param {Element | null} $root - HTML element to use for skip link
192
172
  * @throws {ElementError} when $root is not set or the wrong type
@@ -1,14 +1,14 @@
1
1
  import { getFragmentFromUrl, setFocus } from '../../common/index.mjs';
2
+ import { Component } from '../../component.mjs';
2
3
  import { ElementError } from '../../errors/index.mjs';
3
- import { GOVUKFrontendComponent } from '../../govuk-frontend-component.mjs';
4
4
 
5
5
  /**
6
6
  * Skip link component
7
7
  *
8
8
  * @preserve
9
- * @augments GOVUKFrontendComponent<HTMLAnchorElement>
9
+ * @augments Component<HTMLAnchorElement>
10
10
  */
11
- class SkipLink extends GOVUKFrontendComponent {
11
+ class SkipLink extends Component {
12
12
  /**
13
13
  * @param {Element | null} $root - HTML element to use for skip link
14
14
  * @throws {ElementError} when $root is not set or the wrong type
@@ -96,18 +96,21 @@
96
96
  padding: 0; // Reset default user agent styles
97
97
  }
98
98
 
99
- .govuk-summary-list__actions-list-item {
99
+ .govuk-summary-list__actions-list-item,
100
+ .govuk-summary-card__action {
100
101
  display: inline-block;
101
102
  }
102
103
 
103
104
  @include govuk-media-query($until: tablet) {
104
- .govuk-summary-list__actions-list-item {
105
+ .govuk-summary-list__actions-list-item,
106
+ .govuk-summary-card__action {
105
107
  margin-right: govuk-spacing(2);
106
108
  padding-right: govuk-spacing(2);
107
109
  border-right: 1px solid $govuk-border-colour;
108
110
  }
109
111
 
110
- .govuk-summary-list__actions-list-item:last-child {
112
+ .govuk-summary-list__actions-list-item:last-child,
113
+ .govuk-summary-card__action:last-child {
111
114
  margin-right: 0;
112
115
  padding-right: 0;
113
116
  border: 0;
@@ -115,16 +118,19 @@
115
118
  }
116
119
 
117
120
  @include govuk-media-query($from: tablet) {
118
- .govuk-summary-list__actions-list-item {
121
+ .govuk-summary-list__actions-list-item,
122
+ .govuk-summary-card__action {
119
123
  margin-left: govuk-spacing(2);
120
124
  padding-left: govuk-spacing(2);
121
125
  }
122
126
 
123
- .govuk-summary-list__actions-list-item:not(:first-child) {
127
+ .govuk-summary-list__actions-list-item:not(:first-child),
128
+ .govuk-summary-card__action:not(:first-child) {
124
129
  border-left: 1px solid $govuk-border-colour;
125
130
  }
126
131
 
127
- .govuk-summary-list__actions-list-item:first-child {
132
+ .govuk-summary-list__actions-list-item:first-child,
133
+ .govuk-summary-card__action:first-child {
128
134
  margin-left: 0;
129
135
  padding-left: 0;
130
136
  border: 0;
@@ -220,13 +226,6 @@
220
226
 
221
227
  .govuk-summary-card__action {
222
228
  display: inline;
223
- margin: 0 govuk-spacing(2) 0 0;
224
- padding-right: govuk-spacing(2);
225
- border-right: 1px solid $govuk-border-colour;
226
-
227
- @include govuk-media-query($from: "tablet") {
228
- margin-right: 0;
229
- }
230
229
 
231
230
  // We use the following media query to target IE11 and 10 only to add margin
232
231
  // between actions.
@@ -243,14 +242,6 @@
243
242
  }
244
243
 
245
244
  .govuk-summary-card__action:last-child {
246
- margin: 0;
247
- padding-right: 0;
248
- border-right: none;
249
-
250
- @include govuk-media-query($from: "tablet") {
251
- padding-left: govuk-spacing(2);
252
- }
253
-
254
245
  // See above comment for why this is here
255
246
  @media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
256
247
  margin-bottom: 0;