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,35 @@
|
|
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/select") {
|
10
|
+
.govuk-select {
|
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
|
+
width: 100%;
|
18
|
+
height: 40px;
|
19
|
+
|
20
|
+
padding: govuk-spacing(1); // was 5px 4px 4px - size of it should be adjusted to match other form elements
|
21
|
+
border: $govuk-border-width-form-element solid $govuk-input-border-colour;
|
22
|
+
}
|
23
|
+
|
24
|
+
.govuk-select option:active,
|
25
|
+
.govuk-select option:checked,
|
26
|
+
.govuk-select:focus::-ms-value {
|
27
|
+
color: govuk-colour("white");
|
28
|
+
background-color: govuk-colour("blue");
|
29
|
+
}
|
30
|
+
|
31
|
+
.govuk-select--error {
|
32
|
+
border: $govuk-border-width-form-element-error solid $govuk-error-colour;
|
33
|
+
}
|
34
|
+
|
35
|
+
}
|
@@ -0,0 +1,24 @@
|
|
1
|
+
{% from "select/macro.njk" import govukSelect %}
|
2
|
+
|
3
|
+
{{ govukSelect({
|
4
|
+
"id": "select-1",
|
5
|
+
"name": "select-1",
|
6
|
+
"label": {
|
7
|
+
"html": "Label text goes here"
|
8
|
+
},
|
9
|
+
"items": [
|
10
|
+
{
|
11
|
+
"value": 1,
|
12
|
+
"text": "GOV.UK frontend option 1"
|
13
|
+
},
|
14
|
+
{
|
15
|
+
"value": 2,
|
16
|
+
"text": "GOV.UK frontend option 2",
|
17
|
+
"selected": true
|
18
|
+
},
|
19
|
+
{
|
20
|
+
"value": 3,
|
21
|
+
"text": "GOV.UK frontend option 3"
|
22
|
+
}
|
23
|
+
]
|
24
|
+
}) }}
|
@@ -0,0 +1,44 @@
|
|
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
|
+
<select class="govuk-select
|
39
|
+
{%- if params.classes %} {{ params.classes }}{% endif %}{%- if params.errorMessage %} govuk-select--error{% endif %}" id="{{ params.id }}" name="{{ params.name }}" {%- if describedBy %} aria-describedby="{{ describedBy }}"{% endif %} {%- for attribute, value in params.attributes %} {{ attribute }}="{{ value }}"{% endfor %}>
|
40
|
+
{% for item in params.items %}
|
41
|
+
<option value="{{ item.value }}"{{" selected" if item.selected}}{{" disabled" if item.disabled}}>{{ item.text }}</option>
|
42
|
+
{% endfor %}
|
43
|
+
</select>
|
44
|
+
</div>
|
@@ -0,0 +1,142 @@
|
|
1
|
+
# Skip link
|
2
|
+
|
3
|
+
## Introduction
|
4
|
+
|
5
|
+
Skip link component. Make skip links visible when they are tabbed to. You'll need to add correct id to your main content area, to ensure the skip link will work.
|
6
|
+
|
7
|
+
## Guidance
|
8
|
+
|
9
|
+
Find out when to use the Skip link component in your service in the [GOV.UK Design System](https://govuk-design-system-production.cloudapps.digital/components/skip-link).
|
10
|
+
|
11
|
+
## Quick start examples
|
12
|
+
|
13
|
+
### Component default
|
14
|
+
|
15
|
+
[Preview the skip-link component](http://govuk-frontend-review.herokuapp.com/components/skip-link/preview)
|
16
|
+
|
17
|
+
#### Markup
|
18
|
+
|
19
|
+
<a href="#content" class="govuk-skip-link">Skip to main content</a>
|
20
|
+
|
21
|
+
#### Macro
|
22
|
+
|
23
|
+
{% from 'skip-link/macro.njk' import govukSkipLink %}
|
24
|
+
|
25
|
+
{{ govukSkipLink({
|
26
|
+
"text": "Skip to main content",
|
27
|
+
"href": "#content"
|
28
|
+
}) }}
|
29
|
+
|
30
|
+
## Requirements
|
31
|
+
|
32
|
+
### Build tool configuration
|
33
|
+
|
34
|
+
When compiling the Sass files you'll need to define includePaths to reference the node_modules directory. Below is a sample configuration using gulp
|
35
|
+
|
36
|
+
.pipe(sass({
|
37
|
+
includePaths: 'node_modules/'
|
38
|
+
}))
|
39
|
+
|
40
|
+
### Static asset path configuration
|
41
|
+
|
42
|
+
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:
|
43
|
+
|
44
|
+
app.use('/assets', express.static(path.join(__dirname, '/node_modules/govuk-frontend/assets')))
|
45
|
+
|
46
|
+
## Component arguments
|
47
|
+
|
48
|
+
If you are using Nunjucks,then macros take the following arguments
|
49
|
+
|
50
|
+
**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).**
|
51
|
+
|
52
|
+
<table class="govuk-table">
|
53
|
+
|
54
|
+
<thead class="govuk-table__head">
|
55
|
+
|
56
|
+
<tr class="govuk-table__row">
|
57
|
+
|
58
|
+
<th class="govuk-table__header" scope="col">Name</th>
|
59
|
+
|
60
|
+
<th class="govuk-table__header" scope="col">Type</th>
|
61
|
+
|
62
|
+
<th class="govuk-table__header" scope="col">Required</th>
|
63
|
+
|
64
|
+
<th class="govuk-table__header" scope="col">Description</th>
|
65
|
+
|
66
|
+
</tr>
|
67
|
+
|
68
|
+
</thead>
|
69
|
+
|
70
|
+
<tbody class="govuk-table__body">
|
71
|
+
|
72
|
+
<tr class="govuk-table__row">
|
73
|
+
|
74
|
+
<th class="govuk-table__header" scope="row">text (or) html</th>
|
75
|
+
|
76
|
+
<td class="govuk-table__cell ">string</td>
|
77
|
+
|
78
|
+
<td class="govuk-table__cell ">No</td>
|
79
|
+
|
80
|
+
<td class="govuk-table__cell ">Text or HTML to use within the skip link. If `html` is provided, the `text` argument will be ignored.</td>
|
81
|
+
|
82
|
+
</tr>
|
83
|
+
|
84
|
+
<tr class="govuk-table__row">
|
85
|
+
|
86
|
+
<th class="govuk-table__header" scope="row">href</th>
|
87
|
+
|
88
|
+
<td class="govuk-table__cell ">string</td>
|
89
|
+
|
90
|
+
<td class="govuk-table__cell ">Yes</td>
|
91
|
+
|
92
|
+
<td class="govuk-table__cell ">The value of the skip link href attribute. Defaults to #content</td>
|
93
|
+
|
94
|
+
</tr>
|
95
|
+
|
96
|
+
<tr class="govuk-table__row">
|
97
|
+
|
98
|
+
<th class="govuk-table__header" scope="row">classes</th>
|
99
|
+
|
100
|
+
<td class="govuk-table__cell ">string</td>
|
101
|
+
|
102
|
+
<td class="govuk-table__cell ">No</td>
|
103
|
+
|
104
|
+
<td class="govuk-table__cell ">Optional additional classes to add to the skip link.</td>
|
105
|
+
|
106
|
+
</tr>
|
107
|
+
|
108
|
+
<tr class="govuk-table__row">
|
109
|
+
|
110
|
+
<th class="govuk-table__header" scope="row">attributes</th>
|
111
|
+
|
112
|
+
<td class="govuk-table__cell ">object</td>
|
113
|
+
|
114
|
+
<td class="govuk-table__cell ">No</td>
|
115
|
+
|
116
|
+
<td class="govuk-table__cell ">Any extra HTML attributes (for example data attributes) to add to the skip link.</td>
|
117
|
+
|
118
|
+
</tr>
|
119
|
+
|
120
|
+
</tbody>
|
121
|
+
|
122
|
+
</table>
|
123
|
+
|
124
|
+
**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).**
|
125
|
+
|
126
|
+
### Setting up Nunjucks views and paths
|
127
|
+
|
128
|
+
Below is an example setup using express configure views:
|
129
|
+
|
130
|
+
nunjucks.configure('node_modules/govuk-frontend/components', {
|
131
|
+
autoescape: true,
|
132
|
+
cache: false,
|
133
|
+
express: app
|
134
|
+
})
|
135
|
+
|
136
|
+
## Contribution
|
137
|
+
|
138
|
+
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")
|
139
|
+
|
140
|
+
## License
|
141
|
+
|
142
|
+
MIT
|
@@ -0,0 +1,15 @@
|
|
1
|
+
@import "../../settings/all";
|
2
|
+
@import "../../tools/all";
|
3
|
+
@import "../../helpers/all";
|
4
|
+
|
5
|
+
@include govuk-exports("govuk/component/skip-link") {
|
6
|
+
.govuk-skip-link {
|
7
|
+
@include govuk-visually-hidden-focusable;
|
8
|
+
@include govuk-link-common;
|
9
|
+
@include govuk-link-style-text;
|
10
|
+
@include govuk-typography-responsive($size: 16);
|
11
|
+
|
12
|
+
display: block;
|
13
|
+
padding: govuk-spacing(2) govuk-spacing(3);
|
14
|
+
}
|
15
|
+
}
|
@@ -0,0 +1,3 @@
|
|
1
|
+
<a href="{{ params.href | default('#content') }}" class="govuk-skip-link{%- if params.classes %} {{ params.classes }}{% endif -%}"{%- for attribute, value in params.attributes %} {{ attribute }}="{{ value }}"{% endfor %}>
|
2
|
+
{{- params.html | safe if params.html else params.text -}}
|
3
|
+
</a>
|
@@ -0,0 +1,585 @@
|
|
1
|
+
# Table
|
2
|
+
|
3
|
+
## Introduction
|
4
|
+
|
5
|
+
Table description.
|
6
|
+
|
7
|
+
## Guidance
|
8
|
+
|
9
|
+
Find out when to use the Table component in your service in the [GOV.UK Design System](https://govuk-design-system-production.cloudapps.digital/components/table).
|
10
|
+
|
11
|
+
## Quick start examples
|
12
|
+
|
13
|
+
### Component default
|
14
|
+
|
15
|
+
[Preview the table component](http://govuk-frontend-review.herokuapp.com/components/table/preview)
|
16
|
+
|
17
|
+
#### Markup
|
18
|
+
|
19
|
+
<table class="govuk-table">
|
20
|
+
|
21
|
+
<tbody class="govuk-table__body">
|
22
|
+
|
23
|
+
<tr class="govuk-table__row">
|
24
|
+
|
25
|
+
<td class="govuk-table__cell">January</td>
|
26
|
+
|
27
|
+
<td class="govuk-table__cell govuk-table__cell--numeric">£85</td>
|
28
|
+
|
29
|
+
<td class="govuk-table__cell govuk-table__cell--numeric">£95</td>
|
30
|
+
|
31
|
+
</tr>
|
32
|
+
|
33
|
+
<tr class="govuk-table__row">
|
34
|
+
|
35
|
+
<td class="govuk-table__cell">February</td>
|
36
|
+
|
37
|
+
<td class="govuk-table__cell govuk-table__cell--numeric">£75</td>
|
38
|
+
|
39
|
+
<td class="govuk-table__cell govuk-table__cell--numeric">£55</td>
|
40
|
+
|
41
|
+
</tr>
|
42
|
+
|
43
|
+
<tr class="govuk-table__row">
|
44
|
+
|
45
|
+
<td class="govuk-table__cell">March</td>
|
46
|
+
|
47
|
+
<td class="govuk-table__cell govuk-table__cell--numeric">£165</td>
|
48
|
+
|
49
|
+
<td class="govuk-table__cell govuk-table__cell--numeric">£125</td>
|
50
|
+
|
51
|
+
</tr>
|
52
|
+
|
53
|
+
</tbody>
|
54
|
+
</table>
|
55
|
+
|
56
|
+
#### Macro
|
57
|
+
|
58
|
+
{% from 'table/macro.njk' import govukTable %}
|
59
|
+
|
60
|
+
{{ govukTable({
|
61
|
+
"rows": [
|
62
|
+
[
|
63
|
+
{
|
64
|
+
"text": "January"
|
65
|
+
},
|
66
|
+
{
|
67
|
+
"text": "£85",
|
68
|
+
"format": "numeric"
|
69
|
+
},
|
70
|
+
{
|
71
|
+
"text": "£95",
|
72
|
+
"format": "numeric"
|
73
|
+
}
|
74
|
+
],
|
75
|
+
[
|
76
|
+
{
|
77
|
+
"text": "February"
|
78
|
+
},
|
79
|
+
{
|
80
|
+
"text": "£75",
|
81
|
+
"format": "numeric"
|
82
|
+
},
|
83
|
+
{
|
84
|
+
"text": "£55",
|
85
|
+
"format": "numeric"
|
86
|
+
}
|
87
|
+
],
|
88
|
+
[
|
89
|
+
{
|
90
|
+
"text": "March"
|
91
|
+
},
|
92
|
+
{
|
93
|
+
"text": "£165",
|
94
|
+
"format": "numeric"
|
95
|
+
},
|
96
|
+
{
|
97
|
+
"text": "£125",
|
98
|
+
"format": "numeric"
|
99
|
+
}
|
100
|
+
]
|
101
|
+
]
|
102
|
+
}) }}
|
103
|
+
|
104
|
+
### Table--table-with-head
|
105
|
+
|
106
|
+
[Preview the table--table-with-head example](http://govuk-frontend-review.herokuapp.com/components/table/table-with-head/preview)
|
107
|
+
|
108
|
+
#### Markup
|
109
|
+
|
110
|
+
<table class="govuk-table">
|
111
|
+
|
112
|
+
<thead class="govuk-table__head">
|
113
|
+
<tr class="govuk-table__row">
|
114
|
+
|
115
|
+
<th class="govuk-table__header" scope="col">Month you apply</th>
|
116
|
+
|
117
|
+
<th class="govuk-table__header govuk-table__header--numeric" scope="col">Rate for bicycles</th>
|
118
|
+
|
119
|
+
<th class="govuk-table__header govuk-table__header--numeric" scope="col">Rate for vehicles</th>
|
120
|
+
|
121
|
+
</tr>
|
122
|
+
</thead>
|
123
|
+
|
124
|
+
<tbody class="govuk-table__body">
|
125
|
+
|
126
|
+
<tr class="govuk-table__row">
|
127
|
+
|
128
|
+
<td class="govuk-table__cell">January</td>
|
129
|
+
|
130
|
+
<td class="govuk-table__cell govuk-table__cell--numeric">£85</td>
|
131
|
+
|
132
|
+
<td class="govuk-table__cell govuk-table__cell--numeric">£95</td>
|
133
|
+
|
134
|
+
</tr>
|
135
|
+
|
136
|
+
<tr class="govuk-table__row">
|
137
|
+
|
138
|
+
<td class="govuk-table__cell">February</td>
|
139
|
+
|
140
|
+
<td class="govuk-table__cell govuk-table__cell--numeric">£75</td>
|
141
|
+
|
142
|
+
<td class="govuk-table__cell govuk-table__cell--numeric">£55</td>
|
143
|
+
|
144
|
+
</tr>
|
145
|
+
|
146
|
+
<tr class="govuk-table__row">
|
147
|
+
|
148
|
+
<td class="govuk-table__cell">March</td>
|
149
|
+
|
150
|
+
<td class="govuk-table__cell govuk-table__cell--numeric">£165</td>
|
151
|
+
|
152
|
+
<td class="govuk-table__cell govuk-table__cell--numeric">£125</td>
|
153
|
+
|
154
|
+
</tr>
|
155
|
+
|
156
|
+
</tbody>
|
157
|
+
</table>
|
158
|
+
|
159
|
+
#### Macro
|
160
|
+
|
161
|
+
{% from 'table/macro.njk' import govukTable %}
|
162
|
+
|
163
|
+
{{ govukTable({
|
164
|
+
"head": [
|
165
|
+
{
|
166
|
+
"text": "Month you apply"
|
167
|
+
},
|
168
|
+
{
|
169
|
+
"text": "Rate for bicycles",
|
170
|
+
"format": "numeric"
|
171
|
+
},
|
172
|
+
{
|
173
|
+
"text": "Rate for vehicles",
|
174
|
+
"format": "numeric"
|
175
|
+
}
|
176
|
+
],
|
177
|
+
"rows": [
|
178
|
+
[
|
179
|
+
{
|
180
|
+
"text": "January"
|
181
|
+
},
|
182
|
+
{
|
183
|
+
"text": "£85",
|
184
|
+
"format": "numeric"
|
185
|
+
},
|
186
|
+
{
|
187
|
+
"text": "£95",
|
188
|
+
"format": "numeric"
|
189
|
+
}
|
190
|
+
],
|
191
|
+
[
|
192
|
+
{
|
193
|
+
"text": "February"
|
194
|
+
},
|
195
|
+
{
|
196
|
+
"text": "£75",
|
197
|
+
"format": "numeric"
|
198
|
+
},
|
199
|
+
{
|
200
|
+
"text": "£55",
|
201
|
+
"format": "numeric"
|
202
|
+
}
|
203
|
+
],
|
204
|
+
[
|
205
|
+
{
|
206
|
+
"text": "March"
|
207
|
+
},
|
208
|
+
{
|
209
|
+
"text": "£165",
|
210
|
+
"format": "numeric"
|
211
|
+
},
|
212
|
+
{
|
213
|
+
"text": "£125",
|
214
|
+
"format": "numeric"
|
215
|
+
}
|
216
|
+
]
|
217
|
+
]
|
218
|
+
}) }}
|
219
|
+
|
220
|
+
### Table--table-with-caption-and-head
|
221
|
+
|
222
|
+
[Preview the table--table-with-caption-and-head example](http://govuk-frontend-review.herokuapp.com/components/table/table-with-caption-and-head/preview)
|
223
|
+
|
224
|
+
#### Markup
|
225
|
+
|
226
|
+
<table class="govuk-table">
|
227
|
+
|
228
|
+
<caption class="govuk-table__caption govuk-heading-m">Caption 1 : Months and rates</caption>
|
229
|
+
|
230
|
+
<thead class="govuk-table__head">
|
231
|
+
<tr class="govuk-table__row">
|
232
|
+
|
233
|
+
<th class="govuk-table__header" scope="col">Month you apply</th>
|
234
|
+
|
235
|
+
<th class="govuk-table__header govuk-table__header--numeric" scope="col">Rate for bicycles</th>
|
236
|
+
|
237
|
+
<th class="govuk-table__header govuk-table__header--numeric" scope="col">Rate for vehicles</th>
|
238
|
+
|
239
|
+
</tr>
|
240
|
+
</thead>
|
241
|
+
|
242
|
+
<tbody class="govuk-table__body">
|
243
|
+
|
244
|
+
<tr class="govuk-table__row">
|
245
|
+
|
246
|
+
<th class="govuk-table__header" scope="row">January</th>
|
247
|
+
|
248
|
+
<td class="govuk-table__cell govuk-table__cell--numeric">£85</td>
|
249
|
+
|
250
|
+
<td class="govuk-table__cell govuk-table__cell--numeric">£95</td>
|
251
|
+
|
252
|
+
</tr>
|
253
|
+
|
254
|
+
<tr class="govuk-table__row">
|
255
|
+
|
256
|
+
<th class="govuk-table__header" scope="row">February</th>
|
257
|
+
|
258
|
+
<td class="govuk-table__cell govuk-table__cell--numeric">£75</td>
|
259
|
+
|
260
|
+
<td class="govuk-table__cell govuk-table__cell--numeric">£55</td>
|
261
|
+
|
262
|
+
</tr>
|
263
|
+
|
264
|
+
<tr class="govuk-table__row">
|
265
|
+
|
266
|
+
<th class="govuk-table__header" scope="row">March</th>
|
267
|
+
|
268
|
+
<td class="govuk-table__cell govuk-table__cell--numeric">£165</td>
|
269
|
+
|
270
|
+
<td class="govuk-table__cell govuk-table__cell--numeric">£125</td>
|
271
|
+
|
272
|
+
</tr>
|
273
|
+
|
274
|
+
</tbody>
|
275
|
+
</table>
|
276
|
+
|
277
|
+
#### Macro
|
278
|
+
|
279
|
+
{% from 'table/macro.njk' import govukTable %}
|
280
|
+
|
281
|
+
{{ govukTable({
|
282
|
+
"caption": "Caption 1 : Months and rates",
|
283
|
+
"captionClasses": "govuk-heading-m",
|
284
|
+
"firstCellIsHeader": true,
|
285
|
+
"head": [
|
286
|
+
{
|
287
|
+
"text": "Month you apply"
|
288
|
+
},
|
289
|
+
{
|
290
|
+
"text": "Rate for bicycles",
|
291
|
+
"format": "numeric"
|
292
|
+
},
|
293
|
+
{
|
294
|
+
"text": "Rate for vehicles",
|
295
|
+
"format": "numeric"
|
296
|
+
}
|
297
|
+
],
|
298
|
+
"rows": [
|
299
|
+
[
|
300
|
+
{
|
301
|
+
"text": "January"
|
302
|
+
},
|
303
|
+
{
|
304
|
+
"text": "£85",
|
305
|
+
"format": "numeric"
|
306
|
+
},
|
307
|
+
{
|
308
|
+
"text": "£95",
|
309
|
+
"format": "numeric"
|
310
|
+
}
|
311
|
+
],
|
312
|
+
[
|
313
|
+
{
|
314
|
+
"text": "February"
|
315
|
+
},
|
316
|
+
{
|
317
|
+
"text": "£75",
|
318
|
+
"format": "numeric"
|
319
|
+
},
|
320
|
+
{
|
321
|
+
"text": "£55",
|
322
|
+
"format": "numeric"
|
323
|
+
}
|
324
|
+
],
|
325
|
+
[
|
326
|
+
{
|
327
|
+
"text": "March"
|
328
|
+
},
|
329
|
+
{
|
330
|
+
"text": "£165",
|
331
|
+
"format": "numeric"
|
332
|
+
},
|
333
|
+
{
|
334
|
+
"text": "£125",
|
335
|
+
"format": "numeric"
|
336
|
+
}
|
337
|
+
]
|
338
|
+
]
|
339
|
+
}) }}
|
340
|
+
|
341
|
+
## Requirements
|
342
|
+
|
343
|
+
### Build tool configuration
|
344
|
+
|
345
|
+
When compiling the Sass files you'll need to define includePaths to reference the node_modules directory. Below is a sample configuration using gulp
|
346
|
+
|
347
|
+
.pipe(sass({
|
348
|
+
includePaths: 'node_modules/'
|
349
|
+
}))
|
350
|
+
|
351
|
+
### Static asset path configuration
|
352
|
+
|
353
|
+
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:
|
354
|
+
|
355
|
+
app.use('/assets', express.static(path.join(__dirname, '/node_modules/govuk-frontend/assets')))
|
356
|
+
|
357
|
+
## Component arguments
|
358
|
+
|
359
|
+
If you are using Nunjucks,then macros take the following arguments
|
360
|
+
|
361
|
+
**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).**
|
362
|
+
|
363
|
+
<table class="govuk-table">
|
364
|
+
|
365
|
+
<thead class="govuk-table__head">
|
366
|
+
|
367
|
+
<tr class="govuk-table__row">
|
368
|
+
|
369
|
+
<th class="govuk-table__header" scope="col">Name</th>
|
370
|
+
|
371
|
+
<th class="govuk-table__header" scope="col">format</th>
|
372
|
+
|
373
|
+
<th class="govuk-table__header" scope="col">Required</th>
|
374
|
+
|
375
|
+
<th class="govuk-table__header" scope="col">Description</th>
|
376
|
+
|
377
|
+
</tr>
|
378
|
+
|
379
|
+
</thead>
|
380
|
+
|
381
|
+
<tbody class="govuk-table__body">
|
382
|
+
|
383
|
+
<tr class="govuk-table__row">
|
384
|
+
|
385
|
+
<th class="govuk-table__header" scope="row">rows</th>
|
386
|
+
|
387
|
+
<td class="govuk-table__cell ">array</td>
|
388
|
+
|
389
|
+
<td class="govuk-table__cell ">Yes</td>
|
390
|
+
|
391
|
+
<td class="govuk-table__cell ">Array of table rows and cells.</td>
|
392
|
+
|
393
|
+
</tr>
|
394
|
+
|
395
|
+
<tr class="govuk-table__row">
|
396
|
+
|
397
|
+
<th class="govuk-table__header" scope="row">rows.[].text (or) rows.[].html</th>
|
398
|
+
|
399
|
+
<td class="govuk-table__cell ">string</td>
|
400
|
+
|
401
|
+
<td class="govuk-table__cell ">Yes</td>
|
402
|
+
|
403
|
+
<td class="govuk-table__cell ">Text or HTML for cells in table rows. If `html` is specified, the `text` argument will be ignored.</td>
|
404
|
+
|
405
|
+
</tr>
|
406
|
+
|
407
|
+
<tr class="govuk-table__row">
|
408
|
+
|
409
|
+
<th class="govuk-table__header" scope="row">rows.[].format</th>
|
410
|
+
|
411
|
+
<td class="govuk-table__cell ">string</td>
|
412
|
+
|
413
|
+
<td class="govuk-table__cell ">No</td>
|
414
|
+
|
415
|
+
<td class="govuk-table__cell ">Specify format of a cell. Currently we only use "numeric".</td>
|
416
|
+
|
417
|
+
</tr>
|
418
|
+
|
419
|
+
<tr class="govuk-table__row">
|
420
|
+
|
421
|
+
<th class="govuk-table__header" scope="row">rows.[].colspan</th>
|
422
|
+
|
423
|
+
<td class="govuk-table__cell ">number</td>
|
424
|
+
|
425
|
+
<td class="govuk-table__cell ">No</td>
|
426
|
+
|
427
|
+
<td class="govuk-table__cell ">Specify how many columns a cell extends.</td>
|
428
|
+
|
429
|
+
</tr>
|
430
|
+
|
431
|
+
<tr class="govuk-table__row">
|
432
|
+
|
433
|
+
<th class="govuk-table__header" scope="row">rows.[].rowspan</th>
|
434
|
+
|
435
|
+
<td class="govuk-table__cell ">number</td>
|
436
|
+
|
437
|
+
<td class="govuk-table__cell ">No</td>
|
438
|
+
|
439
|
+
<td class="govuk-table__cell ">Specify how many rows a cell extends.</td>
|
440
|
+
|
441
|
+
</tr>
|
442
|
+
|
443
|
+
<tr class="govuk-table__row">
|
444
|
+
|
445
|
+
<th class="govuk-table__header" scope="row">head</th>
|
446
|
+
|
447
|
+
<td class="govuk-table__cell ">array</td>
|
448
|
+
|
449
|
+
<td class="govuk-table__cell ">No</td>
|
450
|
+
|
451
|
+
<td class="govuk-table__cell ">Optional array of table head cells.</td>
|
452
|
+
|
453
|
+
</tr>
|
454
|
+
|
455
|
+
<tr class="govuk-table__row">
|
456
|
+
|
457
|
+
<th class="govuk-table__header" scope="row">head.[].text or head.[].html</th>
|
458
|
+
|
459
|
+
<td class="govuk-table__cell ">array</td>
|
460
|
+
|
461
|
+
<td class="govuk-table__cell ">No</td>
|
462
|
+
|
463
|
+
<td class="govuk-table__cell ">Optional array of table head cells. If `html` is specified, the `text` argument will be ignored.</td>
|
464
|
+
|
465
|
+
</tr>
|
466
|
+
|
467
|
+
<tr class="govuk-table__row">
|
468
|
+
|
469
|
+
<th class="govuk-table__header" scope="row">head.[].colspan</th>
|
470
|
+
|
471
|
+
<td class="govuk-table__cell ">number</td>
|
472
|
+
|
473
|
+
<td class="govuk-table__cell ">No</td>
|
474
|
+
|
475
|
+
<td class="govuk-table__cell ">Specify how many columns a cell extends.</td>
|
476
|
+
|
477
|
+
</tr>
|
478
|
+
|
479
|
+
<tr class="govuk-table__row">
|
480
|
+
|
481
|
+
<th class="govuk-table__header" scope="row">head.[].rowspan</th>
|
482
|
+
|
483
|
+
<td class="govuk-table__cell ">number</td>
|
484
|
+
|
485
|
+
<td class="govuk-table__cell ">No</td>
|
486
|
+
|
487
|
+
<td class="govuk-table__cell ">Specify how many rows a cell extends.</td>
|
488
|
+
|
489
|
+
</tr>
|
490
|
+
|
491
|
+
<tr class="govuk-table__row">
|
492
|
+
|
493
|
+
<th class="govuk-table__header" scope="row">head.[].format</th>
|
494
|
+
|
495
|
+
<td class="govuk-table__cell ">string</td>
|
496
|
+
|
497
|
+
<td class="govuk-table__cell ">No</td>
|
498
|
+
|
499
|
+
<td class="govuk-table__cell ">Specify format of a cell. Currently we only use "numeric".</td>
|
500
|
+
|
501
|
+
</tr>
|
502
|
+
|
503
|
+
<tr class="govuk-table__row">
|
504
|
+
|
505
|
+
<th class="govuk-table__header" scope="row">caption</th>
|
506
|
+
|
507
|
+
<td class="govuk-table__cell ">string</td>
|
508
|
+
|
509
|
+
<td class="govuk-table__cell ">No</td>
|
510
|
+
|
511
|
+
<td class="govuk-table__cell ">Optional caption text.</td>
|
512
|
+
|
513
|
+
</tr>
|
514
|
+
|
515
|
+
<tr class="govuk-table__row">
|
516
|
+
|
517
|
+
<th class="govuk-table__header" scope="row">captionClasses</th>
|
518
|
+
|
519
|
+
<td class="govuk-table__cell ">string</td>
|
520
|
+
|
521
|
+
<td class="govuk-table__cell ">No</td>
|
522
|
+
|
523
|
+
<td class="govuk-table__cell ">Optional classes for caption text size. Class should correspond to the available typography heading classes.</td>
|
524
|
+
|
525
|
+
</tr>
|
526
|
+
|
527
|
+
<tr class="govuk-table__row">
|
528
|
+
|
529
|
+
<th class="govuk-table__header" scope="row">firstCellIsHeader</th>
|
530
|
+
|
531
|
+
<td class="govuk-table__cell ">boolean</td>
|
532
|
+
|
533
|
+
<td class="govuk-table__cell ">No</td>
|
534
|
+
|
535
|
+
<td class="govuk-table__cell ">If set to true, first cell in table row will be a TH instead of a TD.</td>
|
536
|
+
|
537
|
+
</tr>
|
538
|
+
|
539
|
+
<tr class="govuk-table__row">
|
540
|
+
|
541
|
+
<th class="govuk-table__header" scope="row">classes</th>
|
542
|
+
|
543
|
+
<td class="govuk-table__cell ">string</td>
|
544
|
+
|
545
|
+
<td class="govuk-table__cell ">No</td>
|
546
|
+
|
547
|
+
<td class="govuk-table__cell ">Optional additional classes to add to the table container.</td>
|
548
|
+
|
549
|
+
</tr>
|
550
|
+
|
551
|
+
<tr class="govuk-table__row">
|
552
|
+
|
553
|
+
<th class="govuk-table__header" scope="row">attributes</th>
|
554
|
+
|
555
|
+
<td class="govuk-table__cell ">object</td>
|
556
|
+
|
557
|
+
<td class="govuk-table__cell ">No</td>
|
558
|
+
|
559
|
+
<td class="govuk-table__cell ">Any extra HTML attributes (for example data attributes) to add to the table container.</td>
|
560
|
+
|
561
|
+
</tr>
|
562
|
+
|
563
|
+
</tbody>
|
564
|
+
|
565
|
+
</table>
|
566
|
+
|
567
|
+
**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).**
|
568
|
+
|
569
|
+
### Setting up Nunjucks views and paths
|
570
|
+
|
571
|
+
Below is an example setup using express configure views:
|
572
|
+
|
573
|
+
nunjucks.configure('node_modules/govuk-frontend/components', {
|
574
|
+
autoescape: true,
|
575
|
+
cache: false,
|
576
|
+
express: app
|
577
|
+
})
|
578
|
+
|
579
|
+
## Contribution
|
580
|
+
|
581
|
+
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")
|
582
|
+
|
583
|
+
## License
|
584
|
+
|
585
|
+
MIT
|