defra_ruby_template 6.4.0 → 6.6.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.
- checksums.yaml +4 -4
- data/README.md +73 -19
- data/Rakefile +10 -33
- data/lib/defra_ruby_template/version.rb +1 -1
- data/node_modules/govuk-frontend/dist/govuk/all.bundle.js +202 -137
- data/node_modules/govuk-frontend/dist/govuk/all.bundle.js.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/all.bundle.mjs +202 -137
- data/node_modules/govuk-frontend/dist/govuk/all.bundle.mjs.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/common/closest-attribute-value.mjs.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/common/configuration.mjs +5 -1
- data/node_modules/govuk-frontend/dist/govuk/common/configuration.mjs.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/common/create-element.mjs +13 -0
- data/node_modules/govuk-frontend/dist/govuk/common/create-element.mjs.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/common/govuk-frontend-version.mjs +1 -1
- data/node_modules/govuk-frontend/dist/govuk/common/govuk-frontend-version.mjs.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/common/index.mjs.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/component.mjs +2 -1
- data/node_modules/govuk-frontend/dist/govuk/component.mjs.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/_index.import.scss +2 -0
- data/node_modules/govuk-frontend/dist/govuk/components/_index.scss +2 -0
- data/node_modules/govuk-frontend/dist/govuk/components/accordion/accordion.bundle.js +87 -62
- data/node_modules/govuk-frontend/dist/govuk/components/accordion/accordion.bundle.js.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/accordion/accordion.bundle.mjs +87 -62
- data/node_modules/govuk-frontend/dist/govuk/components/accordion/accordion.bundle.mjs.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/accordion/accordion.mjs +60 -56
- data/node_modules/govuk-frontend/dist/govuk/components/accordion/accordion.mjs.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/button/button.bundle.js +17 -6
- data/node_modules/govuk-frontend/dist/govuk/components/button/button.bundle.js.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/button/button.bundle.mjs +17 -6
- data/node_modules/govuk-frontend/dist/govuk/components/button/button.bundle.mjs.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/button/button.mjs.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/character-count/character-count.bundle.js +90 -32
- data/node_modules/govuk-frontend/dist/govuk/components/character-count/character-count.bundle.js.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/character-count/character-count.bundle.mjs +90 -32
- data/node_modules/govuk-frontend/dist/govuk/components/character-count/character-count.bundle.mjs.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/character-count/character-count.mjs +64 -27
- data/node_modules/govuk-frontend/dist/govuk/components/character-count/character-count.mjs.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/character-count/fixtures.json +173 -6
- data/node_modules/govuk-frontend/dist/govuk/components/character-count/macro-options.json +13 -6
- data/node_modules/govuk-frontend/dist/govuk/components/character-count/template-with-count-type-characters-and-error-message.html +12 -0
- data/node_modules/govuk-frontend/dist/govuk/components/character-count/template-with-count-type-characters-and-threshold.html +9 -0
- data/node_modules/govuk-frontend/dist/govuk/components/character-count/template-with-count-type-characters-and-value.html +9 -0
- data/node_modules/govuk-frontend/dist/govuk/components/character-count/template-with-count-type-characters.html +9 -0
- data/node_modules/govuk-frontend/dist/govuk/components/character-count/template-with-count-type-length.html +9 -0
- data/node_modules/govuk-frontend/dist/govuk/components/character-count/template-with-count-type-words-and-error-message.html +12 -0
- data/node_modules/govuk-frontend/dist/govuk/components/character-count/template-with-count-type-words-and-threshold.html +9 -0
- data/node_modules/govuk-frontend/dist/govuk/components/character-count/template-with-count-type-words-and-value.html +9 -0
- data/node_modules/govuk-frontend/dist/govuk/components/character-count/template-with-count-type-words.html +9 -0
- data/node_modules/govuk-frontend/dist/govuk/components/character-count/template-with-maxwords.html +9 -0
- data/node_modules/govuk-frontend/dist/govuk/components/character-count/template.njk +10 -3
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/checkboxes.bundle.js +12 -5
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/checkboxes.bundle.js.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/checkboxes.bundle.mjs +12 -5
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/checkboxes.bundle.mjs.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/checkboxes.mjs.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/cookie-banner/_mixin.scss +6 -0
- data/node_modules/govuk-frontend/dist/govuk/components/error-summary/error-summary.bundle.js +17 -6
- data/node_modules/govuk-frontend/dist/govuk/components/error-summary/error-summary.bundle.js.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/error-summary/error-summary.bundle.mjs +17 -6
- data/node_modules/govuk-frontend/dist/govuk/components/error-summary/error-summary.bundle.mjs.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/error-summary/error-summary.mjs.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/exit-this-page.bundle.js +43 -18
- data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/exit-this-page.bundle.js.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/exit-this-page.bundle.mjs +43 -18
- data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/exit-this-page.bundle.mjs.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/exit-this-page.mjs +16 -12
- data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/exit-this-page.mjs.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/feedback/README.md +15 -0
- data/node_modules/govuk-frontend/dist/govuk/components/feedback/_feedback.import.scss +6 -0
- data/node_modules/govuk-frontend/dist/govuk/components/feedback/_index.import.scss +8 -0
- data/node_modules/govuk-frontend/dist/govuk/components/feedback/_index.scss +5 -0
- data/node_modules/govuk-frontend/dist/govuk/components/feedback/_mixin.scss +48 -0
- data/node_modules/govuk-frontend/dist/govuk/components/feedback/fixtures.json +95 -0
- data/node_modules/govuk-frontend/dist/govuk/components/feedback/macro-options.json +50 -0
- data/node_modules/govuk-frontend/dist/govuk/components/feedback/macro.njk +3 -0
- data/node_modules/govuk-frontend/dist/govuk/components/feedback/template-default.html +12 -0
- data/node_modules/govuk-frontend/dist/govuk/components/feedback/template-silly-example.html +19 -0
- data/node_modules/govuk-frontend/dist/govuk/components/feedback/template.njk +24 -0
- data/node_modules/govuk-frontend/dist/govuk/components/file-upload/file-upload.bundle.js +54 -30
- data/node_modules/govuk-frontend/dist/govuk/components/file-upload/file-upload.bundle.js.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/file-upload/file-upload.bundle.mjs +54 -30
- data/node_modules/govuk-frontend/dist/govuk/components/file-upload/file-upload.bundle.mjs.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/file-upload/file-upload.mjs +27 -24
- data/node_modules/govuk-frontend/dist/govuk/components/file-upload/file-upload.mjs.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/footer/_mixin.scss +6 -0
- data/node_modules/govuk-frontend/dist/govuk/components/language-navigation/README.md +15 -0
- data/node_modules/govuk-frontend/dist/govuk/components/language-navigation/_index.import.scss +8 -0
- data/node_modules/govuk-frontend/dist/govuk/components/language-navigation/_index.scss +6 -0
- data/node_modules/govuk-frontend/dist/govuk/components/language-navigation/_language-navigation.import.scss +6 -0
- data/node_modules/govuk-frontend/dist/govuk/components/language-navigation/_mixin.scss +68 -0
- data/node_modules/govuk-frontend/dist/govuk/components/language-navigation/fixtures.json +482 -0
- data/node_modules/govuk-frontend/dist/govuk/components/language-navigation/macro-options.json +88 -0
- data/node_modules/govuk-frontend/dist/govuk/components/language-navigation/macro.njk +3 -0
- data/node_modules/govuk-frontend/dist/govuk/components/language-navigation/template-default.html +12 -0
- data/node_modules/govuk-frontend/dist/govuk/components/language-navigation/template-inverse.html +12 -0
- data/node_modules/govuk-frontend/dist/govuk/components/language-navigation/template-with-language-description.html +12 -0
- data/node_modules/govuk-frontend/dist/govuk/components/language-navigation/template-with-large-amount-of-multiple-languages.html +99 -0
- data/node_modules/govuk-frontend/dist/govuk/components/language-navigation/template-with-mixed-text-directions.html +12 -0
- data/node_modules/govuk-frontend/dist/govuk/components/language-navigation/template-with-multiple-languages.html +24 -0
- data/node_modules/govuk-frontend/dist/govuk/components/language-navigation/template-with-translated-navigation-label.html +12 -0
- data/node_modules/govuk-frontend/dist/govuk/components/language-navigation/template.njk +33 -0
- data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/notification-banner.bundle.js +17 -6
- data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/notification-banner.bundle.js.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/notification-banner.bundle.mjs +17 -6
- data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/notification-banner.bundle.mjs.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/notification-banner.mjs.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/panel/fixtures.json +13 -11
- data/node_modules/govuk-frontend/dist/govuk/components/panel/template-interruption-with-headings-content-and-lists.html +6 -1
- data/node_modules/govuk-frontend/dist/govuk/components/password-input/password-input.bundle.js +32 -9
- data/node_modules/govuk-frontend/dist/govuk/components/password-input/password-input.bundle.js.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/password-input/password-input.bundle.mjs +32 -9
- data/node_modules/govuk-frontend/dist/govuk/components/password-input/password-input.bundle.mjs.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/password-input/password-input.mjs +5 -3
- data/node_modules/govuk-frontend/dist/govuk/components/password-input/password-input.mjs.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/radios/radios.bundle.js +12 -5
- data/node_modules/govuk-frontend/dist/govuk/components/radios/radios.bundle.js.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/radios/radios.bundle.mjs +12 -5
- data/node_modules/govuk-frontend/dist/govuk/components/radios/radios.bundle.mjs.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/radios/radios.mjs.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/_mixin.scss +48 -3
- data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/fixtures.json +121 -0
- data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/macro-options.json +20 -0
- data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/service-navigation.bundle.js +12 -5
- data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/service-navigation.bundle.js.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/service-navigation.bundle.mjs +12 -5
- data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/service-navigation.bundle.mjs.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/service-navigation.mjs.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/template-inverse-with-language-navigation.html +72 -0
- data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/template-with-inline-end-slot.html +33 -0
- data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/template-with-language-navigation.html +62 -0
- data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/template-with-right-aligned-language-navigation.html +62 -0
- data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/template.njk +8 -3
- data/node_modules/govuk-frontend/dist/govuk/components/skip-link/skip-link.bundle.js +14 -6
- data/node_modules/govuk-frontend/dist/govuk/components/skip-link/skip-link.bundle.js.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/skip-link/skip-link.bundle.mjs +14 -6
- data/node_modules/govuk-frontend/dist/govuk/components/skip-link/skip-link.bundle.mjs.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/skip-link/skip-link.mjs +2 -1
- data/node_modules/govuk-frontend/dist/govuk/components/skip-link/skip-link.mjs.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/tabs/tabs.bundle.js +12 -5
- data/node_modules/govuk-frontend/dist/govuk/components/tabs/tabs.bundle.js.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/tabs/tabs.bundle.mjs +12 -5
- data/node_modules/govuk-frontend/dist/govuk/components/tabs/tabs.bundle.mjs.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/tabs/tabs.mjs.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/custom-properties/_frontend-version.mixin.scss +1 -1
- data/node_modules/govuk-frontend/dist/govuk/custom-properties/_functional-colours.mixin.scss +1 -0
- data/node_modules/govuk-frontend/dist/govuk/errors/index.mjs +8 -5
- data/node_modules/govuk-frontend/dist/govuk/errors/index.mjs.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/govuk-frontend.min.css +2 -2
- data/node_modules/govuk-frontend/dist/govuk/govuk-frontend.min.css.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/govuk-frontend.min.js +1 -1
- data/node_modules/govuk-frontend/dist/govuk/govuk-frontend.min.js.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/helpers/_colour.scss +1 -1
- data/node_modules/govuk-frontend/dist/govuk/i18n.mjs.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/init.mjs +8 -8
- data/node_modules/govuk-frontend/dist/govuk/init.mjs.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/settings/_colours-organisations.scss +16 -2
- data/node_modules/govuk-frontend/govuk-prototype-kit.config.json +9 -1
- data/node_modules/govuk-frontend/package.json +9 -7
- data/vendor/assets/javascripts/defra_ruby_template.js +202 -137
- data/vendor/assets/stylesheets/components/_index.import.scss +2 -0
- data/vendor/assets/stylesheets/components/_index.scss +2 -0
- data/vendor/assets/stylesheets/components/cookie-banner/_mixin.scss +6 -0
- data/vendor/assets/stylesheets/components/feedback/_feedback.import.scss +6 -0
- data/vendor/assets/stylesheets/components/feedback/_index.import.scss +8 -0
- data/vendor/assets/stylesheets/components/feedback/_index.scss +5 -0
- data/vendor/assets/stylesheets/components/feedback/_mixin.scss +48 -0
- data/vendor/assets/stylesheets/components/footer/_mixin.scss +6 -0
- data/vendor/assets/stylesheets/components/language-navigation/_index.import.scss +8 -0
- data/vendor/assets/stylesheets/components/language-navigation/_index.scss +6 -0
- data/vendor/assets/stylesheets/components/language-navigation/_language-navigation.import.scss +6 -0
- data/vendor/assets/stylesheets/components/language-navigation/_mixin.scss +68 -0
- data/vendor/assets/stylesheets/components/service-navigation/_mixin.scss +48 -3
- data/vendor/assets/stylesheets/custom-properties/_frontend-version.mixin.scss +1 -1
- data/vendor/assets/stylesheets/custom-properties/_functional-colours.mixin.scss +1 -0
- data/vendor/assets/stylesheets/defra_ruby_template.scss +8 -30
- data/vendor/assets/stylesheets/govuk-frontend.min.css +2 -2
- data/vendor/assets/stylesheets/helpers/_colour.scss +1 -1
- data/vendor/assets/stylesheets/settings/_colours-organisations.scss +16 -2
- metadata +53 -3
- data/node_modules/govuk-frontend/dist/govuk/components/character-count/template-with-word-count.html +0 -9
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
{
|
|
2
|
+
"component": "feedback",
|
|
3
|
+
"fixtures": [
|
|
4
|
+
{
|
|
5
|
+
"name": "default",
|
|
6
|
+
"options": {
|
|
7
|
+
"titleText": "Help us improve this service",
|
|
8
|
+
"html": "<p class=\"govuk-body\">Tell us about your experience using this service. <a href=\"#\" class=\"govuk-link\">Give us your feedback</a></p>\n"
|
|
9
|
+
},
|
|
10
|
+
"hidden": false,
|
|
11
|
+
"description": "",
|
|
12
|
+
"pageTemplateOptions": {},
|
|
13
|
+
"screenshot": true,
|
|
14
|
+
"html": "<div class=\"govuk-feedback govuk-width-container\">\n <div class=\"govuk-grid-row\">\n <div class=\"govuk-grid-column-two-thirds\">\n <h2 class=\"govuk-feedback__title\">\n Help us improve this service\n </h2>\n <div class=\"govuk-feedback__body\">\n <p class=\"govuk-body\">Tell us about your experience using this service. <a href=\"#\" class=\"govuk-link\">Give us your feedback</a></p>\n </div>\n </div>\n </div>\n</div>"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"name": "silly example",
|
|
18
|
+
"options": {
|
|
19
|
+
"titleText": "Help us improve this service",
|
|
20
|
+
"html": "<p class=\"govuk-body\">Tell us about your experience using this service.</p>\n<p class=\"govuk-body\">Click this cool link to <a href=\"#\" class=\"govuk-link\">give us your feedback</a>.</p>\n<p class=\"govuk-body\">There's another paragraph here.</p>\n<ul class=\"govuk-list govuk-list--bullet\">\n <li>There is also a list</li>\n <li>With items in</li>\n <li>How strange!</li>\n</ul>\n"
|
|
21
|
+
},
|
|
22
|
+
"hidden": false,
|
|
23
|
+
"description": "In reality we'd recommend users only use the default example but this is to illustrate if a service team decides they want to add a lot of content",
|
|
24
|
+
"pageTemplateOptions": {},
|
|
25
|
+
"screenshot": false,
|
|
26
|
+
"html": "<div class=\"govuk-feedback govuk-width-container\">\n <div class=\"govuk-grid-row\">\n <div class=\"govuk-grid-column-two-thirds\">\n <h2 class=\"govuk-feedback__title\">\n Help us improve this service\n </h2>\n <div class=\"govuk-feedback__body\">\n <p class=\"govuk-body\">Tell us about your experience using this service.</p>\n <p class=\"govuk-body\">Click this cool link to <a href=\"#\" class=\"govuk-link\">give us your feedback</a>.</p>\n <p class=\"govuk-body\">There's another paragraph here.</p>\n <ul class=\"govuk-list govuk-list--bullet\">\n <li>There is also a list</li>\n <li>With items in</li>\n <li>How strange!</li>\n </ul>\n </div>\n </div>\n </div>\n</div>"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"name": "html in title",
|
|
30
|
+
"options": {
|
|
31
|
+
"titleHtml": "Help us improve this <em>cool</em> service",
|
|
32
|
+
"html": "<p class=\"govuk-body\">Tell us about your experience using this service. <a href=\"#\" class=\"govuk-link\">Give us your feedback</a></p>\n"
|
|
33
|
+
},
|
|
34
|
+
"hidden": true,
|
|
35
|
+
"description": "",
|
|
36
|
+
"pageTemplateOptions": {},
|
|
37
|
+
"screenshot": false,
|
|
38
|
+
"html": "<div class=\"govuk-feedback govuk-width-container\">\n <div class=\"govuk-grid-row\">\n <div class=\"govuk-grid-column-two-thirds\">\n <h2 class=\"govuk-feedback__title\">\n Help us improve this <em>cool</em> service\n </h2>\n <div class=\"govuk-feedback__body\">\n <p class=\"govuk-body\">Tell us about your experience using this service. <a href=\"#\" class=\"govuk-link\">Give us your feedback</a></p>\n </div>\n </div>\n </div>\n</div>"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"name": "custom heading level",
|
|
42
|
+
"options": {
|
|
43
|
+
"titleText": "Help us improve this service",
|
|
44
|
+
"headingLevel": 3,
|
|
45
|
+
"html": "<p class=\"govuk-body\">Tell us about your experience using this service. <a href=\"#\" class=\"govuk-link\">Give us your feedback</a></p>\n"
|
|
46
|
+
},
|
|
47
|
+
"hidden": true,
|
|
48
|
+
"description": "",
|
|
49
|
+
"pageTemplateOptions": {},
|
|
50
|
+
"screenshot": false,
|
|
51
|
+
"html": "<div class=\"govuk-feedback govuk-width-container\">\n <div class=\"govuk-grid-row\">\n <div class=\"govuk-grid-column-two-thirds\">\n <h3 class=\"govuk-feedback__title\">\n Help us improve this service\n </h3>\n <div class=\"govuk-feedback__body\">\n <p class=\"govuk-body\">Tell us about your experience using this service. <a href=\"#\" class=\"govuk-link\">Give us your feedback</a></p>\n </div>\n </div>\n </div>\n</div>"
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
"name": "html in text options",
|
|
55
|
+
"options": {
|
|
56
|
+
"titleText": "Help us improve this <em>cool</em> service",
|
|
57
|
+
"text": "Tell us about your experience using this <em>cool</em> service"
|
|
58
|
+
},
|
|
59
|
+
"hidden": true,
|
|
60
|
+
"description": "",
|
|
61
|
+
"pageTemplateOptions": {},
|
|
62
|
+
"screenshot": false,
|
|
63
|
+
"html": "<div class=\"govuk-feedback govuk-width-container\">\n <div class=\"govuk-grid-row\">\n <div class=\"govuk-grid-column-two-thirds\">\n <h2 class=\"govuk-feedback__title\">\n Help us improve this <em>cool</em> service\n </h2>\n <div class=\"govuk-feedback__body\">\n <p class=\"govuk-body\">\n Tell us about your experience using this <em>cool</em> service\n </p>\n </div>\n </div>\n </div>\n</div>"
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
"name": "classes",
|
|
67
|
+
"options": {
|
|
68
|
+
"titleText": "Help us improve this service",
|
|
69
|
+
"html": "<p class=\"govuk-body\">Tell us about your experience using this service. <a href=\"#\" class=\"govuk-link\">Give us your feedback</a></p>\n",
|
|
70
|
+
"classes": "my-first-class my-second-class"
|
|
71
|
+
},
|
|
72
|
+
"hidden": true,
|
|
73
|
+
"description": "",
|
|
74
|
+
"pageTemplateOptions": {},
|
|
75
|
+
"screenshot": false,
|
|
76
|
+
"html": "<div class=\"govuk-feedback govuk-width-container my-first-class my-second-class\">\n <div class=\"govuk-grid-row\">\n <div class=\"govuk-grid-column-two-thirds\">\n <h2 class=\"govuk-feedback__title\">\n Help us improve this service\n </h2>\n <div class=\"govuk-feedback__body\">\n <p class=\"govuk-body\">Tell us about your experience using this service. <a href=\"#\" class=\"govuk-link\">Give us your feedback</a></p>\n </div>\n </div>\n </div>\n</div>"
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
"name": "attributes",
|
|
80
|
+
"options": {
|
|
81
|
+
"titleText": "Help us improve this service",
|
|
82
|
+
"html": "<p class=\"govuk-body\">Tell us about your experience using this service. <a href=\"#\" class=\"govuk-link\">Give us your feedback</a></p>\n",
|
|
83
|
+
"attributes": {
|
|
84
|
+
"first-attribute": "first",
|
|
85
|
+
"second-attribute": "second"
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
"hidden": true,
|
|
89
|
+
"description": "",
|
|
90
|
+
"pageTemplateOptions": {},
|
|
91
|
+
"screenshot": false,
|
|
92
|
+
"html": "<div class=\"govuk-feedback govuk-width-container\" first-attribute=\"first\" second-attribute=\"second\">\n <div class=\"govuk-grid-row\">\n <div class=\"govuk-grid-column-two-thirds\">\n <h2 class=\"govuk-feedback__title\">\n Help us improve this service\n </h2>\n <div class=\"govuk-feedback__body\">\n <p class=\"govuk-body\">Tell us about your experience using this service. <a href=\"#\" class=\"govuk-link\">Give us your feedback</a></p>\n </div>\n </div>\n </div>\n</div>"
|
|
93
|
+
}
|
|
94
|
+
]
|
|
95
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"name": "titleText",
|
|
4
|
+
"type": "string",
|
|
5
|
+
"required": true,
|
|
6
|
+
"description": "Text to use within the title of the Feedback component. If `titleHtml` is provided, the `titleText` option will be ignored."
|
|
7
|
+
},
|
|
8
|
+
{
|
|
9
|
+
"name": "titleHtml",
|
|
10
|
+
"type": "string",
|
|
11
|
+
"required": true,
|
|
12
|
+
"description": "HTML to use within the title of the Feedback component. If `titleHtml` is provided, the `titleText` option will be ignored."
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"name": "headingLevel",
|
|
16
|
+
"type": "integer",
|
|
17
|
+
"required": false,
|
|
18
|
+
"description": "Heading level, from `1` to `6`. Default is `2`."
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"name": "text",
|
|
22
|
+
"type": "string",
|
|
23
|
+
"required": true,
|
|
24
|
+
"description": "Text to use within the Feedback component content. If `html` is provided, the `text` option will be ignored."
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"name": "html",
|
|
28
|
+
"type": "string",
|
|
29
|
+
"required": true,
|
|
30
|
+
"description": "HTML to use within the Feedback component content. If `html` is provided, the `text` option will be ignored."
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"name": "caller",
|
|
34
|
+
"type": "nunjucks-block",
|
|
35
|
+
"required": false,
|
|
36
|
+
"description": "Not strictly a parameter but a [Nunjucks code convention](https://mozilla.github.io/nunjucks/templating.html#call). Using a `call` block lets you call a macro with all the text inside the tag. This is helpful if you want to pass a lot of content into a macro. To use it, you'll need to wrap the entire Feedback component in a `call` block."
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"name": "classes",
|
|
40
|
+
"type": "string",
|
|
41
|
+
"required": false,
|
|
42
|
+
"description": "Classes to add to the Feedback component container."
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"name": "attributes",
|
|
46
|
+
"type": "object",
|
|
47
|
+
"required": false,
|
|
48
|
+
"description": "HTML attributes (for example, data attributes) to add to the Feedback component container."
|
|
49
|
+
}
|
|
50
|
+
]
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<div class="govuk-feedback govuk-width-container">
|
|
2
|
+
<div class="govuk-grid-row">
|
|
3
|
+
<div class="govuk-grid-column-two-thirds">
|
|
4
|
+
<h2 class="govuk-feedback__title">
|
|
5
|
+
Help us improve this service
|
|
6
|
+
</h2>
|
|
7
|
+
<div class="govuk-feedback__body">
|
|
8
|
+
<p class="govuk-body">Tell us about your experience using this service. <a href="#" class="govuk-link">Give us your feedback</a></p>
|
|
9
|
+
</div>
|
|
10
|
+
</div>
|
|
11
|
+
</div>
|
|
12
|
+
</div>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<div class="govuk-feedback govuk-width-container">
|
|
2
|
+
<div class="govuk-grid-row">
|
|
3
|
+
<div class="govuk-grid-column-two-thirds">
|
|
4
|
+
<h2 class="govuk-feedback__title">
|
|
5
|
+
Help us improve this service
|
|
6
|
+
</h2>
|
|
7
|
+
<div class="govuk-feedback__body">
|
|
8
|
+
<p class="govuk-body">Tell us about your experience using this service.</p>
|
|
9
|
+
<p class="govuk-body">Click this cool link to <a href="#" class="govuk-link">give us your feedback</a>.</p>
|
|
10
|
+
<p class="govuk-body">There's another paragraph here.</p>
|
|
11
|
+
<ul class="govuk-list govuk-list--bullet">
|
|
12
|
+
<li>There is also a list</li>
|
|
13
|
+
<li>With items in</li>
|
|
14
|
+
<li>How strange!</li>
|
|
15
|
+
</ul>
|
|
16
|
+
</div>
|
|
17
|
+
</div>
|
|
18
|
+
</div>
|
|
19
|
+
</div>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{% from "../../macros/attributes.njk" import govukAttributes -%}
|
|
2
|
+
|
|
3
|
+
{% set headingLevel = params.headingLevel if params.headingLevel else 2 -%}
|
|
4
|
+
|
|
5
|
+
<div class="govuk-feedback govuk-width-container {%- if params.classes %} {{ params.classes }}{% endif %}" {{- govukAttributes(params.attributes) }}>
|
|
6
|
+
<div class="govuk-grid-row">
|
|
7
|
+
<div class="govuk-grid-column-two-thirds">
|
|
8
|
+
<h{{ headingLevel }} class="govuk-feedback__title">
|
|
9
|
+
{{ params.titleHtml | safe if params.titleHtml else params.titleText }}
|
|
10
|
+
</h{{ headingLevel }}>
|
|
11
|
+
{% if caller or params.html or params.text %}
|
|
12
|
+
<div class="govuk-feedback__body">
|
|
13
|
+
{% if caller or params.html %}
|
|
14
|
+
{{ caller() if caller else params.html | safe | trim | indent(4) }}
|
|
15
|
+
{% elif params.text %}
|
|
16
|
+
<p class="govuk-body">
|
|
17
|
+
{{ params.text | trim | indent(6) }}
|
|
18
|
+
</p>
|
|
19
|
+
{% endif %}
|
|
20
|
+
</div>
|
|
21
|
+
{% endif %}
|
|
22
|
+
</div>
|
|
23
|
+
</div>
|
|
24
|
+
</div>
|
|
@@ -34,6 +34,9 @@
|
|
|
34
34
|
function isObject(option) {
|
|
35
35
|
return !!option && typeof option === 'object' && !isArray(option);
|
|
36
36
|
}
|
|
37
|
+
function isScope($scope) {
|
|
38
|
+
return !!$scope && ($scope instanceof Element || $scope instanceof Document);
|
|
39
|
+
}
|
|
37
40
|
function formatErrorMessage(Component, message) {
|
|
38
41
|
return `${Component.moduleName}: ${message}`;
|
|
39
42
|
}
|
|
@@ -52,11 +55,14 @@
|
|
|
52
55
|
/**
|
|
53
56
|
* Checks if GOV.UK Frontend is supported on this page
|
|
54
57
|
*
|
|
55
|
-
* @param {
|
|
58
|
+
* @param {Element | Document | null | string} [scopeOrMessage] - HTML element `<body>` checked for browser support or support error message
|
|
56
59
|
*/
|
|
57
|
-
constructor(
|
|
58
|
-
|
|
59
|
-
|
|
60
|
+
constructor(scopeOrMessage = document.body) {
|
|
61
|
+
let supportMessage = 'noModule' in HTMLScriptElement.prototype ? 'GOV.UK Frontend initialised without `<body class="govuk-frontend-supported">` from template `<script>` snippet' : 'GOV.UK Frontend is not supported in this browser';
|
|
62
|
+
if (!isScope(scopeOrMessage)) {
|
|
63
|
+
supportMessage = 'GOV.UK Frontend initialised without `<script type="module">`';
|
|
64
|
+
}
|
|
65
|
+
super(typeof scopeOrMessage === 'string' ? scopeOrMessage : supportMessage);
|
|
60
66
|
this.name = 'SupportError';
|
|
61
67
|
}
|
|
62
68
|
}
|
|
@@ -97,6 +103,7 @@
|
|
|
97
103
|
* @import { ComponentWithModuleName } from '../common/index.mjs'
|
|
98
104
|
*/
|
|
99
105
|
|
|
106
|
+
const _self = typeof globalThis !== 'undefined' ? globalThis : self;
|
|
100
107
|
class Component {
|
|
101
108
|
/**
|
|
102
109
|
* Returns the root element of the component
|
|
@@ -150,7 +157,7 @@
|
|
|
150
157
|
/**
|
|
151
158
|
* @typedef {typeof Component & ChildClass} ChildClassConstructor
|
|
152
159
|
*/
|
|
153
|
-
Component.elementType = HTMLElement;
|
|
160
|
+
Component.elementType = _self.HTMLElement;
|
|
154
161
|
|
|
155
162
|
const configOverride = Symbol.for('configOverride');
|
|
156
163
|
class ConfigurableComponent extends Component {
|
|
@@ -175,10 +182,14 @@
|
|
|
175
182
|
throw new ConfigError(formatErrorMessage(childConstructor, 'Config passed as parameter into constructor but no defaults defined'));
|
|
176
183
|
}
|
|
177
184
|
const datasetConfig = normaliseDataset(childConstructor, this._$root.dataset);
|
|
178
|
-
this._config = mergeConfigs(childConstructor.defaults, config != null ? config : {}
|
|
185
|
+
this._config = mergeConfigs(childConstructor.defaults, config != null ? config : {});
|
|
186
|
+
this._config = mergeConfigs(this._config, this[configOverride](datasetConfig), datasetConfig);
|
|
179
187
|
}
|
|
180
188
|
}
|
|
181
189
|
function normaliseString(value, property) {
|
|
190
|
+
if (property != null && property.type && !['string', 'number', 'boolean'].includes(property.type)) {
|
|
191
|
+
return;
|
|
192
|
+
}
|
|
182
193
|
const trimmedValue = value ? value.trim() : '';
|
|
183
194
|
let output;
|
|
184
195
|
let outputType = property == null ? void 0 : property.type;
|
|
@@ -298,6 +309,17 @@
|
|
|
298
309
|
* @import { CompatibleClass, Config, CreateAllOptions, OnErrorCallback } from '../init.mjs'
|
|
299
310
|
*/
|
|
300
311
|
|
|
312
|
+
function createElement(tagName, attributes = {}, children = []) {
|
|
313
|
+
const $element = document.createElement(tagName);
|
|
314
|
+
Object.entries(attributes).forEach(([name, value]) => {
|
|
315
|
+
$element.setAttribute(name, value);
|
|
316
|
+
});
|
|
317
|
+
for (const child of children) {
|
|
318
|
+
$element.append(child);
|
|
319
|
+
}
|
|
320
|
+
return $element;
|
|
321
|
+
}
|
|
322
|
+
|
|
301
323
|
class I18n {
|
|
302
324
|
constructor(translations = {}, config = {}) {
|
|
303
325
|
var _config$locale;
|
|
@@ -418,46 +440,48 @@
|
|
|
418
440
|
this.$input.addEventListener('change', this.onChange.bind(this));
|
|
419
441
|
this.updateDisabledState();
|
|
420
442
|
this.observeDisabledState();
|
|
421
|
-
this.$announcements =
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
443
|
+
this.$announcements = createElement('span', {
|
|
444
|
+
class: 'govuk-file-upload-announcements govuk-visually-hidden',
|
|
445
|
+
'aria-live': 'assertive'
|
|
446
|
+
});
|
|
425
447
|
this.$root.insertAdjacentElement('afterend', this.$announcements);
|
|
426
448
|
this.bindDraggingEvents();
|
|
427
449
|
}
|
|
428
450
|
createStatus() {
|
|
429
|
-
const $status =
|
|
430
|
-
|
|
431
|
-
|
|
451
|
+
const $status = createElement('span', {
|
|
452
|
+
class: 'govuk-body govuk-file-upload-button__status',
|
|
453
|
+
'aria-live': 'polite'
|
|
454
|
+
});
|
|
432
455
|
$status.innerText = this.i18n.t('noFileChosen');
|
|
433
456
|
return $status;
|
|
434
457
|
}
|
|
435
458
|
createButton() {
|
|
436
|
-
const $button =
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
459
|
+
const $button = createElement('button', {
|
|
460
|
+
class: 'govuk-file-upload-button govuk-file-upload-button--empty',
|
|
461
|
+
type: 'button',
|
|
462
|
+
id: this.id
|
|
463
|
+
});
|
|
441
464
|
const ariaDescribedBy = this.$input.getAttribute('aria-describedby');
|
|
442
465
|
if (ariaDescribedBy) {
|
|
443
466
|
$button.setAttribute('aria-describedby', ariaDescribedBy);
|
|
444
467
|
}
|
|
445
468
|
$button.appendChild(this.$status);
|
|
446
|
-
const commaSpan =
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
469
|
+
const commaSpan = createElement('span', {
|
|
470
|
+
class: 'govuk-visually-hidden',
|
|
471
|
+
id: `${this.id}-comma`
|
|
472
|
+
}, [', ']);
|
|
450
473
|
$button.appendChild(commaSpan);
|
|
451
|
-
const containerSpan =
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
buttonSpan
|
|
455
|
-
|
|
474
|
+
const containerSpan = createElement('span', {
|
|
475
|
+
class: 'govuk-file-upload-button__pseudo-button-container'
|
|
476
|
+
});
|
|
477
|
+
const buttonSpan = createElement('span', {
|
|
478
|
+
class: 'govuk-button govuk-button--secondary govuk-file-upload-button__pseudo-button'
|
|
479
|
+
}, [this.i18n.t('chooseFilesButton')]);
|
|
456
480
|
containerSpan.appendChild(buttonSpan);
|
|
457
481
|
containerSpan.insertAdjacentText('beforeend', ' ');
|
|
458
|
-
const instructionSpan =
|
|
459
|
-
|
|
460
|
-
|
|
482
|
+
const instructionSpan = createElement('span', {
|
|
483
|
+
class: 'govuk-body govuk-file-upload-button__instruction'
|
|
484
|
+
}, [this.i18n.t('dropInstruction')]);
|
|
461
485
|
containerSpan.appendChild(instructionSpan);
|
|
462
486
|
$button.appendChild(containerSpan);
|
|
463
487
|
$button.setAttribute('aria-labelledby', `${this.$label.id} ${commaSpan.id} ${$button.id}`);
|