govuk_publishing_components 9.3.6 → 9.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +13 -0
- data/app/assets/stylesheets/component_guide/application.scss +10 -0
- data/app/assets/stylesheets/govuk_publishing_components/_all_components.scss +1 -0
- data/app/assets/stylesheets/govuk_publishing_components/admin_styles.scss +13 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_highlight-boxes.scss +66 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_layout-footer.scss +1 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_layout-for-admin.scss +1 -0
- data/app/models/govuk_publishing_components/component_doc.rb +12 -0
- data/app/views/govuk_publishing_components/component_guide/component_doc/_preview.html.erb +7 -5
- data/app/views/govuk_publishing_components/component_guide/show.html.erb +22 -0
- data/app/views/govuk_publishing_components/components/_highlight_boxes.html.erb +39 -0
- data/app/views/govuk_publishing_components/components/_layout_footer.html.erb +26 -0
- data/app/views/govuk_publishing_components/components/_layout_for_admin.html.erb +10 -0
- data/app/views/govuk_publishing_components/components/docs/highlight_boxes.yml +142 -0
- data/app/views/govuk_publishing_components/components/docs/layout_footer.yml +12 -0
- data/app/views/govuk_publishing_components/components/docs/layout_for_admin.yml +28 -0
- data/app/views/govuk_publishing_components/components/docs/metadata.yml +1 -0
- data/app/views/layouts/govuk_publishing_components/application.html.erb +5 -0
- data/config/initializers/assets.rb +12 -0
- data/lib/govuk_publishing_components.rb +1 -0
- data/lib/govuk_publishing_components/presenters/highlight_boxes_helper.rb +13 -0
- data/lib/govuk_publishing_components/presenters/meta_tags.rb +1 -0
- data/lib/govuk_publishing_components/version.rb +1 -1
- data/node_modules/govuk-frontend/README.md +96 -0
- data/node_modules/govuk-frontend/all-ie8.scss +6 -0
- data/node_modules/govuk-frontend/all.js +1720 -0
- data/node_modules/govuk-frontend/all.scss +11 -0
- data/node_modules/govuk-frontend/assets/fonts/bold-a2452cb66f-v1.woff2 +0 -0
- data/node_modules/govuk-frontend/assets/fonts/bold-f38c792ac2-v1.woff +0 -0
- data/node_modules/govuk-frontend/assets/fonts/bold-fb2676462a-v1.eot +0 -0
- data/node_modules/govuk-frontend/assets/fonts/bold-tabular-357fdfbcc3-v1.eot +0 -0
- data/node_modules/govuk-frontend/assets/fonts/bold-tabular-784c21afb8-v1.woff +0 -0
- data/node_modules/govuk-frontend/assets/fonts/bold-tabular-b89238d840-v1.woff2 +0 -0
- data/node_modules/govuk-frontend/assets/fonts/light-2c037cf7e1-v1.eot +0 -0
- data/node_modules/govuk-frontend/assets/fonts/light-458f8ea81c-v1.woff +0 -0
- data/node_modules/govuk-frontend/assets/fonts/light-f38ad40456-v1.woff2 +0 -0
- data/node_modules/govuk-frontend/assets/fonts/light-tabular-498ea8ffe2-v1.eot +0 -0
- data/node_modules/govuk-frontend/assets/fonts/light-tabular-62cc6f0a28-v1.woff +0 -0
- data/node_modules/govuk-frontend/assets/fonts/light-tabular-851b10ccdd-v1.woff2 +0 -0
- data/node_modules/govuk-frontend/assets/images/favicon.ico +0 -0
- data/node_modules/govuk-frontend/assets/images/govuk-apple-touch-icon-152x152.png +0 -0
- data/node_modules/govuk-frontend/assets/images/govuk-apple-touch-icon-167x167.png +0 -0
- data/node_modules/govuk-frontend/assets/images/govuk-apple-touch-icon-180x180.png +0 -0
- data/node_modules/govuk-frontend/assets/images/govuk-apple-touch-icon.png +0 -0
- data/node_modules/govuk-frontend/assets/images/govuk-crest-2x.png +0 -0
- data/node_modules/govuk-frontend/assets/images/govuk-crest.png +0 -0
- data/node_modules/govuk-frontend/assets/images/govuk-logotype-crown.png +0 -0
- data/node_modules/govuk-frontend/assets/images/govuk-mask-icon.svg +7 -0
- data/node_modules/govuk-frontend/assets/images/govuk-opengraph-image.png +0 -0
- data/node_modules/govuk-frontend/assets/images/icon-arrow-left.png +0 -0
- data/node_modules/govuk-frontend/assets/images/icon-important.png +0 -0
- data/node_modules/govuk-frontend/assets/images/icon-pointer-2x.png +0 -0
- data/node_modules/govuk-frontend/assets/images/icon-pointer.png +0 -0
- data/node_modules/govuk-frontend/common.js +39 -0
- data/node_modules/govuk-frontend/components/_all.scss +26 -0
- data/node_modules/govuk-frontend/components/back-link/README.md +142 -0
- data/node_modules/govuk-frontend/components/back-link/_back-link.scss +54 -0
- data/node_modules/govuk-frontend/components/back-link/back-link.njk +3 -0
- data/node_modules/govuk-frontend/components/back-link/macro.njk +3 -0
- data/node_modules/govuk-frontend/components/back-link/template.njk +2 -0
- data/node_modules/govuk-frontend/components/breadcrumbs/README.md +335 -0
- data/node_modules/govuk-frontend/components/breadcrumbs/_breadcrumbs.scss +119 -0
- data/node_modules/govuk-frontend/components/breadcrumbs/breadcrumbs.njk +14 -0
- data/node_modules/govuk-frontend/components/breadcrumbs/macro.njk +3 -0
- data/node_modules/govuk-frontend/components/breadcrumbs/template.njk +13 -0
- data/node_modules/govuk-frontend/components/button/README.md +319 -0
- data/node_modules/govuk-frontend/components/button/_button.scss +185 -0
- data/node_modules/govuk-frontend/components/button/button.js +548 -0
- data/node_modules/govuk-frontend/components/button/button.njk +3 -0
- data/node_modules/govuk-frontend/components/button/macro.njk +3 -0
- data/node_modules/govuk-frontend/components/button/template.njk +35 -0
- data/node_modules/govuk-frontend/components/checkboxes/README.md +782 -0
- data/node_modules/govuk-frontend/components/checkboxes/_checkboxes.scss +151 -0
- data/node_modules/govuk-frontend/components/checkboxes/checkboxes.js +730 -0
- data/node_modules/govuk-frontend/components/checkboxes/checkboxes.njk +27 -0
- data/node_modules/govuk-frontend/components/checkboxes/macro.njk +3 -0
- data/node_modules/govuk-frontend/components/checkboxes/template.njk +86 -0
- data/node_modules/govuk-frontend/components/date-input/README.md +640 -0
- data/node_modules/govuk-frontend/components/date-input/_date-input.scss +35 -0
- data/node_modules/govuk-frontend/components/date-input/date-input.njk +23 -0
- data/node_modules/govuk-frontend/components/date-input/macro.njk +3 -0
- data/node_modules/govuk-frontend/components/date-input/template.njk +76 -0
- data/node_modules/govuk-frontend/components/details/README.md +237 -0
- data/node_modules/govuk-frontend/components/details/_details.scss +86 -0
- data/node_modules/govuk-frontend/components/details/details.js +836 -0
- data/node_modules/govuk-frontend/components/details/details.njk +7 -0
- data/node_modules/govuk-frontend/components/details/implementation.md +43 -0
- data/node_modules/govuk-frontend/components/details/macro.njk +3 -0
- data/node_modules/govuk-frontend/components/details/template.njk +10 -0
- data/node_modules/govuk-frontend/components/error-message/README.md +143 -0
- data/node_modules/govuk-frontend/components/error-message/_error-message.scss +15 -0
- data/node_modules/govuk-frontend/components/error-message/error-message.njk +7 -0
- data/node_modules/govuk-frontend/components/error-message/macro.njk +3 -0
- data/node_modules/govuk-frontend/components/error-message/template.njk +3 -0
- data/node_modules/govuk-frontend/components/error-summary/README.md +215 -0
- data/node_modules/govuk-frontend/components/error-summary/_error-summary.scss +68 -0
- data/node_modules/govuk-frontend/components/error-summary/error-summary.js +520 -0
- data/node_modules/govuk-frontend/components/error-summary/error-summary.njk +17 -0
- data/node_modules/govuk-frontend/components/error-summary/macro.njk +3 -0
- data/node_modules/govuk-frontend/components/error-summary/template.njk +25 -0
- data/node_modules/govuk-frontend/components/fieldset/README.md +213 -0
- data/node_modules/govuk-frontend/components/fieldset/_fieldset.scss +58 -0
- data/node_modules/govuk-frontend/components/fieldset/fieldset.njk +13 -0
- data/node_modules/govuk-frontend/components/fieldset/macro.njk +3 -0
- data/node_modules/govuk-frontend/components/fieldset/template.njk +17 -0
- data/node_modules/govuk-frontend/components/file-upload/README.md +332 -0
- data/node_modules/govuk-frontend/components/file-upload/_file-upload.scss +19 -0
- data/node_modules/govuk-frontend/components/file-upload/file-upload.njk +9 -0
- data/node_modules/govuk-frontend/components/file-upload/macro.njk +3 -0
- data/node_modules/govuk-frontend/components/file-upload/template.njk +42 -0
- data/node_modules/govuk-frontend/components/footer/README.md +284 -0
- data/node_modules/govuk-frontend/components/footer/_footer.scss +216 -0
- data/node_modules/govuk-frontend/components/footer/footer.njk +3 -0
- data/node_modules/govuk-frontend/components/footer/macro.njk +3 -0
- data/node_modules/govuk-frontend/components/footer/template.njk +80 -0
- data/node_modules/govuk-frontend/components/header/README.md +524 -0
- data/node_modules/govuk-frontend/components/header/_header.scss +285 -0
- data/node_modules/govuk-frontend/components/header/header.js +717 -0
- data/node_modules/govuk-frontend/components/header/header.njk +3 -0
- data/node_modules/govuk-frontend/components/header/macro.njk +3 -0
- data/node_modules/govuk-frontend/components/header/template.njk +82 -0
- data/node_modules/govuk-frontend/components/hint/README.md +157 -0
- data/node_modules/govuk-frontend/components/hint/_hint.scss +29 -0
- data/node_modules/govuk-frontend/components/hint/hint.njk +7 -0
- data/node_modules/govuk-frontend/components/hint/macro.njk +3 -0
- data/node_modules/govuk-frontend/components/hint/template.njk +4 -0
- data/node_modules/govuk-frontend/components/input/README.md +416 -0
- data/node_modules/govuk-frontend/components/input/_input.scss +62 -0
- data/node_modules/govuk-frontend/components/input/input.njk +9 -0
- data/node_modules/govuk-frontend/components/input/macro.njk +3 -0
- data/node_modules/govuk-frontend/components/input/template.njk +42 -0
- data/node_modules/govuk-frontend/components/inset-text/README.md +157 -0
- data/node_modules/govuk-frontend/components/inset-text/_inset-text.scss +28 -0
- data/node_modules/govuk-frontend/components/inset-text/inset-text.njk +7 -0
- data/node_modules/govuk-frontend/components/inset-text/macro.njk +3 -0
- data/node_modules/govuk-frontend/components/inset-text/template.njk +4 -0
- data/node_modules/govuk-frontend/components/label/README.md +193 -0
- data/node_modules/govuk-frontend/components/label/_label.scss +45 -0
- data/node_modules/govuk-frontend/components/label/label.njk +6 -0
- data/node_modules/govuk-frontend/components/label/macro.njk +3 -0
- data/node_modules/govuk-frontend/components/label/template.njk +15 -0
- data/node_modules/govuk-frontend/components/panel/README.md +151 -0
- data/node_modules/govuk-frontend/components/panel/_panel.scss +42 -0
- data/node_modules/govuk-frontend/components/panel/macro.njk +3 -0
- data/node_modules/govuk-frontend/components/panel/panel.njk +7 -0
- data/node_modules/govuk-frontend/components/panel/template.njk +12 -0
- data/node_modules/govuk-frontend/components/phase-banner/README.md +152 -0
- data/node_modules/govuk-frontend/components/phase-banner/_phase-banner.scss +31 -0
- data/node_modules/govuk-frontend/components/phase-banner/macro.njk +3 -0
- data/node_modules/govuk-frontend/components/phase-banner/phase-banner.njk +7 -0
- data/node_modules/govuk-frontend/components/phase-banner/template.njk +17 -0
- data/node_modules/govuk-frontend/components/radios/README.md +686 -0
- data/node_modules/govuk-frontend/components/radios/_radios.scss +157 -0
- data/node_modules/govuk-frontend/components/radios/macro.njk +3 -0
- data/node_modules/govuk-frontend/components/radios/radios.js +730 -0
- data/node_modules/govuk-frontend/components/radios/radios.njk +27 -0
- data/node_modules/govuk-frontend/components/radios/template.njk +85 -0
- data/node_modules/govuk-frontend/components/select/README.md +387 -0
- data/node_modules/govuk-frontend/components/select/_select.scss +35 -0
- data/node_modules/govuk-frontend/components/select/macro.njk +3 -0
- data/node_modules/govuk-frontend/components/select/select.njk +24 -0
- data/node_modules/govuk-frontend/components/select/template.njk +44 -0
- data/node_modules/govuk-frontend/components/skip-link/README.md +142 -0
- data/node_modules/govuk-frontend/components/skip-link/_skip-link.scss +15 -0
- data/node_modules/govuk-frontend/components/skip-link/macro.njk +3 -0
- data/node_modules/govuk-frontend/components/skip-link/skip-link.njk +3 -0
- data/node_modules/govuk-frontend/components/skip-link/template.njk +3 -0
- data/node_modules/govuk-frontend/components/table/README.md +585 -0
- data/node_modules/govuk-frontend/components/table/_table.scss +50 -0
- data/node_modules/govuk-frontend/components/table/macro.njk +3 -0
- data/node_modules/govuk-frontend/components/table/table.njk +45 -0
- data/node_modules/govuk-frontend/components/table/template.njk +39 -0
- data/node_modules/govuk-frontend/components/tabs/README.md +375 -0
- data/node_modules/govuk-frontend/components/tabs/_tabs.scss +120 -0
- data/node_modules/govuk-frontend/components/tabs/macro.njk +3 -0
- data/node_modules/govuk-frontend/components/tabs/tabs.js +1302 -0
- data/node_modules/govuk-frontend/components/tabs/tabs.njk +3 -0
- data/node_modules/govuk-frontend/components/tabs/template.njk +29 -0
- data/node_modules/govuk-frontend/components/tag/README.md +150 -0
- data/node_modules/govuk-frontend/components/tag/_tag.scss +23 -0
- data/node_modules/govuk-frontend/components/tag/macro.njk +3 -0
- data/node_modules/govuk-frontend/components/tag/tag.njk +7 -0
- data/node_modules/govuk-frontend/components/tag/template.njk +3 -0
- data/node_modules/govuk-frontend/components/textarea/README.md +350 -0
- data/node_modules/govuk-frontend/components/textarea/_textarea.scss +31 -0
- data/node_modules/govuk-frontend/components/textarea/macro.njk +3 -0
- data/node_modules/govuk-frontend/components/textarea/template.njk +41 -0
- data/node_modules/govuk-frontend/components/textarea/textarea.njk +11 -0
- data/node_modules/govuk-frontend/components/warning-text/README.md +148 -0
- data/node_modules/govuk-frontend/components/warning-text/_warning-text.scss +50 -0
- data/node_modules/govuk-frontend/components/warning-text/macro.njk +3 -0
- data/node_modules/govuk-frontend/components/warning-text/template.njk +9 -0
- data/node_modules/govuk-frontend/components/warning-text/warning-text.njk +9 -0
- data/node_modules/govuk-frontend/core/_all.scss +6 -0
- data/node_modules/govuk-frontend/core/_global-styles.scss +19 -0
- data/node_modules/govuk-frontend/core/_links.scss +40 -0
- data/node_modules/govuk-frontend/core/_lists.scss +63 -0
- data/node_modules/govuk-frontend/core/_section-break.scss +56 -0
- data/node_modules/govuk-frontend/core/_template.scss +16 -0
- data/node_modules/govuk-frontend/core/_typography.scss +186 -0
- data/node_modules/govuk-frontend/helpers/_all.scss +12 -0
- data/node_modules/govuk-frontend/helpers/_clearfix.scss +15 -0
- data/node_modules/govuk-frontend/helpers/_colour.scss +51 -0
- data/node_modules/govuk-frontend/helpers/_device-pixels.scss +38 -0
- data/node_modules/govuk-frontend/helpers/_focusable.scss +34 -0
- data/node_modules/govuk-frontend/helpers/_font-faces.scss +67 -0
- data/node_modules/govuk-frontend/helpers/_grid.scss +100 -0
- data/node_modules/govuk-frontend/helpers/_links.scss +149 -0
- data/node_modules/govuk-frontend/helpers/_media-queries.scss +95 -0
- data/node_modules/govuk-frontend/helpers/_shape-arrow.scss +80 -0
- data/node_modules/govuk-frontend/helpers/_spacing.scss +152 -0
- data/node_modules/govuk-frontend/helpers/_typography.scss +153 -0
- data/node_modules/govuk-frontend/helpers/_visually-hidden.scss +76 -0
- data/node_modules/govuk-frontend/objects/_all.scss +4 -0
- data/node_modules/govuk-frontend/objects/_form-group.scss +21 -0
- data/node_modules/govuk-frontend/objects/_grid.scss +10 -0
- data/node_modules/govuk-frontend/objects/_main-wrapper.scss +37 -0
- data/node_modules/govuk-frontend/objects/_width-container.scss +28 -0
- data/node_modules/govuk-frontend/overrides/_all.scss +4 -0
- data/node_modules/govuk-frontend/overrides/_display.scss +14 -0
- data/node_modules/govuk-frontend/overrides/_spacing.scss +58 -0
- data/node_modules/govuk-frontend/overrides/_typography.scss +21 -0
- data/node_modules/govuk-frontend/overrides/_width.scss +41 -0
- data/node_modules/govuk-frontend/package.json +89 -0
- data/node_modules/govuk-frontend/settings/_all.scss +21 -0
- data/node_modules/govuk-frontend/settings/_assets.scss +82 -0
- data/node_modules/govuk-frontend/settings/_colours-applied.scss +130 -0
- data/node_modules/govuk-frontend/settings/_colours-organisations.scss +136 -0
- data/node_modules/govuk-frontend/settings/_colours-palette.scss +37 -0
- data/node_modules/govuk-frontend/settings/_compatibility.scss +51 -0
- data/node_modules/govuk-frontend/settings/_global-styles.scss +13 -0
- data/node_modules/govuk-frontend/settings/_ie8.scss +18 -0
- data/node_modules/govuk-frontend/settings/_measurements.scss +85 -0
- data/node_modules/govuk-frontend/settings/_media-queries.scss +23 -0
- data/node_modules/govuk-frontend/settings/_spacing.scss +80 -0
- data/node_modules/govuk-frontend/settings/_typography-font-families.scss +22 -0
- data/node_modules/govuk-frontend/settings/_typography-font.scss +48 -0
- data/node_modules/govuk-frontend/settings/_typography-responsive.scss +138 -0
- data/node_modules/govuk-frontend/template.njk +56 -0
- data/node_modules/govuk-frontend/tools/_all.scss +7 -0
- data/node_modules/govuk-frontend/tools/_compatibility.scss +36 -0
- data/node_modules/govuk-frontend/tools/_exports.scss +33 -0
- data/node_modules/govuk-frontend/tools/_font-url.scss +28 -0
- data/node_modules/govuk-frontend/tools/_ie8.scss +51 -0
- data/node_modules/govuk-frontend/tools/_iff.scss +15 -0
- data/node_modules/govuk-frontend/tools/_image-url.scss +28 -0
- data/node_modules/govuk-frontend/tools/_px-to-em.scss +20 -0
- data/node_modules/govuk-frontend/utilities/_all.scss +2 -0
- data/node_modules/govuk-frontend/utilities/_clearfix.scss +5 -0
- data/node_modules/govuk-frontend/utilities/_visually-hidden.scss +9 -0
- data/node_modules/govuk-frontend/vendor/_sass-mq.scss +351 -0
- data/node_modules/govuk-frontend/vendor/polyfills/DOMTokenList.js +272 -0
- data/node_modules/govuk-frontend/vendor/polyfills/Document.js +34 -0
- data/node_modules/govuk-frontend/vendor/polyfills/Element.js +147 -0
- data/node_modules/govuk-frontend/vendor/polyfills/Element/prototype/classList.js +449 -0
- data/node_modules/govuk-frontend/vendor/polyfills/Event.js +504 -0
- data/node_modules/govuk-frontend/vendor/polyfills/Function/prototype/bind.js +252 -0
- data/node_modules/govuk-frontend/vendor/polyfills/Object/defineProperty.js +94 -0
- data/node_modules/govuk-frontend/vendor/polyfills/Window.js +28 -0
- metadata +249 -2
@@ -0,0 +1,31 @@
|
|
1
|
+
@import "../../settings/all";
|
2
|
+
@import "../../tools/all";
|
3
|
+
@import "../../helpers/all";
|
4
|
+
|
5
|
+
@import "../error-message/error-message";
|
6
|
+
@import "../hint/hint";
|
7
|
+
@import "../label/label";
|
8
|
+
|
9
|
+
@include govuk-exports("govuk/component/textarea") {
|
10
|
+
.govuk-textarea {
|
11
|
+
@include govuk-font($size: 19, $line-height: 1.25);
|
12
|
+
@include govuk-focusable;
|
13
|
+
|
14
|
+
-webkit-box-sizing: border-box;
|
15
|
+
|
16
|
+
box-sizing: border-box; // should this be global?
|
17
|
+
display: block;
|
18
|
+
width: 100%;
|
19
|
+
@include govuk-responsive-margin(6, "bottom");
|
20
|
+
padding: govuk-spacing(1);
|
21
|
+
|
22
|
+
border: $govuk-border-width-form-element solid $govuk-input-border-colour;
|
23
|
+
border-radius: 0;
|
24
|
+
|
25
|
+
-webkit-appearance: none;
|
26
|
+
}
|
27
|
+
|
28
|
+
.govuk-textarea--error {
|
29
|
+
border: $govuk-border-width-form-element-error solid $govuk-error-colour;
|
30
|
+
}
|
31
|
+
}
|
@@ -0,0 +1,41 @@
|
|
1
|
+
{% from "../error-message/macro.njk" import govukErrorMessage -%}
|
2
|
+
{% from "../hint/macro.njk" import govukHint %}
|
3
|
+
{% from "../label/macro.njk" import govukLabel %}
|
4
|
+
|
5
|
+
{#- a record of other elements that we need to associate with the input using
|
6
|
+
aria-describedby – for example hints or error messages -#}
|
7
|
+
{% set describedBy = "" %}
|
8
|
+
<div class="govuk-form-group {%- if params.errorMessage %} govuk-form-group--error{% endif %}">
|
9
|
+
{{ govukLabel({
|
10
|
+
html: params.label.html,
|
11
|
+
text: params.label.text,
|
12
|
+
classes: params.label.classes,
|
13
|
+
isPageHeading: params.label.isPageHeading,
|
14
|
+
attributes: params.label.attributes,
|
15
|
+
for: params.id
|
16
|
+
}) | indent(2) | trim }}
|
17
|
+
{% if params.hint %}
|
18
|
+
{% set hintId = params.id + '-hint' %}
|
19
|
+
{% set describedBy = describedBy + ' ' + hintId if describedBy else hintId %}
|
20
|
+
{{ govukHint({
|
21
|
+
id: hintId,
|
22
|
+
classes: params.hint.classes,
|
23
|
+
attributes: params.hint.attributes,
|
24
|
+
html: params.hint.html,
|
25
|
+
text: params.hint.text
|
26
|
+
}) | indent(2) | trim }}
|
27
|
+
{% endif %}
|
28
|
+
{% if params.errorMessage %}
|
29
|
+
{% set errorId = params.id + '-error' %}
|
30
|
+
{% set describedBy = describedBy + ' ' + errorId if describedBy else errorId %}
|
31
|
+
{{ govukErrorMessage({
|
32
|
+
id: errorId,
|
33
|
+
classes: params.errorMessage.classes,
|
34
|
+
html: params.errorMessage.html,
|
35
|
+
text: params.errorMessage.text
|
36
|
+
}) | indent(2) | trim }}
|
37
|
+
{% endif %}
|
38
|
+
<textarea class="govuk-textarea {{- ' govuk-textarea--error' if params.errorMessage }} {{- ' ' + params.classes if params.classes}}" id="{{ params.id }}" name="{{ params.name }}" rows="{%if params.rows %} {{- params.rows -}} {% else %}5{%endif %}"
|
39
|
+
{%- if describedBy %} aria-describedby="{{ describedBy }}"{% endif %}
|
40
|
+
{%- for attribute, value in params.attributes %} {{attribute}}="{{value}}"{% endfor %}>{{ params.value }}</textarea>
|
41
|
+
</div>
|
@@ -0,0 +1,11 @@
|
|
1
|
+
{% from "textarea/macro.njk" import govukTextarea %}
|
2
|
+
|
3
|
+
{{ govukTextarea({
|
4
|
+
id: "more-detail",
|
5
|
+
name: "more-detail",
|
6
|
+
label: {
|
7
|
+
text: "Can you provide more detail?",
|
8
|
+
hintText: "Don't include personal or financial information, eg your National Insurance number or credit card details."
|
9
|
+
}
|
10
|
+
})
|
11
|
+
}}
|
@@ -0,0 +1,148 @@
|
|
1
|
+
# Warning text
|
2
|
+
|
3
|
+
## Introduction
|
4
|
+
|
5
|
+
Use bold text with an exclamation icon if there are consequences - for example, a fine or prison sentence.
|
6
|
+
|
7
|
+
## Guidance
|
8
|
+
|
9
|
+
Find out when to use the Warning text component in your service in the [GOV.UK Design System](https://govuk-design-system-production.cloudapps.digital/components/warning-text).
|
10
|
+
|
11
|
+
## Quick start examples
|
12
|
+
|
13
|
+
### Component default
|
14
|
+
|
15
|
+
[Preview the warning-text component](http://govuk-frontend-review.herokuapp.com/components/warning-text/preview)
|
16
|
+
|
17
|
+
#### Markup
|
18
|
+
|
19
|
+
<div class="govuk-warning-text">
|
20
|
+
<span class="govuk-warning-text__icon" aria-hidden="true">!</span>
|
21
|
+
<strong class="govuk-warning-text__text">
|
22
|
+
<span class="govuk-warning-text__assistive">Warning</span>
|
23
|
+
You can be fined up to £5,000 if you don’t register.
|
24
|
+
</strong>
|
25
|
+
</div>
|
26
|
+
|
27
|
+
#### Macro
|
28
|
+
|
29
|
+
{% from 'warning-text/macro.njk' import govukWarningText %}
|
30
|
+
|
31
|
+
{{ govukWarningText({
|
32
|
+
"text": "You can be fined up to £5,000 if you don’t register.",
|
33
|
+
"iconFallbackText": "Warning"
|
34
|
+
}) }}
|
35
|
+
|
36
|
+
## Requirements
|
37
|
+
|
38
|
+
### Build tool configuration
|
39
|
+
|
40
|
+
When compiling the Sass files you'll need to define includePaths to reference the node_modules directory. Below is a sample configuration using gulp
|
41
|
+
|
42
|
+
.pipe(sass({
|
43
|
+
includePaths: 'node_modules/'
|
44
|
+
}))
|
45
|
+
|
46
|
+
### Static asset path configuration
|
47
|
+
|
48
|
+
In order to include the images used in the components, you need to configure your app to show these assets. Below is a sample configuration using Express js:
|
49
|
+
|
50
|
+
app.use('/assets', express.static(path.join(__dirname, '/node_modules/govuk-frontend/assets')))
|
51
|
+
|
52
|
+
## Component arguments
|
53
|
+
|
54
|
+
If you are using Nunjucks,then macros take the following arguments
|
55
|
+
|
56
|
+
**If you’re using Nunjucks macros in production be aware that using `html` arguments, or ones ending with `Html` can be a [security risk](https://en.wikipedia.org/wiki/Cross-site_scripting). More about it in the [Nunjucks documentation](https://mozilla.github.io/nunjucks/api.html#user-defined-templates-warning).**
|
57
|
+
|
58
|
+
<table class="govuk-table">
|
59
|
+
|
60
|
+
<thead class="govuk-table__head">
|
61
|
+
|
62
|
+
<tr class="govuk-table__row">
|
63
|
+
|
64
|
+
<th class="govuk-table__header" scope="col">Name</th>
|
65
|
+
|
66
|
+
<th class="govuk-table__header" scope="col">Type</th>
|
67
|
+
|
68
|
+
<th class="govuk-table__header" scope="col">Required</th>
|
69
|
+
|
70
|
+
<th class="govuk-table__header" scope="col">Description</th>
|
71
|
+
|
72
|
+
</tr>
|
73
|
+
|
74
|
+
</thead>
|
75
|
+
|
76
|
+
<tbody class="govuk-table__body">
|
77
|
+
|
78
|
+
<tr class="govuk-table__row">
|
79
|
+
|
80
|
+
<th class="govuk-table__header" scope="row">text (or) html</th>
|
81
|
+
|
82
|
+
<td class="govuk-table__cell ">string</td>
|
83
|
+
|
84
|
+
<td class="govuk-table__cell ">Yes</td>
|
85
|
+
|
86
|
+
<td class="govuk-table__cell ">Text or HTML for the warning text content. If `html` is provided, the `text` argument is ignored.</td>
|
87
|
+
|
88
|
+
</tr>
|
89
|
+
|
90
|
+
<tr class="govuk-table__row">
|
91
|
+
|
92
|
+
<th class="govuk-table__header" scope="row">iconFallbackText</th>
|
93
|
+
|
94
|
+
<td class="govuk-table__cell ">string</td>
|
95
|
+
|
96
|
+
<td class="govuk-table__cell ">Yes</td>
|
97
|
+
|
98
|
+
<td class="govuk-table__cell ">The fallback text for the icon</td>
|
99
|
+
|
100
|
+
</tr>
|
101
|
+
|
102
|
+
<tr class="govuk-table__row">
|
103
|
+
|
104
|
+
<th class="govuk-table__header" scope="row">classes</th>
|
105
|
+
|
106
|
+
<td class="govuk-table__cell ">string</td>
|
107
|
+
|
108
|
+
<td class="govuk-table__cell ">No</td>
|
109
|
+
|
110
|
+
<td class="govuk-table__cell ">Optional additional classes to add to the warning-text container.</td>
|
111
|
+
|
112
|
+
</tr>
|
113
|
+
|
114
|
+
<tr class="govuk-table__row">
|
115
|
+
|
116
|
+
<th class="govuk-table__header" scope="row">attributes</th>
|
117
|
+
|
118
|
+
<td class="govuk-table__cell ">object</td>
|
119
|
+
|
120
|
+
<td class="govuk-table__cell ">No</td>
|
121
|
+
|
122
|
+
<td class="govuk-table__cell ">Any extra HTML attributes (for example data attributes) to add to the warning-text container.</td>
|
123
|
+
|
124
|
+
</tr>
|
125
|
+
|
126
|
+
</tbody>
|
127
|
+
|
128
|
+
</table>
|
129
|
+
|
130
|
+
**If you’re using Nunjucks macros in production be aware that using `html` arguments, or ones ending with `Html` can be a [security risk](https://en.wikipedia.org/wiki/Cross-site_scripting). More about it in the [Nunjucks documentation](https://mozilla.github.io/nunjucks/api.html#user-defined-templates-warning).**
|
131
|
+
|
132
|
+
### Setting up Nunjucks views and paths
|
133
|
+
|
134
|
+
Below is an example setup using express configure views:
|
135
|
+
|
136
|
+
nunjucks.configure('node_modules/govuk-frontend/components', {
|
137
|
+
autoescape: true,
|
138
|
+
cache: false,
|
139
|
+
express: app
|
140
|
+
})
|
141
|
+
|
142
|
+
## Contribution
|
143
|
+
|
144
|
+
Guidelines can be found at [on our Github repository.](https://github.com/alphagov/govuk-frontend/blob/master/CONTRIBUTING.md "link to contributing guidelines on our github repository")
|
145
|
+
|
146
|
+
## License
|
147
|
+
|
148
|
+
MIT
|
@@ -0,0 +1,50 @@
|
|
1
|
+
@import "../../settings/all";
|
2
|
+
@import "../../tools/all";
|
3
|
+
@import "../../helpers/all";
|
4
|
+
|
5
|
+
@include govuk-exports("govuk/component/warning-text") {
|
6
|
+
|
7
|
+
.govuk-warning-text {
|
8
|
+
@include govuk-font($size: 19);
|
9
|
+
@include govuk-text-colour;
|
10
|
+
|
11
|
+
position: relative;
|
12
|
+
@include govuk-responsive-margin(6, "bottom");
|
13
|
+
padding: govuk-spacing(2) 0;
|
14
|
+
}
|
15
|
+
|
16
|
+
.govuk-warning-text__assistive {
|
17
|
+
@include govuk-visually-hidden;
|
18
|
+
}
|
19
|
+
|
20
|
+
.govuk-warning-text__icon {
|
21
|
+
@include govuk-font($size: false, $weight: bold);
|
22
|
+
|
23
|
+
display: inline-block;
|
24
|
+
|
25
|
+
position: absolute;
|
26
|
+
top: 50%;
|
27
|
+
left: 0;
|
28
|
+
|
29
|
+
min-width: 38px;
|
30
|
+
min-height: 35px;
|
31
|
+
margin-top: -20px; // Half the height of the 38px circle (adjusted for NTA)
|
32
|
+
padding-top: 3px;
|
33
|
+
|
34
|
+
border-radius: 50%;
|
35
|
+
|
36
|
+
color: govuk-colour("white");
|
37
|
+
background: govuk-colour("black");
|
38
|
+
|
39
|
+
font-size: 1.6em;
|
40
|
+
line-height: 35px;
|
41
|
+
|
42
|
+
text-align: center;
|
43
|
+
}
|
44
|
+
|
45
|
+
.govuk-warning-text__text {
|
46
|
+
display: block;
|
47
|
+
margin-left: -$govuk-gutter-half;
|
48
|
+
padding-left: 65px;
|
49
|
+
}
|
50
|
+
}
|
@@ -0,0 +1,9 @@
|
|
1
|
+
<div class="govuk-warning-text {{- ' ' + params.classes if params.classes}}"
|
2
|
+
{%- for attribute, value in params.attributes %} {{attribute}}="{{value}}"{% endfor -%}
|
3
|
+
>
|
4
|
+
<span class="govuk-warning-text__icon" aria-hidden="true">!</span>
|
5
|
+
<strong class="govuk-warning-text__text">
|
6
|
+
<span class="govuk-warning-text__assistive">{{ params.iconFallbackText }}</span>
|
7
|
+
{{ params.html | safe if params.html else params.text }}
|
8
|
+
</strong>
|
9
|
+
</div>
|
@@ -0,0 +1,19 @@
|
|
1
|
+
@import "links";
|
2
|
+
@import "typography";
|
3
|
+
|
4
|
+
@mixin govuk-global-styles {
|
5
|
+
a {
|
6
|
+
@extend %govuk-link;
|
7
|
+
}
|
8
|
+
|
9
|
+
p {
|
10
|
+
@extend %govuk-body-m;
|
11
|
+
}
|
12
|
+
}
|
13
|
+
|
14
|
+
@include govuk-exports("govuk/core/global-styles") {
|
15
|
+
|
16
|
+
@if $govuk-global-styles == true {
|
17
|
+
@include govuk-global-styles;
|
18
|
+
}
|
19
|
+
}
|
@@ -0,0 +1,40 @@
|
|
1
|
+
@include govuk-exports("govuk/core/links") {
|
2
|
+
|
3
|
+
%govuk-link {
|
4
|
+
@include govuk-link-common;
|
5
|
+
@include govuk-link-style-default;
|
6
|
+
@include govuk-link-print-friendly;
|
7
|
+
}
|
8
|
+
|
9
|
+
.govuk-link {
|
10
|
+
@extend %govuk-link;
|
11
|
+
}
|
12
|
+
|
13
|
+
// Variant classes should always be used in conjunction with the .govuk-link
|
14
|
+
// class, so we do not need the common link styles as they will be inherited.
|
15
|
+
|
16
|
+
.govuk-link--muted {
|
17
|
+
@include govuk-link-style-muted;
|
18
|
+
}
|
19
|
+
|
20
|
+
.govuk-link--text-colour {
|
21
|
+
@include govuk-link-style-text;
|
22
|
+
}
|
23
|
+
|
24
|
+
// 'No visited state' link mixin
|
25
|
+
//
|
26
|
+
// Used in cases where it is not helpful to distinguish between visited and
|
27
|
+
// non-visited links.
|
28
|
+
//
|
29
|
+
// For example, navigation links to pages with dynamic content like admin
|
30
|
+
// dashboards. The content on the page is changing all the time, so the fact
|
31
|
+
// that you’ve visited it before is not important.
|
32
|
+
//
|
33
|
+
// This is not abstracted as a mixin because it does not provide states for
|
34
|
+
// all pseudo-selectors so it does not make sense to use it in composition.
|
35
|
+
.govuk-link--no-visited-state {
|
36
|
+
&:visited {
|
37
|
+
color: $govuk-link-colour;
|
38
|
+
}
|
39
|
+
}
|
40
|
+
}
|
@@ -0,0 +1,63 @@
|
|
1
|
+
@include govuk-exports("govuk/core/lists") {
|
2
|
+
|
3
|
+
%govuk-list {
|
4
|
+
@include govuk-font($size: 19);
|
5
|
+
@include govuk-text-colour;
|
6
|
+
margin-top: 0;
|
7
|
+
@include govuk-responsive-margin(4, "bottom");
|
8
|
+
padding-left: 0;
|
9
|
+
list-style-type: none;
|
10
|
+
|
11
|
+
// Add a top margin for nested lists
|
12
|
+
%govuk-list {
|
13
|
+
margin-top: govuk-spacing(2);
|
14
|
+
}
|
15
|
+
}
|
16
|
+
|
17
|
+
%govuk-list > li {
|
18
|
+
@include govuk-media-query($from: tablet) {
|
19
|
+
margin-bottom: govuk-spacing(1);
|
20
|
+
}
|
21
|
+
}
|
22
|
+
|
23
|
+
%govuk-list a {
|
24
|
+
&:link {
|
25
|
+
color: $govuk-link-colour;
|
26
|
+
}
|
27
|
+
|
28
|
+
&:visited {
|
29
|
+
color: $govuk-link-visited-colour;
|
30
|
+
}
|
31
|
+
|
32
|
+
&:hover {
|
33
|
+
color: $govuk-link-hover-colour;
|
34
|
+
}
|
35
|
+
|
36
|
+
&:active {
|
37
|
+
color: $govuk-link-active-colour;
|
38
|
+
}
|
39
|
+
}
|
40
|
+
|
41
|
+
.govuk-list {
|
42
|
+
@extend %govuk-list;
|
43
|
+
}
|
44
|
+
|
45
|
+
%govuk-list--bullet {
|
46
|
+
padding-left: govuk-spacing(4);
|
47
|
+
|
48
|
+
list-style-type: disc;
|
49
|
+
}
|
50
|
+
|
51
|
+
.govuk-list--bullet {
|
52
|
+
@extend %govuk-list--bullet;
|
53
|
+
}
|
54
|
+
|
55
|
+
%govuk-list--number {
|
56
|
+
padding-left: govuk-spacing(4);
|
57
|
+
list-style-type: decimal;
|
58
|
+
}
|
59
|
+
|
60
|
+
.govuk-list--number {
|
61
|
+
@extend %govuk-list--number;
|
62
|
+
}
|
63
|
+
}
|