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,29 @@
|
|
1
|
+
{#- If an id 'prefix' is not passed, fall back to using the name attribute
|
2
|
+
instead. We need this for error messages and hints as well -#}
|
3
|
+
{% set idPrefix = params.idPrefix if params.idPrefix %}
|
4
|
+
|
5
|
+
<div {%- if params.id %} id="{{params.id}}"{% endif %} class="govuk-tabs {%- if params.classes %} {{ params.classes }}{% endif %}" {%- for attribute, value in params.attributes %} {{attribute}}="{{value}}"{% endfor %} data-module="tabs">
|
6
|
+
<h2 class="govuk-tabs__title">
|
7
|
+
{{ params.title | default ("Contents") }}
|
8
|
+
</h2>
|
9
|
+
|
10
|
+
{% if(params.items) %}
|
11
|
+
<ul class="govuk-tabs__list">
|
12
|
+
{% for item in params.items %}
|
13
|
+
{% set id = item.id if item.id else idPrefix + "-" + loop.index %}
|
14
|
+
<li class="govuk-tabs__list-item">
|
15
|
+
<a class="govuk-tabs__tab" href="#{{ id }}">
|
16
|
+
{{ item.label }}
|
17
|
+
</a>
|
18
|
+
</li>
|
19
|
+
{% endfor %}
|
20
|
+
</ul>
|
21
|
+
{% endif %}
|
22
|
+
|
23
|
+
{% for item in params.items %}
|
24
|
+
{% set id = item.id if item.id else idPrefix + "-" + loop.index %}
|
25
|
+
<section class="govuk-tabs__panel" id="{{ id }}">
|
26
|
+
{{ item.panel.html | safe if item.panel.html else item.panel.text }}
|
27
|
+
</section>
|
28
|
+
{% endfor %}
|
29
|
+
</div>
|
@@ -0,0 +1,150 @@
|
|
1
|
+
# Tag
|
2
|
+
|
3
|
+
## Introduction
|
4
|
+
|
5
|
+
Phase tags are mostly used inside phase banners as an indication of the state of a project. It’s possible to use them outside phase banners, for example as part of a service header.
|
6
|
+
|
7
|
+
## Guidance
|
8
|
+
|
9
|
+
Find out when to use the Tag component in your service in the [GOV.UK Design System](https://govuk-design-system-production.cloudapps.digital/components/tag).
|
10
|
+
|
11
|
+
## Quick start examples
|
12
|
+
|
13
|
+
### Component default
|
14
|
+
|
15
|
+
[Preview the tag component](http://govuk-frontend-review.herokuapp.com/components/tag/preview)
|
16
|
+
|
17
|
+
#### Markup
|
18
|
+
|
19
|
+
<strong class="govuk-tag">
|
20
|
+
alpha
|
21
|
+
</strong>
|
22
|
+
|
23
|
+
#### Macro
|
24
|
+
|
25
|
+
{% from 'tag/macro.njk' import govukTag %}
|
26
|
+
|
27
|
+
{{ govukTag({
|
28
|
+
"text": "alpha"
|
29
|
+
}) }}
|
30
|
+
|
31
|
+
### Tag--inactive
|
32
|
+
|
33
|
+
[Preview the tag--inactive example](http://govuk-frontend-review.herokuapp.com/components/tag/inactive/preview)
|
34
|
+
|
35
|
+
#### Markup
|
36
|
+
|
37
|
+
<strong class="govuk-tag govuk-tag--inactive">
|
38
|
+
alpha
|
39
|
+
</strong>
|
40
|
+
|
41
|
+
#### Macro
|
42
|
+
|
43
|
+
{% from 'tag/macro.njk' import govukTag %}
|
44
|
+
|
45
|
+
{{ govukTag({
|
46
|
+
"text": "alpha",
|
47
|
+
"classes": "govuk-tag--inactive"
|
48
|
+
}) }}
|
49
|
+
|
50
|
+
## Requirements
|
51
|
+
|
52
|
+
### Build tool configuration
|
53
|
+
|
54
|
+
When compiling the Sass files you'll need to define includePaths to reference the node_modules directory. Below is a sample configuration using gulp
|
55
|
+
|
56
|
+
.pipe(sass({
|
57
|
+
includePaths: 'node_modules/'
|
58
|
+
}))
|
59
|
+
|
60
|
+
### Static asset path configuration
|
61
|
+
|
62
|
+
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:
|
63
|
+
|
64
|
+
app.use('/assets', express.static(path.join(__dirname, '/node_modules/govuk-frontend/assets')))
|
65
|
+
|
66
|
+
## Component arguments
|
67
|
+
|
68
|
+
If you are using Nunjucks,then macros take the following arguments
|
69
|
+
|
70
|
+
**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).**
|
71
|
+
|
72
|
+
<table class="govuk-table">
|
73
|
+
|
74
|
+
<thead class="govuk-table__head">
|
75
|
+
|
76
|
+
<tr class="govuk-table__row">
|
77
|
+
|
78
|
+
<th class="govuk-table__header" scope="col">Name</th>
|
79
|
+
|
80
|
+
<th class="govuk-table__header" scope="col">Type</th>
|
81
|
+
|
82
|
+
<th class="govuk-table__header" scope="col">Required</th>
|
83
|
+
|
84
|
+
<th class="govuk-table__header" scope="col">Description</th>
|
85
|
+
|
86
|
+
</tr>
|
87
|
+
|
88
|
+
</thead>
|
89
|
+
|
90
|
+
<tbody class="govuk-table__body">
|
91
|
+
|
92
|
+
<tr class="govuk-table__row">
|
93
|
+
|
94
|
+
<th class="govuk-table__header" scope="row">text (or) html</th>
|
95
|
+
|
96
|
+
<td class="govuk-table__cell ">string</td>
|
97
|
+
|
98
|
+
<td class="govuk-table__cell ">No</td>
|
99
|
+
|
100
|
+
<td class="govuk-table__cell ">Text or HTML to use within for the tag component. If `html` is provided, the `text` argument will be ignored.</td>
|
101
|
+
|
102
|
+
</tr>
|
103
|
+
|
104
|
+
<tr class="govuk-table__row">
|
105
|
+
|
106
|
+
<th class="govuk-table__header" scope="row">classes</th>
|
107
|
+
|
108
|
+
<td class="govuk-table__cell ">string</td>
|
109
|
+
|
110
|
+
<td class="govuk-table__cell ">No</td>
|
111
|
+
|
112
|
+
<td class="govuk-table__cell ">Optional additional classes to add to the tag container.</td>
|
113
|
+
|
114
|
+
</tr>
|
115
|
+
|
116
|
+
<tr class="govuk-table__row">
|
117
|
+
|
118
|
+
<th class="govuk-table__header" scope="row">attributes</th>
|
119
|
+
|
120
|
+
<td class="govuk-table__cell ">object</td>
|
121
|
+
|
122
|
+
<td class="govuk-table__cell ">No</td>
|
123
|
+
|
124
|
+
<td class="govuk-table__cell ">Any extra HTML attributes (for example data attributes) to add to the tag container.</td>
|
125
|
+
|
126
|
+
</tr>
|
127
|
+
|
128
|
+
</tbody>
|
129
|
+
|
130
|
+
</table>
|
131
|
+
|
132
|
+
**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).**
|
133
|
+
|
134
|
+
### Setting up Nunjucks views and paths
|
135
|
+
|
136
|
+
Below is an example setup using express configure views:
|
137
|
+
|
138
|
+
nunjucks.configure('node_modules/govuk-frontend/components', {
|
139
|
+
autoescape: true,
|
140
|
+
cache: false,
|
141
|
+
express: app
|
142
|
+
})
|
143
|
+
|
144
|
+
## Contribution
|
145
|
+
|
146
|
+
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")
|
147
|
+
|
148
|
+
## License
|
149
|
+
|
150
|
+
MIT
|
@@ -0,0 +1,23 @@
|
|
1
|
+
@import "../../settings/all";
|
2
|
+
@import "../../tools/all";
|
3
|
+
@import "../../helpers/all";
|
4
|
+
|
5
|
+
@include govuk-exports("govuk/component/tag") {
|
6
|
+
.govuk-tag {
|
7
|
+
@include govuk-font($size: 16, $weight: bold, $line-height: 1.25);
|
8
|
+
|
9
|
+
display: inline-block;
|
10
|
+
padding: govuk-spacing(1) 8px 0;
|
11
|
+
|
12
|
+
color: govuk-colour("white");
|
13
|
+
background-color: govuk-colour("blue");
|
14
|
+
letter-spacing: 1px;
|
15
|
+
|
16
|
+
text-decoration: none;
|
17
|
+
text-transform: uppercase;
|
18
|
+
}
|
19
|
+
|
20
|
+
.govuk-tag--inactive {
|
21
|
+
background-color: govuk-colour("grey-1");
|
22
|
+
}
|
23
|
+
}
|
@@ -0,0 +1,350 @@
|
|
1
|
+
# Textarea
|
2
|
+
|
3
|
+
## Introduction
|
4
|
+
|
5
|
+
A multi-line text field.
|
6
|
+
|
7
|
+
## Guidance
|
8
|
+
|
9
|
+
Find out when to use the Textarea component in your service in the [GOV.UK Design System](https://govuk-design-system-production.cloudapps.digital/components/textarea).
|
10
|
+
|
11
|
+
## Quick start examples
|
12
|
+
|
13
|
+
### Component default
|
14
|
+
|
15
|
+
[Preview the textarea component](http://govuk-frontend-review.herokuapp.com/components/textarea/preview)
|
16
|
+
|
17
|
+
#### Markup
|
18
|
+
|
19
|
+
<div class="govuk-form-group">
|
20
|
+
<label class="govuk-label" for="more-detail">
|
21
|
+
Can you provide more detail?
|
22
|
+
</label>
|
23
|
+
|
24
|
+
<span id="more-detail-hint" class="govuk-hint">
|
25
|
+
Don't include personal or financial information, eg your National Insurance number or credit card details.
|
26
|
+
</span>
|
27
|
+
|
28
|
+
<textarea class="govuk-textarea" id="more-detail" name="more-detail" rows="5" aria-describedby="more-detail-hint"></textarea>
|
29
|
+
</div>
|
30
|
+
|
31
|
+
#### Macro
|
32
|
+
|
33
|
+
{% from 'textarea/macro.njk' import govukTextarea %}
|
34
|
+
|
35
|
+
{{ govukTextarea({
|
36
|
+
"name": "more-detail",
|
37
|
+
"id": "more-detail",
|
38
|
+
"label": {
|
39
|
+
"text": "Can you provide more detail?"
|
40
|
+
},
|
41
|
+
"hint": {
|
42
|
+
"text": "Don't include personal or financial information, eg your National Insurance number or credit card details."
|
43
|
+
}
|
44
|
+
}) }}
|
45
|
+
|
46
|
+
### Textarea--with error message
|
47
|
+
|
48
|
+
[Preview the textarea--with error message example](http://govuk-frontend-review.herokuapp.com/components/textarea/with error message/preview)
|
49
|
+
|
50
|
+
#### Markup
|
51
|
+
|
52
|
+
<div class="govuk-form-group govuk-form-group--error">
|
53
|
+
<label class="govuk-label" for="no-ni-reason">
|
54
|
+
Why can't you provide a National Insurance number?
|
55
|
+
</label>
|
56
|
+
|
57
|
+
<span id="no-ni-reason-error" class="govuk-error-message">
|
58
|
+
You must provide an explanation
|
59
|
+
</span>
|
60
|
+
|
61
|
+
<textarea class="govuk-textarea govuk-textarea--error" id="no-ni-reason" name="no-ni-reason" rows="5" aria-describedby="no-ni-reason-error"></textarea>
|
62
|
+
</div>
|
63
|
+
|
64
|
+
#### Macro
|
65
|
+
|
66
|
+
{% from 'textarea/macro.njk' import govukTextarea %}
|
67
|
+
|
68
|
+
{{ govukTextarea({
|
69
|
+
"name": "no-ni-reason",
|
70
|
+
"id": "no-ni-reason",
|
71
|
+
"label": {
|
72
|
+
"text": "Why can't you provide a National Insurance number?"
|
73
|
+
},
|
74
|
+
"errorMessage": {
|
75
|
+
"text": "You must provide an explanation"
|
76
|
+
}
|
77
|
+
}) }}
|
78
|
+
|
79
|
+
### Textarea--with default value
|
80
|
+
|
81
|
+
[Preview the textarea--with default value example](http://govuk-frontend-review.herokuapp.com/components/textarea/with default value/preview)
|
82
|
+
|
83
|
+
#### Markup
|
84
|
+
|
85
|
+
<div class="govuk-form-group">
|
86
|
+
<label class="govuk-label" for="full-address">
|
87
|
+
Full address
|
88
|
+
</label>
|
89
|
+
|
90
|
+
<textarea class="govuk-textarea" id="full-address" name="address" rows="5">221B Baker Street
|
91
|
+
London
|
92
|
+
NW1 6XE
|
93
|
+
</textarea>
|
94
|
+
</div>
|
95
|
+
|
96
|
+
#### Macro
|
97
|
+
|
98
|
+
{% from 'textarea/macro.njk' import govukTextarea %}
|
99
|
+
|
100
|
+
{{ govukTextarea({
|
101
|
+
"id": "full-address",
|
102
|
+
"name": "address",
|
103
|
+
"value": "221B Baker Street\nLondon\nNW1 6XE\n",
|
104
|
+
"label": {
|
105
|
+
"text": "Full address"
|
106
|
+
}
|
107
|
+
}) }}
|
108
|
+
|
109
|
+
### Textarea--with custom rows
|
110
|
+
|
111
|
+
[Preview the textarea--with custom rows example](http://govuk-frontend-review.herokuapp.com/components/textarea/with custom rows/preview)
|
112
|
+
|
113
|
+
#### Markup
|
114
|
+
|
115
|
+
<div class="govuk-form-group">
|
116
|
+
<label class="govuk-label" for="full-address">
|
117
|
+
Full address
|
118
|
+
</label>
|
119
|
+
|
120
|
+
<textarea class="govuk-textarea" id="full-address" name="address" rows="8"></textarea>
|
121
|
+
</div>
|
122
|
+
|
123
|
+
#### Macro
|
124
|
+
|
125
|
+
{% from 'textarea/macro.njk' import govukTextarea %}
|
126
|
+
|
127
|
+
{{ govukTextarea({
|
128
|
+
"id": "full-address",
|
129
|
+
"name": "address",
|
130
|
+
"label": {
|
131
|
+
"text": "Full address"
|
132
|
+
},
|
133
|
+
"rows": 8
|
134
|
+
}) }}
|
135
|
+
|
136
|
+
### Textarea--with label as page heading
|
137
|
+
|
138
|
+
[Preview the textarea--with label as page heading example](http://govuk-frontend-review.herokuapp.com/components/textarea/with label as page heading/preview)
|
139
|
+
|
140
|
+
#### Markup
|
141
|
+
|
142
|
+
<div class="govuk-form-group">
|
143
|
+
<h1 class="govuk-label-wrapper">
|
144
|
+
<label class="govuk-label" for="textarea-with-page-heading">
|
145
|
+
Full address
|
146
|
+
</label>
|
147
|
+
|
148
|
+
</h1>
|
149
|
+
|
150
|
+
<textarea class="govuk-textarea" id="textarea-with-page-heading" name="address" rows="5"></textarea>
|
151
|
+
</div>
|
152
|
+
|
153
|
+
#### Macro
|
154
|
+
|
155
|
+
{% from 'textarea/macro.njk' import govukTextarea %}
|
156
|
+
|
157
|
+
{{ govukTextarea({
|
158
|
+
"id": "textarea-with-page-heading",
|
159
|
+
"name": "address",
|
160
|
+
"label": {
|
161
|
+
"text": "Full address",
|
162
|
+
"isPageHeading": true
|
163
|
+
}
|
164
|
+
}) }}
|
165
|
+
|
166
|
+
## Requirements
|
167
|
+
|
168
|
+
### Build tool configuration
|
169
|
+
|
170
|
+
When compiling the Sass files you'll need to define includePaths to reference the node_modules directory. Below is a sample configuration using gulp
|
171
|
+
|
172
|
+
.pipe(sass({
|
173
|
+
includePaths: 'node_modules/'
|
174
|
+
}))
|
175
|
+
|
176
|
+
### Static asset path configuration
|
177
|
+
|
178
|
+
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:
|
179
|
+
|
180
|
+
app.use('/assets', express.static(path.join(__dirname, '/node_modules/govuk-frontend/assets')))
|
181
|
+
|
182
|
+
## Component arguments
|
183
|
+
|
184
|
+
If you are using Nunjucks,then macros take the following arguments
|
185
|
+
|
186
|
+
**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).**
|
187
|
+
|
188
|
+
<table class="govuk-table">
|
189
|
+
|
190
|
+
<thead class="govuk-table__head">
|
191
|
+
|
192
|
+
<tr class="govuk-table__row">
|
193
|
+
|
194
|
+
<th class="govuk-table__header" scope="col">Name</th>
|
195
|
+
|
196
|
+
<th class="govuk-table__header" scope="col">Type</th>
|
197
|
+
|
198
|
+
<th class="govuk-table__header" scope="col">Required</th>
|
199
|
+
|
200
|
+
<th class="govuk-table__header" scope="col">Description</th>
|
201
|
+
|
202
|
+
</tr>
|
203
|
+
|
204
|
+
</thead>
|
205
|
+
|
206
|
+
<tbody class="govuk-table__body">
|
207
|
+
|
208
|
+
<tr class="govuk-table__row">
|
209
|
+
|
210
|
+
<th class="govuk-table__header" scope="row">id</th>
|
211
|
+
|
212
|
+
<td class="govuk-table__cell ">string</td>
|
213
|
+
|
214
|
+
<td class="govuk-table__cell ">Yes</td>
|
215
|
+
|
216
|
+
<td class="govuk-table__cell ">The id of the textarea</td>
|
217
|
+
|
218
|
+
</tr>
|
219
|
+
|
220
|
+
<tr class="govuk-table__row">
|
221
|
+
|
222
|
+
<th class="govuk-table__header" scope="row">describedBy</th>
|
223
|
+
|
224
|
+
<td class="govuk-table__cell ">string</td>
|
225
|
+
|
226
|
+
<td class="govuk-table__cell ">No</td>
|
227
|
+
|
228
|
+
<td class="govuk-table__cell ">Text or element id to add to the `aria-describedby` attribute to provide description for screenreader users.</td>
|
229
|
+
|
230
|
+
</tr>
|
231
|
+
|
232
|
+
<tr class="govuk-table__row">
|
233
|
+
|
234
|
+
<th class="govuk-table__header" scope="row">name</th>
|
235
|
+
|
236
|
+
<td class="govuk-table__cell ">string</td>
|
237
|
+
|
238
|
+
<td class="govuk-table__cell ">Yes</td>
|
239
|
+
|
240
|
+
<td class="govuk-table__cell ">The name of the textarea, which is submitted with the form data.</td>
|
241
|
+
|
242
|
+
</tr>
|
243
|
+
|
244
|
+
<tr class="govuk-table__row">
|
245
|
+
|
246
|
+
<th class="govuk-table__header" scope="row">rows</th>
|
247
|
+
|
248
|
+
<td class="govuk-table__cell ">string</td>
|
249
|
+
|
250
|
+
<td class="govuk-table__cell ">No</td>
|
251
|
+
|
252
|
+
<td class="govuk-table__cell ">Optional number of textarea rows (default is 5 rows).</td>
|
253
|
+
|
254
|
+
</tr>
|
255
|
+
|
256
|
+
<tr class="govuk-table__row">
|
257
|
+
|
258
|
+
<th class="govuk-table__header" scope="row">value</th>
|
259
|
+
|
260
|
+
<td class="govuk-table__cell ">string</td>
|
261
|
+
|
262
|
+
<td class="govuk-table__cell ">No</td>
|
263
|
+
|
264
|
+
<td class="govuk-table__cell ">Optional initial value of the textarea.</td>
|
265
|
+
|
266
|
+
</tr>
|
267
|
+
|
268
|
+
<tr class="govuk-table__row">
|
269
|
+
|
270
|
+
<th class="govuk-table__header" scope="row">label</th>
|
271
|
+
|
272
|
+
<td class="govuk-table__cell ">object</td>
|
273
|
+
|
274
|
+
<td class="govuk-table__cell ">Yes</td>
|
275
|
+
|
276
|
+
<td class="govuk-table__cell ">Arguments for the label component. See label component.</td>
|
277
|
+
|
278
|
+
</tr>
|
279
|
+
|
280
|
+
<tr class="govuk-table__row">
|
281
|
+
|
282
|
+
<th class="govuk-table__header" scope="row">hint</th>
|
283
|
+
|
284
|
+
<td class="govuk-table__cell ">object</td>
|
285
|
+
|
286
|
+
<td class="govuk-table__cell ">No</td>
|
287
|
+
|
288
|
+
<td class="govuk-table__cell ">Arguments for the hint component (e.g. text). See hint component.</td>
|
289
|
+
|
290
|
+
</tr>
|
291
|
+
|
292
|
+
<tr class="govuk-table__row">
|
293
|
+
|
294
|
+
<th class="govuk-table__header" scope="row">errorMessage</th>
|
295
|
+
|
296
|
+
<td class="govuk-table__cell ">object</td>
|
297
|
+
|
298
|
+
<td class="govuk-table__cell ">No</td>
|
299
|
+
|
300
|
+
<td class="govuk-table__cell ">Arguments for the errorMessage component (e.g. text). See errorMessage component.</td>
|
301
|
+
|
302
|
+
</tr>
|
303
|
+
|
304
|
+
<tr class="govuk-table__row">
|
305
|
+
|
306
|
+
<th class="govuk-table__header" scope="row">classes</th>
|
307
|
+
|
308
|
+
<td class="govuk-table__cell ">string</td>
|
309
|
+
|
310
|
+
<td class="govuk-table__cell ">No</td>
|
311
|
+
|
312
|
+
<td class="govuk-table__cell ">Optional additional classes to add to the textarea tag.</td>
|
313
|
+
|
314
|
+
</tr>
|
315
|
+
|
316
|
+
<tr class="govuk-table__row">
|
317
|
+
|
318
|
+
<th class="govuk-table__header" scope="row">attributes</th>
|
319
|
+
|
320
|
+
<td class="govuk-table__cell ">object</td>
|
321
|
+
|
322
|
+
<td class="govuk-table__cell ">No</td>
|
323
|
+
|
324
|
+
<td class="govuk-table__cell ">Any extra HTML attributes (for example data attributes) to add to the textarea tag.</td>
|
325
|
+
|
326
|
+
</tr>
|
327
|
+
|
328
|
+
</tbody>
|
329
|
+
|
330
|
+
</table>
|
331
|
+
|
332
|
+
**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).**
|
333
|
+
|
334
|
+
### Setting up Nunjucks views and paths
|
335
|
+
|
336
|
+
Below is an example setup using express configure views:
|
337
|
+
|
338
|
+
nunjucks.configure('node_modules/govuk-frontend/components', {
|
339
|
+
autoescape: true,
|
340
|
+
cache: false,
|
341
|
+
express: app
|
342
|
+
})
|
343
|
+
|
344
|
+
## Contribution
|
345
|
+
|
346
|
+
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")
|
347
|
+
|
348
|
+
## License
|
349
|
+
|
350
|
+
MIT
|