govuk_tech_docs 5.2.1 → 6.0.0.beta
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.
- checksums.yaml +4 -4
- data/.github/dependabot.yml +59 -0
- data/.npmrc +1 -0
- data/.ruby-version +1 -0
- data/CHANGELOG.md +19 -0
- data/README.md +13 -4
- data/example/config/tech-docs.yml +1 -1
- data/govuk_tech_docs.gemspec +2 -2
- data/lib/assets/stylesheets/_core.scss +1 -0
- data/lib/assets/stylesheets/_govuk_tech_docs.scss +13 -15
- data/lib/assets/stylesheets/modules/_app-pane.scss +3 -3
- data/lib/assets/stylesheets/modules/_page-review.scss +4 -4
- data/lib/assets/stylesheets/modules/_search.scss +3 -3
- data/lib/assets/stylesheets/modules/_service-navigation.scss +5 -0
- data/lib/assets/stylesheets/modules/_technical-documentation.scss +7 -7
- data/lib/assets/stylesheets/modules/_toc.scss +13 -13
- data/lib/assets/stylesheets/palette/_syntax-highlighting.scss +9 -7
- data/lib/govuk_tech_docs/meta_tags.rb +1 -1
- data/lib/govuk_tech_docs/version.rb +1 -1
- data/lib/source/layouts/_header.erb +2 -16
- data/lib/source/layouts/_service_navigation.erb +27 -0
- data/lib/source/layouts/core.erb +7 -7
- data/node_modules/govuk-frontend/dist/govuk/_base.scss +1 -0
- data/node_modules/govuk-frontend/dist/govuk/all.bundle.js +183 -300
- data/node_modules/govuk-frontend/dist/govuk/all.bundle.mjs +184 -300
- data/node_modules/govuk-frontend/dist/govuk/all.mjs +0 -1
- data/node_modules/govuk-frontend/dist/govuk/assets/images/favicon.ico +0 -0
- data/node_modules/govuk-frontend/dist/govuk/assets/images/favicon.svg +1 -1
- data/node_modules/govuk-frontend/dist/govuk/assets/images/govuk-icon-180.png +0 -0
- data/node_modules/govuk-frontend/dist/govuk/assets/images/govuk-icon-192.png +0 -0
- data/node_modules/govuk-frontend/dist/govuk/assets/images/govuk-icon-512.png +0 -0
- data/node_modules/govuk-frontend/dist/govuk/assets/images/govuk-opengraph-image.png +0 -0
- data/node_modules/govuk-frontend/dist/govuk/common/configuration.mjs +29 -2
- data/node_modules/govuk-frontend/dist/govuk/common/govuk-frontend-version.mjs +1 -1
- data/node_modules/govuk-frontend/dist/govuk/common/index.mjs +4 -10
- data/node_modules/govuk-frontend/dist/govuk/components/accordion/_index.scss +18 -15
- data/node_modules/govuk-frontend/dist/govuk/components/accordion/accordion.bundle.js +14 -137
- data/node_modules/govuk-frontend/dist/govuk/components/accordion/accordion.bundle.mjs +14 -137
- data/node_modules/govuk-frontend/dist/govuk/components/accordion/accordion.mjs +4 -4
- data/node_modules/govuk-frontend/dist/govuk/components/back-link/_index.scss +2 -2
- data/node_modules/govuk-frontend/dist/govuk/components/breadcrumbs/_index.scss +2 -2
- data/node_modules/govuk-frontend/dist/govuk/components/button/_index.scss +18 -21
- data/node_modules/govuk-frontend/dist/govuk/components/button/button.bundle.js +7 -5
- data/node_modules/govuk-frontend/dist/govuk/components/button/button.bundle.mjs +7 -5
- data/node_modules/govuk-frontend/dist/govuk/components/character-count/_index.scss +2 -2
- data/node_modules/govuk-frontend/dist/govuk/components/character-count/character-count.bundle.js +30 -143
- data/node_modules/govuk-frontend/dist/govuk/components/character-count/character-count.bundle.mjs +30 -143
- data/node_modules/govuk-frontend/dist/govuk/components/character-count/character-count.mjs +20 -10
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/_index.scss +7 -6
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/checkboxes.bundle.js +10 -5
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/checkboxes.bundle.mjs +10 -5
- data/node_modules/govuk-frontend/dist/govuk/components/cookie-banner/_index.scss +2 -5
- data/node_modules/govuk-frontend/dist/govuk/components/date-input/_index.scss +5 -0
- data/node_modules/govuk-frontend/dist/govuk/components/details/_index.scss +6 -4
- data/node_modules/govuk-frontend/dist/govuk/components/error-message/_index.scss +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/error-summary/_index.scss +4 -2
- data/node_modules/govuk-frontend/dist/govuk/components/error-summary/error-summary.bundle.js +8 -12
- data/node_modules/govuk-frontend/dist/govuk/components/error-summary/error-summary.bundle.mjs +8 -12
- data/node_modules/govuk-frontend/dist/govuk/components/error-summary/error-summary.mjs +2 -2
- data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/_index.scss +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/exit-this-page.bundle.js +10 -133
- data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/exit-this-page.bundle.mjs +10 -133
- data/node_modules/govuk-frontend/dist/govuk/components/file-upload/_index.scss +30 -38
- data/node_modules/govuk-frontend/dist/govuk/components/file-upload/file-upload.bundle.js +46 -140
- data/node_modules/govuk-frontend/dist/govuk/components/file-upload/file-upload.bundle.mjs +46 -140
- data/node_modules/govuk-frontend/dist/govuk/components/file-upload/file-upload.mjs +36 -7
- data/node_modules/govuk-frontend/dist/govuk/components/footer/_index.scss +30 -27
- data/node_modules/govuk-frontend/dist/govuk/components/header/_index.scss +89 -449
- data/node_modules/govuk-frontend/dist/govuk/components/hint/_index.scss +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/input/_index.scss +14 -20
- data/node_modules/govuk-frontend/dist/govuk/components/inset-text/_index.scss +2 -1
- data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/_index.scss +10 -8
- data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/notification-banner.bundle.js +7 -5
- data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/notification-banner.bundle.mjs +7 -5
- data/node_modules/govuk-frontend/dist/govuk/components/pagination/_index.scss +16 -11
- data/node_modules/govuk-frontend/dist/govuk/components/panel/_index.scss +4 -4
- data/node_modules/govuk-frontend/dist/govuk/components/password-input/_index.scss +2 -2
- data/node_modules/govuk-frontend/dist/govuk/components/password-input/password-input.bundle.js +10 -133
- data/node_modules/govuk-frontend/dist/govuk/components/password-input/password-input.bundle.mjs +10 -133
- data/node_modules/govuk-frontend/dist/govuk/components/phase-banner/_index.scss +12 -6
- data/node_modules/govuk-frontend/dist/govuk/components/radios/_index.scss +8 -7
- data/node_modules/govuk-frontend/dist/govuk/components/radios/radios.bundle.js +10 -5
- data/node_modules/govuk-frontend/dist/govuk/components/radios/radios.bundle.mjs +10 -5
- data/node_modules/govuk-frontend/dist/govuk/components/select/_index.scss +6 -11
- data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/_index.scss +58 -74
- data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/service-navigation.bundle.js +40 -7
- data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/service-navigation.bundle.mjs +40 -7
- data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/service-navigation.mjs +30 -2
- data/node_modules/govuk-frontend/dist/govuk/components/skip-link/_index.scss +8 -4
- data/node_modules/govuk-frontend/dist/govuk/components/skip-link/skip-link.bundle.js +12 -19
- data/node_modules/govuk-frontend/dist/govuk/components/skip-link/skip-link.bundle.mjs +12 -19
- data/node_modules/govuk-frontend/dist/govuk/components/skip-link/skip-link.mjs +3 -9
- data/node_modules/govuk-frontend/dist/govuk/components/summary-list/_index.scss +25 -21
- data/node_modules/govuk-frontend/dist/govuk/components/table/_index.scss +7 -8
- data/node_modules/govuk-frontend/dist/govuk/components/tabs/_index.scss +9 -6
- data/node_modules/govuk-frontend/dist/govuk/components/tabs/tabs.bundle.js +12 -13
- data/node_modules/govuk-frontend/dist/govuk/components/tabs/tabs.bundle.mjs +12 -13
- data/node_modules/govuk-frontend/dist/govuk/components/tabs/tabs.mjs +3 -3
- data/node_modules/govuk-frontend/dist/govuk/components/tag/_index.scss +66 -31
- data/node_modules/govuk-frontend/dist/govuk/components/task-list/_index.scss +7 -5
- data/node_modules/govuk-frontend/dist/govuk/components/textarea/_index.scss +5 -10
- data/node_modules/govuk-frontend/dist/govuk/components/warning-text/_index.scss +5 -4
- data/node_modules/govuk-frontend/dist/govuk/core/_index.scss +0 -1
- data/node_modules/govuk-frontend/dist/govuk/core/_lists.scss +2 -2
- data/node_modules/govuk-frontend/dist/govuk/core/_section-break.scss +2 -1
- data/node_modules/govuk-frontend/dist/govuk/core/_typography.scss +6 -20
- data/node_modules/govuk-frontend/dist/govuk/custom-properties/_breakpoints.scss +17 -0
- data/node_modules/govuk-frontend/dist/govuk/custom-properties/_frontend-version.scss +15 -0
- data/node_modules/govuk-frontend/dist/govuk/custom-properties/_functional-colours.scss +17 -0
- data/node_modules/govuk-frontend/dist/govuk/custom-properties/_index.scss +5 -0
- data/node_modules/govuk-frontend/dist/govuk/errors/index.mjs +5 -3
- data/node_modules/govuk-frontend/dist/govuk/govuk-frontend.min.js +1 -1
- data/node_modules/govuk-frontend/dist/govuk/helpers/_colour.scss +187 -72
- data/node_modules/govuk-frontend/dist/govuk/helpers/_focused.scss +41 -6
- data/node_modules/govuk-frontend/dist/govuk/helpers/_grid.scss +1 -1
- data/node_modules/govuk-frontend/dist/govuk/helpers/_links.scss +24 -40
- data/node_modules/govuk-frontend/dist/govuk/helpers/_media-queries.scss +172 -33
- data/node_modules/govuk-frontend/dist/govuk/helpers/_spacing.scss +1 -1
- data/node_modules/govuk-frontend/dist/govuk/helpers/_typography.scss +6 -30
- data/node_modules/govuk-frontend/dist/govuk/helpers/_visually-hidden.scss +4 -1
- data/node_modules/govuk-frontend/dist/govuk/i18n.mjs +5 -128
- data/node_modules/govuk-frontend/dist/govuk/init.mjs +53 -45
- data/node_modules/govuk-frontend/dist/govuk/objects/_button-group.scss +1 -1
- data/node_modules/govuk-frontend/dist/govuk/objects/_form-group.scss +2 -1
- data/node_modules/govuk-frontend/dist/govuk/objects/_main-wrapper.scss +1 -1
- data/node_modules/govuk-frontend/dist/govuk/objects/_template.scss +3 -7
- data/node_modules/govuk-frontend/dist/govuk/objects/_width-container.scss +2 -2
- data/node_modules/govuk-frontend/dist/govuk/overrides/_display.scss +1 -1
- data/node_modules/govuk-frontend/dist/govuk/overrides/_typography.scss +0 -2
- data/node_modules/govuk-frontend/dist/govuk/overrides/_width.scss +5 -5
- data/node_modules/govuk-frontend/dist/govuk/settings/_colours-applied.scss +3 -188
- data/node_modules/govuk-frontend/dist/govuk/settings/_colours-functional.scss +366 -0
- data/node_modules/govuk-frontend/dist/govuk/settings/_colours-organisations.scss +9 -255
- data/node_modules/govuk-frontend/dist/govuk/settings/_colours-palette.scss +117 -25
- data/node_modules/govuk-frontend/dist/govuk/settings/_custom-properties.scss +18 -0
- data/node_modules/govuk-frontend/dist/govuk/settings/_index.scss +3 -14
- data/node_modules/govuk-frontend/dist/govuk/settings/_media-queries.scss +0 -9
- data/node_modules/govuk-frontend/dist/govuk/settings/_typography-responsive.scss +12 -189
- data/node_modules/govuk-frontend/dist/govuk/tools/_index.scss +0 -1
- data/node_modules/govuk-frontend/dist/govuk/tools/_px-to-em.scss +4 -2
- data/node_modules/govuk-frontend/dist/govuk/tools/_px-to-rem.scss +2 -0
- data/package-lock.json +2461 -1150
- data/package.json +3 -3
- metadata +16 -30
- data/node_modules/govuk-frontend/dist/govuk/all.scss +0 -9
- data/node_modules/govuk-frontend/dist/govuk/assets/rebrand/images/favicon.ico +0 -0
- data/node_modules/govuk-frontend/dist/govuk/assets/rebrand/images/favicon.svg +0 -1
- data/node_modules/govuk-frontend/dist/govuk/assets/rebrand/images/govuk-crest.svg +0 -1
- data/node_modules/govuk-frontend/dist/govuk/assets/rebrand/images/govuk-icon-180.png +0 -0
- data/node_modules/govuk-frontend/dist/govuk/assets/rebrand/images/govuk-icon-192.png +0 -0
- data/node_modules/govuk-frontend/dist/govuk/assets/rebrand/images/govuk-icon-512.png +0 -0
- data/node_modules/govuk-frontend/dist/govuk/assets/rebrand/images/govuk-icon-mask.svg +0 -1
- data/node_modules/govuk-frontend/dist/govuk/assets/rebrand/images/govuk-opengraph-image.png +0 -0
- data/node_modules/govuk-frontend/dist/govuk/assets/rebrand/manifest.json +0 -39
- data/node_modules/govuk-frontend/dist/govuk/components/_all.scss +0 -10
- data/node_modules/govuk-frontend/dist/govuk/components/header/header.bundle.js +0 -233
- data/node_modules/govuk-frontend/dist/govuk/components/header/header.bundle.mjs +0 -225
- data/node_modules/govuk-frontend/dist/govuk/components/header/header.mjs +0 -89
- data/node_modules/govuk-frontend/dist/govuk/core/_all.scss +0 -10
- data/node_modules/govuk-frontend/dist/govuk/core/_govuk-frontend-properties.scss +0 -15
- data/node_modules/govuk-frontend/dist/govuk/helpers/_all.scss +0 -10
- data/node_modules/govuk-frontend/dist/govuk/objects/_all.scss +0 -10
- data/node_modules/govuk-frontend/dist/govuk/overrides/_all.scss +0 -9
- data/node_modules/govuk-frontend/dist/govuk/settings/_all.scss +0 -10
- data/node_modules/govuk-frontend/dist/govuk/tools/_all.scss +0 -10
- data/node_modules/govuk-frontend/dist/govuk/tools/_rebrand.scss +0 -65
- data/node_modules/govuk-frontend/dist/govuk/utilities/_all.scss +0 -10
- data/node_modules/govuk-frontend/dist/govuk/vendor/_sass-mq.scss +0 -349
- data/node_modules/govuk-frontend/dist/govuk-prototype-kit/functions.js +0 -25
|
@@ -15,23 +15,16 @@
|
|
|
15
15
|
// to dark backgrounds in Firefox (https://bugzil.la/1335476). As
|
|
16
16
|
// background-color and color need to always be set together, color should
|
|
17
17
|
// not be set either
|
|
18
|
-
border: $govuk-border-width-form-element solid
|
|
18
|
+
border: $govuk-border-width-form-element solid;
|
|
19
19
|
border-radius: 0;
|
|
20
|
+
border-color: govuk-functional-colour(input-border);
|
|
20
21
|
|
|
21
22
|
// Disable inner shadow and remove rounded corners
|
|
22
23
|
-webkit-appearance: none;
|
|
23
24
|
appearance: none;
|
|
24
25
|
|
|
25
26
|
&:focus {
|
|
26
|
-
|
|
27
|
-
// Ensure outline appears outside of the element
|
|
28
|
-
outline-offset: 0;
|
|
29
|
-
// Double the border by adding its width again. Use `box-shadow` for this
|
|
30
|
-
// instead of changing `border-width` - this is for consistency with
|
|
31
|
-
// components such as textarea where we avoid changing `border-width` as
|
|
32
|
-
// it will change the element size. Also, `outline` cannot be utilised
|
|
33
|
-
// here as it is already used for the yellow focus state.
|
|
34
|
-
box-shadow: inset 0 0 0 $govuk-border-width-form-element;
|
|
27
|
+
@include govuk-focused-form-input;
|
|
35
28
|
}
|
|
36
29
|
|
|
37
30
|
&:disabled {
|
|
@@ -53,10 +46,10 @@
|
|
|
53
46
|
}
|
|
54
47
|
|
|
55
48
|
.govuk-input--error {
|
|
56
|
-
border-color:
|
|
49
|
+
border-color: govuk-functional-colour(error);
|
|
57
50
|
|
|
58
51
|
&:focus {
|
|
59
|
-
border-color:
|
|
52
|
+
border-color: govuk-functional-colour(input-border);
|
|
60
53
|
}
|
|
61
54
|
}
|
|
62
55
|
|
|
@@ -109,7 +102,7 @@
|
|
|
109
102
|
}
|
|
110
103
|
|
|
111
104
|
// Split prefix/suffix onto separate lines on narrow screens
|
|
112
|
-
@
|
|
105
|
+
@media #{govuk-until-breakpoint(mobile)} {
|
|
113
106
|
display: block;
|
|
114
107
|
|
|
115
108
|
.govuk-input {
|
|
@@ -130,15 +123,16 @@
|
|
|
130
123
|
min-width: govuk-px-to-rem(40px);
|
|
131
124
|
height: govuk-px-to-rem(40px);
|
|
132
125
|
padding: govuk-spacing(1);
|
|
133
|
-
border: $govuk-border-width-form-element solid
|
|
134
|
-
|
|
126
|
+
border: $govuk-border-width-form-element solid;
|
|
127
|
+
border-color: govuk-functional-colour(input-border);
|
|
128
|
+
background-color: govuk-colour("black", $variant: "tint-95");
|
|
135
129
|
text-align: center;
|
|
136
130
|
white-space: nowrap;
|
|
137
131
|
// Emphasise non-editable status of prefixes and suffixes
|
|
138
132
|
cursor: default;
|
|
139
133
|
flex: 0 0 auto;
|
|
140
134
|
// Split prefix/suffix onto separate lines on narrow screens
|
|
141
|
-
@
|
|
135
|
+
@media #{govuk-until-breakpoint(mobile)} {
|
|
142
136
|
display: block;
|
|
143
137
|
height: 100%;
|
|
144
138
|
white-space: normal;
|
|
@@ -146,20 +140,20 @@
|
|
|
146
140
|
}
|
|
147
141
|
|
|
148
142
|
.govuk-input__prefix {
|
|
149
|
-
@
|
|
143
|
+
@media #{govuk-until-breakpoint(mobile)} {
|
|
150
144
|
border-bottom: 0;
|
|
151
145
|
}
|
|
152
|
-
@
|
|
146
|
+
@media #{govuk-from-breakpoint(mobile)} {
|
|
153
147
|
border-right: 0;
|
|
154
148
|
}
|
|
155
149
|
}
|
|
156
150
|
|
|
157
151
|
// Split prefix/suffix onto separate lines on narrow screens
|
|
158
152
|
.govuk-input__suffix {
|
|
159
|
-
@
|
|
153
|
+
@media #{govuk-until-breakpoint(mobile)} {
|
|
160
154
|
border-top: 0;
|
|
161
155
|
}
|
|
162
|
-
@
|
|
156
|
+
@media #{govuk-from-breakpoint(mobile)} {
|
|
163
157
|
border-left: 0;
|
|
164
158
|
}
|
|
165
159
|
}
|
|
@@ -3,12 +3,14 @@
|
|
|
3
3
|
@include govuk-font($size: 19);
|
|
4
4
|
@include govuk-responsive-margin(8, "bottom");
|
|
5
5
|
|
|
6
|
-
border: $govuk-border-width solid
|
|
6
|
+
border: $govuk-border-width solid;
|
|
7
|
+
border-color: govuk-functional-colour(brand);
|
|
7
8
|
|
|
8
|
-
background-color:
|
|
9
|
+
background-color: govuk-functional-colour(brand);
|
|
9
10
|
|
|
10
11
|
&:focus {
|
|
11
|
-
outline: $govuk-focus-width solid
|
|
12
|
+
outline: $govuk-focus-width solid;
|
|
13
|
+
outline-color: govuk-functional-colour(focus);
|
|
12
14
|
}
|
|
13
15
|
}
|
|
14
16
|
|
|
@@ -19,7 +21,7 @@
|
|
|
19
21
|
// text in high contrast mode
|
|
20
22
|
border-bottom: 1px solid transparent;
|
|
21
23
|
|
|
22
|
-
@
|
|
24
|
+
@media #{govuk-from-breakpoint(tablet)} {
|
|
23
25
|
padding: 2px govuk-spacing(4) govuk-spacing(1);
|
|
24
26
|
}
|
|
25
27
|
}
|
|
@@ -39,9 +41,9 @@
|
|
|
39
41
|
@include govuk-text-colour;
|
|
40
42
|
padding: govuk-spacing(3);
|
|
41
43
|
|
|
42
|
-
background-color:
|
|
44
|
+
background-color: govuk-functional-colour(body-background);
|
|
43
45
|
|
|
44
|
-
@
|
|
46
|
+
@media #{govuk-from-breakpoint(tablet)} {
|
|
45
47
|
padding: $padding-tablet;
|
|
46
48
|
}
|
|
47
49
|
|
|
@@ -80,9 +82,9 @@
|
|
|
80
82
|
}
|
|
81
83
|
|
|
82
84
|
.govuk-notification-banner--success {
|
|
83
|
-
border-color:
|
|
85
|
+
border-color: govuk-functional-colour(success);
|
|
84
86
|
|
|
85
|
-
background-color:
|
|
87
|
+
background-color: govuk-functional-colour(success);
|
|
86
88
|
|
|
87
89
|
.govuk-notification-banner__link {
|
|
88
90
|
@include govuk-link-style-success;
|
|
@@ -60,9 +60,6 @@
|
|
|
60
60
|
* @typedef ComponentWithModuleName
|
|
61
61
|
* @property {string} moduleName - Name of the component
|
|
62
62
|
*/
|
|
63
|
-
/**
|
|
64
|
-
* @import { ObjectNested } from './configuration.mjs'
|
|
65
|
-
*/
|
|
66
63
|
|
|
67
64
|
class GOVUKFrontendError extends Error {
|
|
68
65
|
constructor(...args) {
|
|
@@ -91,7 +88,7 @@
|
|
|
91
88
|
class ElementError extends GOVUKFrontendError {
|
|
92
89
|
constructor(messageOrOptions) {
|
|
93
90
|
let message = typeof messageOrOptions === 'string' ? messageOrOptions : '';
|
|
94
|
-
if (
|
|
91
|
+
if (isObject(messageOrOptions)) {
|
|
95
92
|
const {
|
|
96
93
|
component,
|
|
97
94
|
identifier,
|
|
@@ -100,7 +97,9 @@
|
|
|
100
97
|
} = messageOrOptions;
|
|
101
98
|
message = identifier;
|
|
102
99
|
message += element ? ` is not of type ${expectedType != null ? expectedType : 'HTMLElement'}` : ' not found';
|
|
103
|
-
|
|
100
|
+
if (component) {
|
|
101
|
+
message = formatErrorMessage(component, message);
|
|
102
|
+
}
|
|
104
103
|
}
|
|
105
104
|
super(message);
|
|
106
105
|
this.name = 'ElementError';
|
|
@@ -314,6 +313,9 @@
|
|
|
314
313
|
* @template {Partial<Record<keyof ConfigurationType, unknown>>} [ConfigurationType=ObjectNested]
|
|
315
314
|
* @typedef {typeof Component & ChildClass<ConfigurationType>} ChildClassConstructor<ConfigurationType>
|
|
316
315
|
*/
|
|
316
|
+
/**
|
|
317
|
+
* @import { CompatibleClass, Config, CreateAllOptions, OnErrorCallback } from '../init.mjs'
|
|
318
|
+
*/
|
|
317
319
|
|
|
318
320
|
/**
|
|
319
321
|
* Notification Banner component
|
|
@@ -54,9 +54,6 @@ function formatErrorMessage(Component, message) {
|
|
|
54
54
|
* @typedef ComponentWithModuleName
|
|
55
55
|
* @property {string} moduleName - Name of the component
|
|
56
56
|
*/
|
|
57
|
-
/**
|
|
58
|
-
* @import { ObjectNested } from './configuration.mjs'
|
|
59
|
-
*/
|
|
60
57
|
|
|
61
58
|
class GOVUKFrontendError extends Error {
|
|
62
59
|
constructor(...args) {
|
|
@@ -85,7 +82,7 @@ class ConfigError extends GOVUKFrontendError {
|
|
|
85
82
|
class ElementError extends GOVUKFrontendError {
|
|
86
83
|
constructor(messageOrOptions) {
|
|
87
84
|
let message = typeof messageOrOptions === 'string' ? messageOrOptions : '';
|
|
88
|
-
if (
|
|
85
|
+
if (isObject(messageOrOptions)) {
|
|
89
86
|
const {
|
|
90
87
|
component,
|
|
91
88
|
identifier,
|
|
@@ -94,7 +91,9 @@ class ElementError extends GOVUKFrontendError {
|
|
|
94
91
|
} = messageOrOptions;
|
|
95
92
|
message = identifier;
|
|
96
93
|
message += element ? ` is not of type ${expectedType != null ? expectedType : 'HTMLElement'}` : ' not found';
|
|
97
|
-
|
|
94
|
+
if (component) {
|
|
95
|
+
message = formatErrorMessage(component, message);
|
|
96
|
+
}
|
|
98
97
|
}
|
|
99
98
|
super(message);
|
|
100
99
|
this.name = 'ElementError';
|
|
@@ -308,6 +307,9 @@ function extractConfigByNamespace(schema, dataset, namespace) {
|
|
|
308
307
|
* @template {Partial<Record<keyof ConfigurationType, unknown>>} [ConfigurationType=ObjectNested]
|
|
309
308
|
* @typedef {typeof Component & ChildClass<ConfigurationType>} ChildClassConstructor<ConfigurationType>
|
|
310
309
|
*/
|
|
310
|
+
/**
|
|
311
|
+
* @import { CompatibleClass, Config, CreateAllOptions, OnErrorCallback } from '../init.mjs'
|
|
312
|
+
*/
|
|
311
313
|
|
|
312
314
|
/**
|
|
313
315
|
* Notification Banner component
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
align-items: center;
|
|
9
9
|
flex-wrap: wrap;
|
|
10
10
|
|
|
11
|
-
@
|
|
11
|
+
@media #{govuk-from-breakpoint(tablet)} {
|
|
12
12
|
flex-direction: row;
|
|
13
13
|
align-items: flex-start;
|
|
14
14
|
}
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
float: left; // Float is ignored if flex is active for prev/next links
|
|
33
33
|
|
|
34
34
|
&:hover {
|
|
35
|
-
background-color: govuk-colour("
|
|
35
|
+
background-color: govuk-colour("black", $variant: "tint-95");
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
38
|
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
// visually sit in the middle of their touch area
|
|
46
46
|
text-align: center;
|
|
47
47
|
|
|
48
|
-
@
|
|
48
|
+
@media #{govuk-from-breakpoint(tablet)} {
|
|
49
49
|
display: block;
|
|
50
50
|
}
|
|
51
51
|
}
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
|
|
73
73
|
// Only show first, last and non-link items on mobile
|
|
74
74
|
.govuk-pagination__item--current,
|
|
75
|
-
.govuk-pagination__item--
|
|
75
|
+
.govuk-pagination__item--ellipsis,
|
|
76
76
|
.govuk-pagination__item:first-child,
|
|
77
77
|
.govuk-pagination__item:last-child {
|
|
78
78
|
display: block;
|
|
@@ -81,10 +81,10 @@
|
|
|
81
81
|
.govuk-pagination__item--current {
|
|
82
82
|
@include govuk-typography-weight-bold;
|
|
83
83
|
outline: 1px solid transparent;
|
|
84
|
-
background-color:
|
|
84
|
+
background-color: govuk-functional-colour(link);
|
|
85
85
|
|
|
86
86
|
&:hover {
|
|
87
|
-
background-color:
|
|
87
|
+
background-color: govuk-functional-colour(link);
|
|
88
88
|
}
|
|
89
89
|
|
|
90
90
|
.govuk-pagination__link {
|
|
@@ -92,9 +92,9 @@
|
|
|
92
92
|
}
|
|
93
93
|
}
|
|
94
94
|
|
|
95
|
-
.govuk-pagination__item--
|
|
95
|
+
.govuk-pagination__item--ellipsis {
|
|
96
96
|
@include govuk-typography-weight-bold;
|
|
97
|
-
color:
|
|
97
|
+
color: govuk-functional-colour(secondary-text);
|
|
98
98
|
|
|
99
99
|
// Remove hover state for ellipsis items as they don't contain links
|
|
100
100
|
&:hover {
|
|
@@ -134,7 +134,7 @@
|
|
|
134
134
|
|
|
135
135
|
&:focus {
|
|
136
136
|
.govuk-pagination__icon {
|
|
137
|
-
color:
|
|
137
|
+
color: govuk-functional-colour(focus-text);
|
|
138
138
|
}
|
|
139
139
|
|
|
140
140
|
.govuk-pagination__link-label {
|
|
@@ -147,6 +147,10 @@
|
|
|
147
147
|
}
|
|
148
148
|
}
|
|
149
149
|
|
|
150
|
+
.govuk-pagination__link-title {
|
|
151
|
+
text-decoration-thickness: inherit;
|
|
152
|
+
}
|
|
153
|
+
|
|
150
154
|
.govuk-pagination__link-label {
|
|
151
155
|
@include govuk-typography-weight-regular;
|
|
152
156
|
@include govuk-link-decoration;
|
|
@@ -157,7 +161,7 @@
|
|
|
157
161
|
// Set size using rems to make the icon scale with text
|
|
158
162
|
width: govuk-px-to-rem(15px);
|
|
159
163
|
height: govuk-px-to-rem(13px);
|
|
160
|
-
color:
|
|
164
|
+
color: govuk-functional-colour(secondary-text);
|
|
161
165
|
fill: currentcolor;
|
|
162
166
|
forced-color-adjust: auto;
|
|
163
167
|
}
|
|
@@ -190,7 +194,8 @@
|
|
|
190
194
|
|
|
191
195
|
// Only apply a border between prev and next if both are present
|
|
192
196
|
.govuk-pagination__prev + .govuk-pagination__next {
|
|
193
|
-
border-top: 1px solid
|
|
197
|
+
border-top: 1px solid;
|
|
198
|
+
border-top-color: govuk-functional-colour(border);
|
|
194
199
|
}
|
|
195
200
|
|
|
196
201
|
// Set the after pseudo element to a block which makes the title visually
|
|
@@ -11,8 +11,8 @@
|
|
|
11
11
|
|
|
12
12
|
text-align: center;
|
|
13
13
|
|
|
14
|
-
@
|
|
15
|
-
padding: govuk-spacing(
|
|
14
|
+
@media #{govuk-until-breakpoint(tablet)} {
|
|
15
|
+
padding: govuk-spacing(4) - $govuk-border-width;
|
|
16
16
|
|
|
17
17
|
// This is an if-all-else-fails attempt to stop long words from
|
|
18
18
|
// overflowing the container on very narrow viewports by forcing them to
|
|
@@ -36,9 +36,9 @@
|
|
|
36
36
|
color: govuk-colour("white");
|
|
37
37
|
background: govuk-colour("green");
|
|
38
38
|
|
|
39
|
-
@
|
|
39
|
+
@media print {
|
|
40
40
|
border-color: currentcolor;
|
|
41
|
-
color:
|
|
41
|
+
color: govuk-functional-colour(print-text);
|
|
42
42
|
background: none;
|
|
43
43
|
}
|
|
44
44
|
}
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
// breakpoint
|
|
9
9
|
// - being display: flex above the mobile breakpoint
|
|
10
10
|
|
|
11
|
-
@
|
|
11
|
+
@media #{govuk-from-breakpoint(mobile)} {
|
|
12
12
|
flex-direction: row;
|
|
13
13
|
|
|
14
14
|
// The default of `stretch` makes the toggle button appear taller than the
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
display: none;
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
-
@
|
|
44
|
+
@media #{govuk-from-breakpoint(mobile)} {
|
|
45
45
|
// Buttons are normally 100% wide on mobile, but we don't want that here
|
|
46
46
|
width: auto;
|
|
47
47
|
flex-shrink: 0;
|
data/node_modules/govuk-frontend/dist/govuk/components/password-input/password-input.bundle.js
CHANGED
|
@@ -41,9 +41,6 @@
|
|
|
41
41
|
* @typedef ComponentWithModuleName
|
|
42
42
|
* @property {string} moduleName - Name of the component
|
|
43
43
|
*/
|
|
44
|
-
/**
|
|
45
|
-
* @import { ObjectNested } from './configuration.mjs'
|
|
46
|
-
*/
|
|
47
44
|
|
|
48
45
|
class GOVUKFrontendError extends Error {
|
|
49
46
|
constructor(...args) {
|
|
@@ -72,7 +69,7 @@
|
|
|
72
69
|
class ElementError extends GOVUKFrontendError {
|
|
73
70
|
constructor(messageOrOptions) {
|
|
74
71
|
let message = typeof messageOrOptions === 'string' ? messageOrOptions : '';
|
|
75
|
-
if (
|
|
72
|
+
if (isObject(messageOrOptions)) {
|
|
76
73
|
const {
|
|
77
74
|
component,
|
|
78
75
|
identifier,
|
|
@@ -81,7 +78,9 @@
|
|
|
81
78
|
} = messageOrOptions;
|
|
82
79
|
message = identifier;
|
|
83
80
|
message += element ? ` is not of type ${expectedType != null ? expectedType : 'HTMLElement'}` : ' not found';
|
|
84
|
-
|
|
81
|
+
if (component) {
|
|
82
|
+
message = formatErrorMessage(component, message);
|
|
83
|
+
}
|
|
85
84
|
}
|
|
86
85
|
super(message);
|
|
87
86
|
this.name = 'ElementError';
|
|
@@ -295,6 +294,9 @@
|
|
|
295
294
|
* @template {Partial<Record<keyof ConfigurationType, unknown>>} [ConfigurationType=ObjectNested]
|
|
296
295
|
* @typedef {typeof Component & ChildClass<ConfigurationType>} ChildClassConstructor<ConfigurationType>
|
|
297
296
|
*/
|
|
297
|
+
/**
|
|
298
|
+
* @import { CompatibleClass, Config, CreateAllOptions, OnErrorCallback } from '../init.mjs'
|
|
299
|
+
*/
|
|
298
300
|
|
|
299
301
|
class I18n {
|
|
300
302
|
constructor(translations = {}, config = {}) {
|
|
@@ -309,7 +311,7 @@
|
|
|
309
311
|
throw new Error('i18n: lookup key missing');
|
|
310
312
|
}
|
|
311
313
|
let translation = this.translations[lookupKey];
|
|
312
|
-
if (typeof (options == null ? void 0 : options.count) === 'number' &&
|
|
314
|
+
if (typeof (options == null ? void 0 : options.count) === 'number' && isObject(translation)) {
|
|
313
315
|
const translationPluralForm = translation[this.getPluralSuffix(lookupKey, options.count)];
|
|
314
316
|
if (translationPluralForm) {
|
|
315
317
|
translation = translationPluralForm;
|
|
@@ -351,8 +353,8 @@
|
|
|
351
353
|
return 'other';
|
|
352
354
|
}
|
|
353
355
|
const translation = this.translations[lookupKey];
|
|
354
|
-
const preferredForm = this.hasIntlPluralRulesSupport() ? new Intl.PluralRules(this.locale).select(count) :
|
|
355
|
-
if (
|
|
356
|
+
const preferredForm = this.hasIntlPluralRulesSupport() ? new Intl.PluralRules(this.locale).select(count) : 'other';
|
|
357
|
+
if (isObject(translation)) {
|
|
356
358
|
if (preferredForm in translation) {
|
|
357
359
|
return preferredForm;
|
|
358
360
|
} else if ('other' in translation) {
|
|
@@ -362,132 +364,7 @@
|
|
|
362
364
|
}
|
|
363
365
|
throw new Error(`i18n: Plural form ".other" is required for "${this.locale}" locale`);
|
|
364
366
|
}
|
|
365
|
-
selectPluralFormUsingFallbackRules(count) {
|
|
366
|
-
count = Math.abs(Math.floor(count));
|
|
367
|
-
const ruleset = this.getPluralRulesForLocale();
|
|
368
|
-
if (ruleset) {
|
|
369
|
-
return I18n.pluralRules[ruleset](count);
|
|
370
|
-
}
|
|
371
|
-
return 'other';
|
|
372
|
-
}
|
|
373
|
-
getPluralRulesForLocale() {
|
|
374
|
-
const localeShort = this.locale.split('-')[0];
|
|
375
|
-
for (const pluralRule in I18n.pluralRulesMap) {
|
|
376
|
-
const languages = I18n.pluralRulesMap[pluralRule];
|
|
377
|
-
if (languages.includes(this.locale) || languages.includes(localeShort)) {
|
|
378
|
-
return pluralRule;
|
|
379
|
-
}
|
|
380
|
-
}
|
|
381
|
-
}
|
|
382
367
|
}
|
|
383
|
-
I18n.pluralRulesMap = {
|
|
384
|
-
arabic: ['ar'],
|
|
385
|
-
chinese: ['my', 'zh', 'id', 'ja', 'jv', 'ko', 'ms', 'th', 'vi'],
|
|
386
|
-
french: ['hy', 'bn', 'fr', 'gu', 'hi', 'fa', 'pa', 'zu'],
|
|
387
|
-
german: ['af', 'sq', 'az', 'eu', 'bg', 'ca', 'da', 'nl', 'en', 'et', 'fi', 'ka', 'de', 'el', 'hu', 'lb', 'no', 'so', 'sw', 'sv', 'ta', 'te', 'tr', 'ur'],
|
|
388
|
-
irish: ['ga'],
|
|
389
|
-
russian: ['ru', 'uk'],
|
|
390
|
-
scottish: ['gd'],
|
|
391
|
-
spanish: ['pt-PT', 'it', 'es'],
|
|
392
|
-
welsh: ['cy']
|
|
393
|
-
};
|
|
394
|
-
I18n.pluralRules = {
|
|
395
|
-
arabic(n) {
|
|
396
|
-
if (n === 0) {
|
|
397
|
-
return 'zero';
|
|
398
|
-
}
|
|
399
|
-
if (n === 1) {
|
|
400
|
-
return 'one';
|
|
401
|
-
}
|
|
402
|
-
if (n === 2) {
|
|
403
|
-
return 'two';
|
|
404
|
-
}
|
|
405
|
-
if (n % 100 >= 3 && n % 100 <= 10) {
|
|
406
|
-
return 'few';
|
|
407
|
-
}
|
|
408
|
-
if (n % 100 >= 11 && n % 100 <= 99) {
|
|
409
|
-
return 'many';
|
|
410
|
-
}
|
|
411
|
-
return 'other';
|
|
412
|
-
},
|
|
413
|
-
chinese() {
|
|
414
|
-
return 'other';
|
|
415
|
-
},
|
|
416
|
-
french(n) {
|
|
417
|
-
return n === 0 || n === 1 ? 'one' : 'other';
|
|
418
|
-
},
|
|
419
|
-
german(n) {
|
|
420
|
-
return n === 1 ? 'one' : 'other';
|
|
421
|
-
},
|
|
422
|
-
irish(n) {
|
|
423
|
-
if (n === 1) {
|
|
424
|
-
return 'one';
|
|
425
|
-
}
|
|
426
|
-
if (n === 2) {
|
|
427
|
-
return 'two';
|
|
428
|
-
}
|
|
429
|
-
if (n >= 3 && n <= 6) {
|
|
430
|
-
return 'few';
|
|
431
|
-
}
|
|
432
|
-
if (n >= 7 && n <= 10) {
|
|
433
|
-
return 'many';
|
|
434
|
-
}
|
|
435
|
-
return 'other';
|
|
436
|
-
},
|
|
437
|
-
russian(n) {
|
|
438
|
-
const lastTwo = n % 100;
|
|
439
|
-
const last = lastTwo % 10;
|
|
440
|
-
if (last === 1 && lastTwo !== 11) {
|
|
441
|
-
return 'one';
|
|
442
|
-
}
|
|
443
|
-
if (last >= 2 && last <= 4 && !(lastTwo >= 12 && lastTwo <= 14)) {
|
|
444
|
-
return 'few';
|
|
445
|
-
}
|
|
446
|
-
if (last === 0 || last >= 5 && last <= 9 || lastTwo >= 11 && lastTwo <= 14) {
|
|
447
|
-
return 'many';
|
|
448
|
-
}
|
|
449
|
-
return 'other';
|
|
450
|
-
},
|
|
451
|
-
scottish(n) {
|
|
452
|
-
if (n === 1 || n === 11) {
|
|
453
|
-
return 'one';
|
|
454
|
-
}
|
|
455
|
-
if (n === 2 || n === 12) {
|
|
456
|
-
return 'two';
|
|
457
|
-
}
|
|
458
|
-
if (n >= 3 && n <= 10 || n >= 13 && n <= 19) {
|
|
459
|
-
return 'few';
|
|
460
|
-
}
|
|
461
|
-
return 'other';
|
|
462
|
-
},
|
|
463
|
-
spanish(n) {
|
|
464
|
-
if (n === 1) {
|
|
465
|
-
return 'one';
|
|
466
|
-
}
|
|
467
|
-
if (n % 1000000 === 0 && n !== 0) {
|
|
468
|
-
return 'many';
|
|
469
|
-
}
|
|
470
|
-
return 'other';
|
|
471
|
-
},
|
|
472
|
-
welsh(n) {
|
|
473
|
-
if (n === 0) {
|
|
474
|
-
return 'zero';
|
|
475
|
-
}
|
|
476
|
-
if (n === 1) {
|
|
477
|
-
return 'one';
|
|
478
|
-
}
|
|
479
|
-
if (n === 2) {
|
|
480
|
-
return 'two';
|
|
481
|
-
}
|
|
482
|
-
if (n === 3) {
|
|
483
|
-
return 'few';
|
|
484
|
-
}
|
|
485
|
-
if (n === 6) {
|
|
486
|
-
return 'many';
|
|
487
|
-
}
|
|
488
|
-
return 'other';
|
|
489
|
-
}
|
|
490
|
-
};
|
|
491
368
|
|
|
492
369
|
/**
|
|
493
370
|
* Password input component
|