@ons/design-system 62.0.2 → 62.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -63
- package/components/access-code/example-access-code-error.njk +87 -0
- package/components/access-code/example-access-code.njk +63 -0
- package/components/accordion/example-accordion-open.njk +126 -0
- package/components/accordion/example-accordion.njk +25 -0
- package/components/address-input/example-address-input-editable.njk +52 -0
- package/components/address-input/example-address-input-manual.njk +23 -0
- package/components/address-input/example-address-input.njk +40 -0
- package/components/autosuggest/example-autosuggest-country-multiple.njk +30 -0
- package/components/autosuggest/example-autosuggest-country.njk +29 -0
- package/components/back-link/example-back-link.njk +17 -0
- package/components/breadcrumbs/example-breadcrumbs-single.njk +13 -0
- package/components/breadcrumbs/example-breadcrumbs.njk +17 -0
- package/components/button/example-button-custom.njk +20 -0
- package/components/button/example-button-disabled.njk +7 -0
- package/components/button/example-button-download.njk +9 -0
- package/components/button/example-button-ghost.njk +15 -0
- package/components/button/example-button-group.njk +16 -0
- package/components/button/example-button-link.njk +7 -0
- package/components/button/example-button-loader.njk +9 -0
- package/components/button/example-button-new-window.njk +12 -0
- package/components/button/example-button-print.njk +8 -0
- package/components/button/example-button-secondary-small.njk +8 -0
- package/components/button/example-button-secondary.njk +8 -0
- package/components/button/example-button-small.njk +8 -0
- package/components/button/example-button-timer.njk +9 -0
- package/components/button/example-button.njk +6 -0
- package/components/call-to-action/example-call-to-action-default.njk +14 -0
- package/components/card/example-card-set-with-images.njk +41 -0
- package/components/card/example-card-set-with-lists.njk +68 -0
- package/components/card/example-card-set.njk +38 -0
- package/components/card/example-card.njk +9 -0
- package/components/checkboxes/example-checkboxes-disabled.njk +34 -0
- package/components/checkboxes/example-checkboxes-error.njk +60 -0
- package/components/checkboxes/example-checkboxes-with-descriptions.njk +71 -0
- package/components/checkboxes/example-checkboxes-with-hidden-label.njk +177 -0
- package/components/checkboxes/example-checkboxes-with-revealed-checkboxes.njk +86 -0
- package/components/checkboxes/example-checkboxes-with-revealed-radios.njk +69 -0
- package/components/checkboxes/example-checkboxes-with-revealed-select.njk +71 -0
- package/components/checkboxes/example-checkboxes-with-revealed-text-input.njk +59 -0
- package/components/checkboxes/example-checkboxes-with-select-all-button.njk +51 -0
- package/components/checkboxes/example-checkboxes-with-visible-text-input.njk +61 -0
- package/components/checkboxes/example-checkboxes-without-border.njk +33 -0
- package/components/checkboxes/example-checkboxes.njk +46 -0
- package/components/content-pagination/example-content-pagination.njk +20 -0
- package/components/cookies-banner/_macro.njk +2 -2
- package/components/cookies-banner/_macro.spec.js +1 -1
- package/components/cookies-banner/example-cookies-banner-cymraeg.njk +9 -0
- package/components/cookies-banner/example-cookies-banner.njk +7 -0
- package/components/date-input/example-date-input-error.njk +62 -0
- package/components/date-input/example-date-input.njk +36 -0
- package/components/details/example-details-with-saved-state.njk +10 -0
- package/components/details/example-details-with-warning.njk +19 -0
- package/components/details/example-details.njk +9 -0
- package/components/document-list/example-document-list-article-featured.njk +31 -0
- package/components/document-list/example-document-list-articles.njk +60 -0
- package/components/document-list/example-document-list-downloads.njk +59 -0
- package/components/document-list/example-document-list-search-result-featured.njk +19 -0
- package/components/document-list/example-document-list-search-results.njk +67 -0
- package/components/duration/example-duration-error.njk +30 -0
- package/components/duration/example-duration.njk +35 -0
- package/components/duration/examples-duration-error-for-single-field.njk +31 -0
- package/components/external-link/example-external-link.njk +8 -0
- package/components/feedback/example-feedback-call-to-action.njk +14 -0
- package/components/footer/example-footer-cymraeg.njk +54 -0
- package/components/footer/example-footer-default.njk +7 -0
- package/components/footer/example-footer-transactional.njk +62 -0
- package/components/footer/example-footer-warning.njk +32 -0
- package/components/footer/example-footer-with-alternative-organisation.njk +124 -0
- package/components/footer/example-footer-with-coat-of-arms.njk +32 -0
- package/components/footer/example-footer-with-copyright.njk +35 -0
- package/components/footer/example-footer.njk +85 -0
- package/components/header/_header.scss +2 -2
- package/components/header/example-header-default.njk +12 -0
- package/components/header/example-header-external-for-survey-with-description.njk +20 -0
- package/components/header/example-header-external-for-surveys.njk +33 -0
- package/components/header/example-header-external-welsh.njk +29 -0
- package/components/header/example-header-external-with-navigation.njk +42 -0
- package/components/header/example-header-external-with-service-links.njk +35 -0
- package/components/header/example-header-external-with-sub-navigation.njk +132 -0
- package/components/header/example-header-internal.njk +32 -0
- package/components/header/example-header-neutral-for-multicoloured-logo.njk +59 -0
- package/components/hero/example-hero-dark.njk +15 -0
- package/components/hero/example-hero-default.njk +14 -0
- package/components/images/example-images-for-regular-screens.njk +8 -0
- package/components/images/example-images-for-retina-screens.njk +10 -0
- package/components/input/example-input-email.njk +12 -0
- package/components/input/example-input-number-prefixed.njk +17 -0
- package/components/input/example-input-number-suffixed.njk +34 -0
- package/components/input/example-input-number.njk +15 -0
- package/components/input/example-input-numeric-values.njk +64 -0
- package/components/input/example-input-telephone.njk +13 -0
- package/components/input/example-input-text-width-constrained.njk +11 -0
- package/components/input/example-input-text-with-character-limit-checker.njk +17 -0
- package/components/input/example-input-text-with-description.njk +10 -0
- package/components/input/example-input-text.njk +9 -0
- package/components/label/example-label-with-description.njk +8 -0
- package/components/label/example-label.njk +8 -0
- package/components/metadata/example-metadata.njk +57 -0
- package/components/mutually-exclusive/example-mutually-exclusive-checkboxes.njk +71 -0
- package/components/mutually-exclusive/example-mutually-exclusive-date-with-error.njk +47 -0
- package/components/mutually-exclusive/example-mutually-exclusive-date.njk +49 -0
- package/components/mutually-exclusive/example-mutually-exclusive-duration.njk +45 -0
- package/components/mutually-exclusive/example-mutually-exclusive-email.njk +36 -0
- package/components/mutually-exclusive/example-mutually-exclusive-multiple-options.njk +63 -0
- package/components/mutually-exclusive/example-mutually-exclusive-number.njk +43 -0
- package/components/mutually-exclusive/example-mutually-exclusive-textarea.njk +40 -0
- package/components/pagination/example-pagination-first.njk +24 -0
- package/components/pagination/example-pagination-last.njk +24 -0
- package/components/pagination/example-pagination-with-no-range-indicator.njk +42 -0
- package/components/pagination/example-pagination.njk +116 -0
- package/components/panel/example-panel-bare.njk +9 -0
- package/components/panel/example-panel-with-announcement.njk +18 -0
- package/components/panel/example-panel-with-error-details.njk +18 -0
- package/components/panel/example-panel-with-error-summary.njk +25 -0
- package/components/panel/example-panel-with-information.njk +7 -0
- package/components/panel/example-panel-with-spacious-information.njk +7 -0
- package/components/panel/example-panel-with-success-message.njk +10 -0
- package/components/panel/example-panel-with-warning.njk +8 -0
- package/components/password/example-password.njk +11 -0
- package/components/phase-banner/example-phase-banner-alpha.njk +10 -0
- package/components/phase-banner/example-phase-banner-beta.njk +9 -0
- package/components/question/example-question-ccs.njk +49 -0
- package/components/question/example-question-fieldset.njk +99 -0
- package/components/question/example-question-interviewer-note.njk +38 -0
- package/components/question/example-question-no-fieldset.njk +46 -0
- package/components/radios/example-radios-with-clear-button.njk +97 -0
- package/components/radios/example-radios-with-descriptions.njk +57 -0
- package/components/radios/example-radios-with-error.njk +38 -0
- package/components/radios/example-radios-with-revealed-checkboxes.njk +69 -0
- package/components/radios/example-radios-with-revealed-radios.njk +68 -0
- package/components/radios/example-radios-with-revealed-select.njk +69 -0
- package/components/radios/example-radios-with-revealed-text-input.njk +80 -0
- package/components/radios/example-radios-with-separator.njk +59 -0
- package/components/radios/example-radios-with-visible-text-input.njk +40 -0
- package/components/radios/example-radios-without-border.njk +48 -0
- package/components/radios/examples-radios.njk +38 -0
- package/components/related-content/example-related-content-general.njk +44 -0
- package/components/related-content/example-related-content-multiple-rows-of-links.njk +51 -0
- package/components/related-content/example-related-content-social-media.njk +40 -0
- package/components/relationships/example-relationships-error.njk +211 -0
- package/components/relationships/example-relationships-you.njk +187 -0
- package/components/relationships/example-relationships.njk +185 -0
- package/components/search/example-search-with-character-check.njk +23 -0
- package/components/search/example-search-with-placeholder.njk +16 -0
- package/components/search/example-search.njk +16 -0
- package/components/section-navigation/example-section-navigation-vertical.njk +40 -0
- package/components/section-navigation/example-section-navigation.njk +21 -0
- package/components/select/example-select-wide.njk +55 -0
- package/components/select/example-select-with-error.njk +58 -0
- package/components/select/example-select-with-inline-label.njk +23 -0
- package/components/select/example-select.njk +50 -0
- package/components/share-page/example-share-page.njk +11 -0
- package/components/skip-to-content/example-skip-to-content.njk +10 -0
- package/components/status/example-status-dead.njk +7 -0
- package/components/status/example-status-error.njk +7 -0
- package/components/status/example-status-neutral-information.njk +6 -0
- package/components/status/example-status-pending.njk +7 -0
- package/components/status/example-status-small.njk +8 -0
- package/components/status/example-status-success.njk +7 -0
- package/components/summary/example-summary-grouped-total.njk +67 -0
- package/components/summary/example-summary-grouped-with-errors.njk +96 -0
- package/components/summary/example-summary-grouped.njk +353 -0
- package/components/summary/example-summary-household-no-rows.njk +20 -0
- package/components/summary/example-summary-household.njk +77 -0
- package/components/summary/example-summary-hub.njk +170 -0
- package/components/summary/example-summary-multiple.njk +81 -0
- package/components/summary/example-summary-no-action.njk +40 -0
- package/components/summary/example-summary.njk +107 -0
- package/components/table/example-table-basic.njk +47 -0
- package/components/table/example-table-compact.njk +73 -0
- package/components/table/example-table-footer.njk +56 -0
- package/components/table/example-table-numeric.njk +81 -0
- package/components/table/example-table-responsive.njk +89 -0
- package/components/table/example-table-scrollable.njk +158 -0
- package/components/table/example-table-sortable.njk +236 -0
- package/components/table-of-contents/example-table-of-contents-grouped.njk +50 -0
- package/components/table-of-contents/example-table-of-contents-single.njk +39 -0
- package/components/table-of-contents/example-table-of-contents-sticky.njk +78 -0
- package/components/tabs/example-tabs-details.njk +59 -0
- package/components/tabs/example-tabs.njk +39 -0
- package/components/textarea/example-textarea-error.njk +16 -0
- package/components/textarea/example-textarea-with-character-limit.njk +18 -0
- package/components/textarea/example-textarea.njk +12 -0
- package/components/timeline/example-timeline.njk +35 -0
- package/components/timeout-modal/example-timeout-modal.njk +16 -0
- package/components/timeout-panel/example-panel-with-timeout-warning.njk +13 -0
- package/components/upload/example-upload-error.njk +16 -0
- package/components/upload/example-upload.njk +12 -0
- package/components/video/example-video.njk +14 -0
- package/css/main.css +3 -3
- package/css/print.css +1 -1
- package/layout/_template.njk +1 -12
- package/package.json +3 -8
- package/scss/base/_typography.scss +2 -2
- package/scss/main.scss +0 -1
- package/scss/print.scss +13 -5
- package/scss/utilities/_highlight.scss +6 -0
- package/scss/utilities/_index.scss +1 -0
- package/components/code-highlight/_macro.njk +0 -5
- package/components/code-highlight/_macro.spec.js +0 -56
- package/components/code-highlight/code-highlight.spec.js +0 -18
- package/scss/patternlib.scss +0 -148
package/README.md
CHANGED
|
@@ -43,65 +43,6 @@ yarn start
|
|
|
43
43
|
|
|
44
44
|
Once the server has started, navigate to <http://localhost:3030>
|
|
45
45
|
|
|
46
|
-
## Mixed Markdown/Nunjucks syntax in .njk pages
|
|
47
|
-
|
|
48
|
-
The design system documentation is authored with files that contain a mix of Markdown and Nunjucks syntax. These files begin with frontmatter and then contain Markdown syntax; for example:
|
|
49
|
-
|
|
50
|
-
```markdown
|
|
51
|
-
---
|
|
52
|
-
title: Foo
|
|
53
|
-
---
|
|
54
|
-
|
|
55
|
-
## Some section
|
|
56
|
-
|
|
57
|
-
A simple paragraph of _markdown_.
|
|
58
|
-
```
|
|
59
|
-
|
|
60
|
-
Simple Nunjucks placeholders/variables can be added into these files without any special syntax; for example:
|
|
61
|
-
|
|
62
|
-
```markdown
|
|
63
|
-
A paragraph of _markdown_ with some template value {{ foo.bar }}.
|
|
64
|
-
|
|
65
|
-
{{
|
|
66
|
-
patternlibExample({"path": "components/foo/examples/foo/index.njk"})
|
|
67
|
-
}}
|
|
68
|
-
```
|
|
69
|
-
|
|
70
|
-
For the most part no special syntax is needed when mixing Nunjucks templating into the markdown syntax. If syntax contains nested character sequence `}}` then it must be wrapped within `+++` fences. The `{% ... %}` syntax must also be wrapped within `+++` fences. This applies for things like imports, calling macros, defining blocks, etc:
|
|
71
|
-
|
|
72
|
-
```markdown
|
|
73
|
-
+++
|
|
74
|
-
{% from "views/partials/example/_macro.njk" import patternlibExample %}
|
|
75
|
-
{% from "components/external-link/_macro.njk" import onsExternalLink %}
|
|
76
|
-
+++
|
|
77
|
-
```
|
|
78
|
-
|
|
79
|
-
As a rule of thumb; code highlight blocks should always be wrapped with `+++` fences:
|
|
80
|
-
|
|
81
|
-
```markdown
|
|
82
|
-
+++
|
|
83
|
-
{% from "components/code-highlight/_macro.njk" import onsCodeHighlight %}
|
|
84
|
-
{{ onsCodeHighlight({
|
|
85
|
-
"code": '[
|
|
86
|
-
{
|
|
87
|
-
"en": "England"
|
|
88
|
-
},
|
|
89
|
-
{
|
|
90
|
-
"en": "Wales"
|
|
91
|
-
},
|
|
92
|
-
{
|
|
93
|
-
"en": "Scotland"
|
|
94
|
-
},
|
|
95
|
-
{
|
|
96
|
-
"en": "Northern Ireland"
|
|
97
|
-
},
|
|
98
|
-
]'
|
|
99
|
-
}) }}
|
|
100
|
-
+++
|
|
101
|
-
```
|
|
102
|
-
|
|
103
|
-
Mixed markdown files are easier to maintain when each section that is fenced with `+++` is a standalone unit. For example, each code example should have it's own `+++` fence even if they immediately follow one another. This is because content can be edited around these fenced units.
|
|
104
|
-
|
|
105
46
|
## Testing
|
|
106
47
|
|
|
107
48
|
This project uses [jest](https://jestjs.io/docs/cli) and supports its command line options.
|
|
@@ -158,10 +99,6 @@ It is sometimes useful to adjust the following settings when writing tests or di
|
|
|
158
99
|
|
|
159
100
|
- `testTimeout` in 'jest.config.js' - set to a high value such as `1000000` to prevent tests from timing out when doing the above.
|
|
160
101
|
|
|
161
|
-
## Run visual regression tests
|
|
162
|
-
|
|
163
|
-
To run visual regression (VR) tests on pull requests using our VR testing tool [percy.io](https://percy.io) you must include `[test-visual]` in your commit message e.g. `git commit -m "Update button border width [test-visual]"`. This prevents unnecessary builds and saves the limited quota we have available.
|
|
164
|
-
|
|
165
102
|
## Build
|
|
166
103
|
|
|
167
104
|
Generate a build into `./build`.
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Example: Access code error"
|
|
3
|
+
layout: ~
|
|
4
|
+
---
|
|
5
|
+
{% extends "layout/_template.njk" %}
|
|
6
|
+
{% from "components/access-code/_macro.njk" import onsUACInput %}
|
|
7
|
+
{% from "components/button/_macro.njk" import onsButton %}
|
|
8
|
+
{% from "components/panel/_macro.njk" import onsPanel %}
|
|
9
|
+
{% from "components/details/_macro.njk" import onsDetails %}
|
|
10
|
+
|
|
11
|
+
{% set pageConfig = {
|
|
12
|
+
"title": "Study title"
|
|
13
|
+
} %}
|
|
14
|
+
|
|
15
|
+
{% block main %}
|
|
16
|
+
{% call
|
|
17
|
+
onsPanel({
|
|
18
|
+
title: "There is a problem with this page",
|
|
19
|
+
type: "error"
|
|
20
|
+
})
|
|
21
|
+
%}
|
|
22
|
+
|
|
23
|
+
{% from "components/lists/_macro.njk" import onsList %}
|
|
24
|
+
{{
|
|
25
|
+
onsList({
|
|
26
|
+
"element": "ol",
|
|
27
|
+
"itemsList": [
|
|
28
|
+
{
|
|
29
|
+
"text": "Enter an access code",
|
|
30
|
+
"url": "#uac-error",
|
|
31
|
+
"variants": "inPageLink"
|
|
32
|
+
}
|
|
33
|
+
]
|
|
34
|
+
})
|
|
35
|
+
}}
|
|
36
|
+
{% endcall %}
|
|
37
|
+
|
|
38
|
+
<h1 class="ons-u-mt-l">Start study</h1>
|
|
39
|
+
|
|
40
|
+
{{ onsUACInput({
|
|
41
|
+
"id": "uac",
|
|
42
|
+
"name": "uac",
|
|
43
|
+
"postTextboxLinkText": "Where to find your access code",
|
|
44
|
+
"postTextboxLinkUrl": "#0",
|
|
45
|
+
"label": {
|
|
46
|
+
"text": "Enter your 16-character access code",
|
|
47
|
+
"description": "Keep this code safe. You will need to enter it every time you access your survey"
|
|
48
|
+
},
|
|
49
|
+
"securityMessage": "Your personal information is protected by law and will be kept confidential",
|
|
50
|
+
"error": {
|
|
51
|
+
"id": "uac-error",
|
|
52
|
+
"text": "Enter an access code"
|
|
53
|
+
}
|
|
54
|
+
}) }}
|
|
55
|
+
|
|
56
|
+
{{ onsButton({
|
|
57
|
+
"text": "Access study",
|
|
58
|
+
"classes": "ons-u-mb-xl"
|
|
59
|
+
}) }}
|
|
60
|
+
|
|
61
|
+
<h2>If you don’t have an access code</h2>
|
|
62
|
+
<p>
|
|
63
|
+
You can <a href="#0">request a new access code</a> to start a new study if you have lost or not received an access code. This can be sent to you by text or post.
|
|
64
|
+
</p>
|
|
65
|
+
|
|
66
|
+
{% set content %}
|
|
67
|
+
<p>If you need to answer separately from the people you live with, you can <a href='#0'>request an individual access code</a> to start a separate study.</p>
|
|
68
|
+
{% call onsPanel({
|
|
69
|
+
"type": "warn"
|
|
70
|
+
})
|
|
71
|
+
%}
|
|
72
|
+
Someone in your household must still complete a study using a household access code
|
|
73
|
+
{% endcall %}
|
|
74
|
+
{% endset %}
|
|
75
|
+
|
|
76
|
+
{% call onsDetails({
|
|
77
|
+
"id": "details",
|
|
78
|
+
"title": "Need to answer separately from your household?",
|
|
79
|
+
"button": {
|
|
80
|
+
"close": "Hide this",
|
|
81
|
+
"contextSuffix": "content"
|
|
82
|
+
}
|
|
83
|
+
})
|
|
84
|
+
%}
|
|
85
|
+
{{ content | safe }}
|
|
86
|
+
{% endcall %}
|
|
87
|
+
{% endblock %}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Example: Access code"
|
|
3
|
+
layout: ~
|
|
4
|
+
---
|
|
5
|
+
{% extends "layout/_template.njk" %}
|
|
6
|
+
{% from "components/access-code/_macro.njk" import onsUACInput %}
|
|
7
|
+
{% from "components/button/_macro.njk" import onsButton %}
|
|
8
|
+
{% from "components/panel/_macro.njk" import onsPanel %}
|
|
9
|
+
{% from "components/details/_macro.njk" import onsDetails %}
|
|
10
|
+
|
|
11
|
+
{% set pageConfig = {
|
|
12
|
+
"header": {
|
|
13
|
+
"title": "Study title"
|
|
14
|
+
}
|
|
15
|
+
} %}
|
|
16
|
+
|
|
17
|
+
{% block main %}
|
|
18
|
+
<h1 class="ons-u-mt-l">Start study</h1>
|
|
19
|
+
|
|
20
|
+
{{ onsUACInput({
|
|
21
|
+
"id": "uac",
|
|
22
|
+
"name": "uac",
|
|
23
|
+
"postTextboxLinkText": "Where to find your access code",
|
|
24
|
+
"postTextboxLinkUrl": "#0",
|
|
25
|
+
"label": {
|
|
26
|
+
"text": "Enter your 16-character access code",
|
|
27
|
+
"description": "Keep this code safe. You will need to enter it every time you access your study"
|
|
28
|
+
},
|
|
29
|
+
"securityMessage": "Your personal information is protected by law and will be kept confidential"
|
|
30
|
+
}) }}
|
|
31
|
+
|
|
32
|
+
{{ onsButton({
|
|
33
|
+
"text": "Access study",
|
|
34
|
+
"classes": "ons-u-mb-xl"
|
|
35
|
+
}) }}
|
|
36
|
+
|
|
37
|
+
<h2>If you don’t have an access code</h2>
|
|
38
|
+
<p>
|
|
39
|
+
You can <a href="#0">request a new access code</a> to start a new study if you have lost or not received an access code. This can be sent to you by text or post.
|
|
40
|
+
</p>
|
|
41
|
+
|
|
42
|
+
{% set content %}
|
|
43
|
+
<p>If you need to answer separately from the people you live with, you can <a href='#0'>request an individual access code</a> to start a separate study.</p>
|
|
44
|
+
{% call onsPanel({
|
|
45
|
+
type: "warn"
|
|
46
|
+
})
|
|
47
|
+
%}
|
|
48
|
+
Someone in your household must still complete a study using a household access code
|
|
49
|
+
{% endcall %}
|
|
50
|
+
{% endset %}
|
|
51
|
+
|
|
52
|
+
{% call onsDetails({
|
|
53
|
+
id: "details",
|
|
54
|
+
title: "Need to answer separately from your household?",
|
|
55
|
+
button: {
|
|
56
|
+
"close": "Hide this",
|
|
57
|
+
"contextSuffix": "content"
|
|
58
|
+
}
|
|
59
|
+
})
|
|
60
|
+
%}
|
|
61
|
+
{{ content | safe }}
|
|
62
|
+
{% endcall %}
|
|
63
|
+
{% endblock %}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
{% from "components/accordion/_macro.njk" import onsAccordion %}
|
|
2
|
+
{% from "components/checkboxes/_macro.njk" import onsCheckboxes %}
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
{% set content1 %}
|
|
6
|
+
{{
|
|
7
|
+
onsCheckboxes({
|
|
8
|
+
"checkboxesLabel": "Show only:",
|
|
9
|
+
"legend": "Content type",
|
|
10
|
+
"legendClasses": "ons-u-vh",
|
|
11
|
+
"classes": "ons-u-mb-s",
|
|
12
|
+
"borderless": true,
|
|
13
|
+
"name": "dietary",
|
|
14
|
+
"checkboxes": [
|
|
15
|
+
{
|
|
16
|
+
"id": "data",
|
|
17
|
+
"label": {
|
|
18
|
+
"text": "Data (309)"
|
|
19
|
+
},
|
|
20
|
+
"value": "data"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"id": "publications",
|
|
24
|
+
"label": {
|
|
25
|
+
"text": "Publications (137)"
|
|
26
|
+
},
|
|
27
|
+
"value": "publications",
|
|
28
|
+
"other": {
|
|
29
|
+
"otherType": "checkboxes",
|
|
30
|
+
"selectAllChildren": true,
|
|
31
|
+
"legend": "Publication type",
|
|
32
|
+
"legendClasses": "ons-u-vh",
|
|
33
|
+
"name": "name",
|
|
34
|
+
"checkboxes": [
|
|
35
|
+
{
|
|
36
|
+
"id": "datasets",
|
|
37
|
+
"label": {
|
|
38
|
+
"text": "Datasets (100)"
|
|
39
|
+
},
|
|
40
|
+
"value": "datasets"
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"id": "timeseries",
|
|
44
|
+
"label": {
|
|
45
|
+
"text": "Timeseries (20)"
|
|
46
|
+
},
|
|
47
|
+
"value": "timeseries"
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"id": "requested",
|
|
51
|
+
"label": {
|
|
52
|
+
"text": "User requested data (16)"
|
|
53
|
+
},
|
|
54
|
+
"value": "requested"
|
|
55
|
+
}
|
|
56
|
+
]
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"id": "areas",
|
|
61
|
+
"label": {
|
|
62
|
+
"text": "Areas (0)"
|
|
63
|
+
},
|
|
64
|
+
"value": "areas"
|
|
65
|
+
}
|
|
66
|
+
]
|
|
67
|
+
})
|
|
68
|
+
}}
|
|
69
|
+
{% endset %}
|
|
70
|
+
{% set content2 %}
|
|
71
|
+
{{
|
|
72
|
+
onsCheckboxes({
|
|
73
|
+
"checkboxesLabel": "Show only:",
|
|
74
|
+
"legend": "Topic",
|
|
75
|
+
"legendClasses": "ons-u-vh",
|
|
76
|
+
"classes": "ons-u-mb-s",
|
|
77
|
+
"borderless": true,
|
|
78
|
+
"name": "dietary",
|
|
79
|
+
"checkboxes": [
|
|
80
|
+
{
|
|
81
|
+
"id": "crime",
|
|
82
|
+
"label": {
|
|
83
|
+
"text": "Crime (200)"
|
|
84
|
+
},
|
|
85
|
+
"value": "crime",
|
|
86
|
+
"checked": true
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
"id": "education",
|
|
90
|
+
"label": {
|
|
91
|
+
"text": "Education (55)"
|
|
92
|
+
},
|
|
93
|
+
"value": "education"
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
"id": "disability",
|
|
97
|
+
"label": {
|
|
98
|
+
"text": "Disability (67)"
|
|
99
|
+
},
|
|
100
|
+
"value": "disability"
|
|
101
|
+
}
|
|
102
|
+
]
|
|
103
|
+
})
|
|
104
|
+
}}
|
|
105
|
+
{% endset %}
|
|
106
|
+
|
|
107
|
+
<div class="ons-grid">
|
|
108
|
+
<div class="ons-grid__col ons-col-3@xs">
|
|
109
|
+
{{
|
|
110
|
+
onsAccordion({
|
|
111
|
+
"id": "accordion",
|
|
112
|
+
"open": true,
|
|
113
|
+
"itemsList": [
|
|
114
|
+
{
|
|
115
|
+
"title": "Content type",
|
|
116
|
+
"content": content1
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
"title": "Topic",
|
|
120
|
+
"content": content2
|
|
121
|
+
}
|
|
122
|
+
]
|
|
123
|
+
})
|
|
124
|
+
}}
|
|
125
|
+
</div>
|
|
126
|
+
</div>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{% from "components/accordion/_macro.njk" import onsAccordion %}
|
|
2
|
+
|
|
3
|
+
{{
|
|
4
|
+
onsAccordion({
|
|
5
|
+
"id": "accordion",
|
|
6
|
+
"allButton": {
|
|
7
|
+
"open": "Show all",
|
|
8
|
+
"close": "Hide all"
|
|
9
|
+
},
|
|
10
|
+
"itemsList": [
|
|
11
|
+
{
|
|
12
|
+
"title": "Total retail turnover",
|
|
13
|
+
"content": "<h3 class=\"ons-u-fs-r\">Include:</h3><ul class=\"ons-list\"><li class=\"ons-list__item\">VAT</li><li class=\"ons-list__item\">internet sales</li><li class=\"ons-list__item\">retail sales from outlets in Great Britain to <a href=\"#\">customers abroad</a></li></ul><h3 class=\"ons-u-fs-r\">Exclude:</h3><ul class=\"ons-list\"><li class=\"ons-list__item\">revenue from mobile phone network commission and top-up</li><li class=\"ons-list__item\">sales from catering facilities used by customers</li><li class=\"ons-list__item\">lottery sales and commission from lottery sales</li><li class=\"ons-list__item\">sales of car accessories and motor vehicles</li><li class=\"ons-list__item\">NHS receipts</li><li class=\"ons-list__item\">automotive fuel</li></ul>"
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
"title": "Food sales",
|
|
17
|
+
"content": "<h3 class=\"ons-u-fs-r\">Include:</h3><ul class=\"ons-list\"><li class=\"ons-list__item\">all fresh food</li><li class=\"ons-list__item\">other food for human consumption (except chocolate and sugar confectionery)</li><li class=\"ons-list__item\">soft drinks</li></ul><h3 class=\"ons-u-fs-r\">Exclude:</h3><ul class=\"ons-list\"><li class=\"ons-list__item\">sales from catering facilities used by customers</li></ul>"
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"title": "Alcohol, confectionery, soft drinks and tobacco sales",
|
|
21
|
+
"content": "<h3 class=\"ons-u-fs-r\">Include:</h3><ul class=\"ons-list\"><li class=\"ons-list__item\">chocolate and sugar confectionery</li><li class=\"ons-list__item\">tobacco and smokers’ requisites</li></ul>"
|
|
22
|
+
}
|
|
23
|
+
]
|
|
24
|
+
})
|
|
25
|
+
}}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
{% from "components/address-input/_macro.njk" import onsAddressInput %}
|
|
2
|
+
|
|
3
|
+
{{ onsAddressInput({
|
|
4
|
+
"id": "address",
|
|
5
|
+
"dontWrap": true,
|
|
6
|
+
"label": {
|
|
7
|
+
"text": "Enter address or postcode and select from results",
|
|
8
|
+
"id": "address-label"
|
|
9
|
+
},
|
|
10
|
+
"isEditable": true,
|
|
11
|
+
"mandatory": true,
|
|
12
|
+
"APIDomain": "#",
|
|
13
|
+
'APIDomainBearerToken': "some_token",
|
|
14
|
+
"instructions": "Use up and down keys to navigate suggestions once you\'ve typed more than two characters. Use the enter key to select a suggestion. Touch device users, explore by touch or with swipe gestures.",
|
|
15
|
+
"ariaYouHaveSelected": "You have selected",
|
|
16
|
+
"ariaMinChars": "Enter 3 or more characters for suggestions.",
|
|
17
|
+
"ariaOneResult": "There is one suggestion available.",
|
|
18
|
+
"ariaNResults": "There are {n} suggestions available.",
|
|
19
|
+
"ariaLimitedResults": "Results have been limited to 10 suggestions. Type more characters to improve your search",
|
|
20
|
+
"ariaGroupedResults": "There are {n} for {x}",
|
|
21
|
+
"groupCount": "{n} addresses",
|
|
22
|
+
"moreResults": "Enter more of the address to improve results",
|
|
23
|
+
"resultsTitle": "Select an address",
|
|
24
|
+
"resultsTitleId": "address-results",
|
|
25
|
+
"noResults": "No results found. Try entering a different part of the address",
|
|
26
|
+
"tooManyResults": "{n} results found. Enter more of the address to improve results",
|
|
27
|
+
"typeMore": "Enter more of the address to get results",
|
|
28
|
+
"autocomplete": "off",
|
|
29
|
+
"errorTitle": "There is a problem with your answer",
|
|
30
|
+
"errorMessageEnter": "Enter an address",
|
|
31
|
+
"errorMessageSelect": "Select an address",
|
|
32
|
+
"errorMessageAPI": "Sorry, there is a problem loading addresses.",
|
|
33
|
+
"errorMessageAPILinkText": "Enter address manually",
|
|
34
|
+
"options": {
|
|
35
|
+
"regionCode": "gb-eng",
|
|
36
|
+
"addressType": "residential"
|
|
37
|
+
},
|
|
38
|
+
"line1": {
|
|
39
|
+
"label": "Address line 1"
|
|
40
|
+
},
|
|
41
|
+
"line2": {
|
|
42
|
+
"label": "Address line 2"
|
|
43
|
+
},
|
|
44
|
+
"town": {
|
|
45
|
+
"label": "Town or city"
|
|
46
|
+
},
|
|
47
|
+
"postcode": {
|
|
48
|
+
"label": "Postcode"
|
|
49
|
+
},
|
|
50
|
+
"searchButton": "Search for an address",
|
|
51
|
+
"manualLinkText": "Manually enter address"
|
|
52
|
+
}) }}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{% from "components/address-input/_macro.njk" import onsAddressInput %}
|
|
2
|
+
|
|
3
|
+
{{ onsAddressInput({
|
|
4
|
+
"id": "address",
|
|
5
|
+
"dontWrap": true,
|
|
6
|
+
"manualEntry": true,
|
|
7
|
+
"label": {
|
|
8
|
+
"text": "Enter address or postcode and select from results",
|
|
9
|
+
"id": "address-label"
|
|
10
|
+
},
|
|
11
|
+
"line1": {
|
|
12
|
+
"label": "Address line 1"
|
|
13
|
+
},
|
|
14
|
+
"line2": {
|
|
15
|
+
"label": "Address line 2"
|
|
16
|
+
},
|
|
17
|
+
"town": {
|
|
18
|
+
"label": "Town or city"
|
|
19
|
+
},
|
|
20
|
+
"postcode": {
|
|
21
|
+
"label": "Postcode"
|
|
22
|
+
}
|
|
23
|
+
}) }}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
{% from "components/address-input/_macro.njk" import onsAddressInput %}
|
|
2
|
+
|
|
3
|
+
{{ onsAddressInput({
|
|
4
|
+
"id": "address",
|
|
5
|
+
"dontWrap": true,
|
|
6
|
+
"label": {
|
|
7
|
+
"text": "Enter address or postcode and select from results",
|
|
8
|
+
"id": "address-label"
|
|
9
|
+
},
|
|
10
|
+
"isEditable": false,
|
|
11
|
+
"mandatory": true,
|
|
12
|
+
"externalInitialiser": true,
|
|
13
|
+
"autocomplete": "off",
|
|
14
|
+
"APIDomain": "#",
|
|
15
|
+
'APIDomainBearerToken': "some_token",
|
|
16
|
+
"instructions": "Use up and down keys to navigate suggestions once you\'ve typed more than two characters. Use the enter key to select a suggestion. Touch device users, explore by touch or with swipe gestures.",
|
|
17
|
+
"ariaYouHaveSelected": "You have selected",
|
|
18
|
+
"ariaMinChars": "Enter 3 or more characters for suggestions.",
|
|
19
|
+
"ariaOneResult": "There is one suggestion available.",
|
|
20
|
+
"ariaNResults": "There are {n} suggestions available.",
|
|
21
|
+
"ariaLimitedResults": "Results have been limited to 10 suggestions. Type more characters to improve your search",
|
|
22
|
+
"ariaGroupedResults": "There are {n} for {x}",
|
|
23
|
+
"groupCount": "{n} addresses",
|
|
24
|
+
"moreResults": "Enter more of the address to improve results",
|
|
25
|
+
"resultsTitle": "Select an address",
|
|
26
|
+
"resultsTitleId": "address-results",
|
|
27
|
+
"noResults": "No results found. Try entering a different part of the address",
|
|
28
|
+
"tooManyResults": "{n} results found. Enter more of the address to improve results",
|
|
29
|
+
"typeMore": "Enter more of the address to get results",
|
|
30
|
+
"errorTitle": "There is a problem with your answer",
|
|
31
|
+
"errorMessageEnter": "Enter an address",
|
|
32
|
+
"errorMessageSelect": "Select an address",
|
|
33
|
+
"errorMessageAPI": "Sorry, there is a problem. We are working to fix it. Please try again later or",
|
|
34
|
+
"errorMessageAPILinkText": "contact us for more help",
|
|
35
|
+
"errorMessageAPILink": "#0",
|
|
36
|
+
"options": {
|
|
37
|
+
"regionCode": "gb-eng",
|
|
38
|
+
"addressType": "residential"
|
|
39
|
+
}
|
|
40
|
+
}) }}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{% from "components/autosuggest/_macro.njk" import onsAutosuggest %}
|
|
2
|
+
|
|
3
|
+
<div class="ons-grid ons-grid--gutterless">
|
|
4
|
+
<div class="ons-grid__col ons-col-8@m">
|
|
5
|
+
|
|
6
|
+
{{ onsAutosuggest({
|
|
7
|
+
"id": "country-of-birth",
|
|
8
|
+
"label": {
|
|
9
|
+
"text": "Passport",
|
|
10
|
+
"id": "country-of-birth-label",
|
|
11
|
+
"description": "Enter your own answer or select from suggestions. You can enter multiple countries if you have a passport for more than one."
|
|
12
|
+
},
|
|
13
|
+
"autocomplete": "off",
|
|
14
|
+
"instructions": "Use up and down keys to navigate suggestions once you\'ve typed more than two characters. Use the enter key to select a suggestion. Touch device users, explore by touch or with swipe gestures.",
|
|
15
|
+
"ariaYouHaveSelected": "You have selected",
|
|
16
|
+
"ariaMinChars": "Enter 3 or more characters for suggestions.",
|
|
17
|
+
"ariaOneResult": "There is one suggestion available.",
|
|
18
|
+
"ariaNResults": "There are {n} suggestions available.",
|
|
19
|
+
"ariaLimitedResults": "Results have been limited to 10 suggestions. Type more characters to improve your search",
|
|
20
|
+
"moreResults": "Continue entering to improve suggestions",
|
|
21
|
+
"resultsTitle": "Suggestions",
|
|
22
|
+
"resultsTitleId": "country-of-birth-suggestions",
|
|
23
|
+
"allowMultiple": true,
|
|
24
|
+
"autosuggestData": "/examples/data/country-of-birth.json",
|
|
25
|
+
"noResults": "No suggestions found. You can enter your own answer",
|
|
26
|
+
"typeMore": "Continue entering to get suggestions"
|
|
27
|
+
}) }}
|
|
28
|
+
|
|
29
|
+
</div>
|
|
30
|
+
</div>
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{% from "components/autosuggest/_macro.njk" import onsAutosuggest %}
|
|
2
|
+
|
|
3
|
+
<div class="ons-grid ons-grid--gutterless">
|
|
4
|
+
<div class="ons-grid__col ons-col-8@m">
|
|
5
|
+
|
|
6
|
+
{{ onsAutosuggest({
|
|
7
|
+
"id": "country-of-birth",
|
|
8
|
+
"label": {
|
|
9
|
+
"text": "Current name of country",
|
|
10
|
+
"description": "Enter your own answer or select from suggestions",
|
|
11
|
+
"id": "country-of-birth-label"
|
|
12
|
+
},
|
|
13
|
+
"autocomplete": "off",
|
|
14
|
+
"instructions": "Use up and down keys to navigate suggestions once you\'ve typed more than two characters. Use the enter key to select a suggestion. Touch device users, explore by touch or with swipe gestures.",
|
|
15
|
+
"ariaYouHaveSelected": "You have selected",
|
|
16
|
+
"ariaMinChars": "Enter 3 or more characters for suggestions.",
|
|
17
|
+
"ariaOneResult": "There is one suggestion available.",
|
|
18
|
+
"ariaNResults": "There are {n} suggestions available.",
|
|
19
|
+
"ariaLimitedResults": "Results have been limited to 10 suggestions. Type more characters to improve your search",
|
|
20
|
+
"moreResults": "Continue entering to improve suggestions",
|
|
21
|
+
"resultsTitle": "Suggestions",
|
|
22
|
+
"resultsTitleId": "country-of-birth-suggestions",
|
|
23
|
+
"autosuggestData": "/examples/data/country-of-birth.json",
|
|
24
|
+
"noResults": "No suggestions found. You can enter your own answer",
|
|
25
|
+
"typeMore": "Continue entering to get suggestions"
|
|
26
|
+
}) }}
|
|
27
|
+
|
|
28
|
+
</div>
|
|
29
|
+
</div>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{% from "components/breadcrumbs/_macro.njk" import onsBreadcrumbs %}
|
|
2
|
+
|
|
3
|
+
{{
|
|
4
|
+
onsBreadcrumbs({
|
|
5
|
+
"ariaLabel": 'Back',
|
|
6
|
+
"itemsList": [
|
|
7
|
+
{
|
|
8
|
+
"url": '/',
|
|
9
|
+
"id": "back",
|
|
10
|
+
"text": 'Back',
|
|
11
|
+
"attributes": {
|
|
12
|
+
"data-attribute": "Example attribute"
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
]
|
|
16
|
+
})
|
|
17
|
+
}}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{% from "components/breadcrumbs/_macro.njk" import onsBreadcrumbs %}
|
|
2
|
+
|
|
3
|
+
{{
|
|
4
|
+
onsBreadcrumbs({
|
|
5
|
+
"ariaLabel": 'Breadcrumbs',
|
|
6
|
+
"itemsList": [
|
|
7
|
+
{
|
|
8
|
+
"url": '/',
|
|
9
|
+
"text": 'Home'
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
"url": '/components',
|
|
13
|
+
"text": 'Components'
|
|
14
|
+
}
|
|
15
|
+
]
|
|
16
|
+
})
|
|
17
|
+
}}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{% from "components/button/_macro.njk" import onsButton %}
|
|
2
|
+
|
|
3
|
+
<div class="ons-u-mb-m">
|
|
4
|
+
{{
|
|
5
|
+
onsButton({
|
|
6
|
+
"type": 'button',
|
|
7
|
+
"text": 'Done',
|
|
8
|
+
"iconType": 'check'
|
|
9
|
+
})
|
|
10
|
+
}}
|
|
11
|
+
</div>
|
|
12
|
+
<div>
|
|
13
|
+
{{
|
|
14
|
+
onsButton({
|
|
15
|
+
"text": 'Search',
|
|
16
|
+
"iconType": 'search',
|
|
17
|
+
"variants": ['secondary', 'small']
|
|
18
|
+
})
|
|
19
|
+
}}
|
|
20
|
+
</div>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
---
|
|
2
|
+
fullWidth: true
|
|
3
|
+
---
|
|
4
|
+
{% from "components/button/_macro.njk" import onsButton %}
|
|
5
|
+
<div style="padding: 1.5rem; background: #206095">
|
|
6
|
+
{{
|
|
7
|
+
onsButton({
|
|
8
|
+
"text": 'Save and sign out',
|
|
9
|
+
"url": '#0',
|
|
10
|
+
"variants": 'ghost',
|
|
11
|
+
"iconType": "exit",
|
|
12
|
+
"iconPosition": "after"
|
|
13
|
+
})
|
|
14
|
+
}}
|
|
15
|
+
</div>
|