@ons/design-system 70.0.8 → 70.0.10
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/components/access-code/_macro.njk +31 -25
- package/components/access-code/example-access-code-error.njk +49 -37
- package/components/access-code/example-access-code.njk +40 -30
- package/components/accordion/_macro.njk +7 -6
- package/components/accordion/example-accordion-open.njk +0 -1
- package/components/address-input/_macro.njk +23 -11
- package/components/address-input/autosuggest.address.js +0 -5
- package/components/address-input/example-address-input-editable.njk +52 -50
- package/components/address-input/example-address-input-manual.njk +23 -21
- package/components/address-input/example-address-input.njk +40 -38
- package/components/address-output/_macro.njk +6 -6
- package/components/autosuggest/_macro.njk +57 -37
- package/components/autosuggest/example-autosuggest-country-multiple.njk +26 -26
- package/components/autosuggest/example-autosuggest-country.njk +24 -24
- package/components/back-to-top/example-back-to-top.njk +183 -6
- package/components/back-to-top/example-full-page-back-to-top.njk +135 -123
- package/components/breadcrumbs/_macro.njk +12 -4
- package/components/browser-banner/_macro.njk +6 -3
- package/components/button/_button.scss +36 -1
- package/components/button/_macro.njk +63 -62
- package/components/button/example-button-ghost.njk +1 -0
- package/components/call-to-action/_macro.njk +7 -5
- package/components/call-to-action/example-call-to-action-default.njk +3 -2
- package/components/card/_macro.njk +26 -10
- package/components/card/example-card-set-with-images.njk +31 -29
- package/components/card/example-card-set-with-lists.njk +58 -56
- package/components/card/example-card-set.njk +28 -26
- package/components/card/example-card.njk +9 -7
- package/components/char-check-limit/_macro.njk +1 -3
- package/components/checkboxes/_checkbox-macro.njk +19 -15
- package/components/checkboxes/_macro.njk +81 -72
- package/components/checkboxes/example-checkboxes-disabled.njk +30 -30
- package/components/checkboxes/example-checkboxes-error.njk +0 -1
- package/components/checkboxes/example-checkboxes-with-descriptions.njk +7 -5
- package/components/checkboxes/example-checkboxes-with-hidden-label.njk +162 -170
- package/components/checkboxes/example-checkboxes-with-revealed-checkboxes-expanded.njk +81 -81
- package/components/checkboxes/example-checkboxes-with-revealed-checkboxes.njk +79 -79
- package/components/checkboxes/example-checkboxes-with-revealed-select-expanded.njk +7 -5
- package/components/checkboxes/example-checkboxes-with-revealed-select.njk +7 -5
- package/components/checkboxes/example-checkboxes-with-revealed-text-input-expanded.njk +7 -5
- package/components/checkboxes/example-checkboxes-with-revealed-text-input.njk +7 -5
- package/components/checkboxes/example-checkboxes-with-select-all-button.njk +7 -5
- package/components/checkboxes/example-checkboxes-with-visible-text-input.njk +7 -5
- package/components/checkboxes/example-checkboxes.njk +7 -5
- package/components/content-pagination/_macro.njk +34 -32
- package/components/content-pagination/example-content-pagination.njk +17 -17
- package/components/cookies-banner/_macro.njk +19 -6
- package/components/cookies-banner/example-cookies-banner-cymraeg.njk +2 -1
- package/components/cookies-banner/example-cookies-banner.njk +3 -4
- package/components/date-input/_macro.njk +71 -63
- package/components/date-input/example-date-input-error-for-single-field.njk +0 -1
- package/components/date-input/example-date-input-error.njk +0 -1
- package/components/description-list/_macro.njk +20 -11
- package/components/details/_macro.njk +18 -11
- package/components/details/example-details-with-warning.njk +15 -10
- package/components/document-list/_macro.njk +102 -93
- package/components/document-list/example-document-list-article-featured.njk +27 -25
- package/components/document-list/example-document-list-articles.njk +55 -53
- package/components/document-list/example-document-list-downloads.njk +49 -47
- package/components/document-list/example-document-list-search-result-featured.njk +19 -17
- package/components/document-list/example-document-list-search-results.njk +60 -58
- package/components/duration/_macro.njk +61 -55
- package/components/duration/example-duration-error-for-single-field.njk +28 -26
- package/components/duration/example-duration-single-field.njk +23 -19
- package/components/duration/example-duration.njk +33 -29
- package/components/error/_macro.njk +8 -6
- package/components/external-link/_macro.njk +7 -5
- package/components/external-link/example-external-link.njk +9 -6
- package/components/feedback/_macro.njk +7 -5
- package/components/field/_macro.njk +2 -2
- package/components/fieldset/_macro.njk +23 -16
- package/components/footer/_macro.njk +28 -21
- package/components/footer/_macro.spec.js +1 -1
- package/components/footer/example-footer-cymraeg.njk +2 -1
- package/components/footer/example-footer-default.njk +3 -4
- package/components/footer/example-footer-transactional.njk +2 -1
- package/components/footer/example-footer-warning.njk +2 -1
- package/components/footer/example-footer-with-alternative-organisation.njk +2 -1
- package/components/footer/example-footer-with-coat-of-arms.njk +2 -1
- package/components/footer/example-footer-with-copyright.njk +2 -1
- package/components/footer/example-footer.njk +2 -1
- package/components/header/_header.scss +24 -19
- package/components/header/_macro.njk +183 -141
- package/components/header/example-header-default.njk +2 -1
- package/components/header/example-header-external-for-survey-with-description.njk +2 -1
- package/components/header/example-header-external-for-surveys.njk +2 -1
- package/components/header/example-header-external-welsh.njk +7 -7
- package/components/header/example-header-external-with-navigation-and-search.njk +3 -2
- package/components/header/example-header-external-with-navigation.njk +2 -1
- package/components/header/example-header-external-with-service-links.njk +2 -1
- package/components/header/example-header-external-with-sub-navigation-removed.njk +2 -1
- package/components/header/example-header-external-with-sub-navigation.njk +3 -2
- package/components/header/example-header-internal.njk +2 -1
- package/components/header/example-header-multiple-logos.njk +2 -1
- package/components/header/{example-header-neutral-for-multicoloured-logo.njk → example-header-neutral.njk} +2 -1
- package/components/helpers/grid.njk +17 -16
- package/components/hero/_macro.njk +6 -11
- package/components/hero/example-hero-dark.njk +2 -1
- package/components/hero/example-hero-default.njk +2 -1
- package/components/icon/_macro.njk +601 -168
- package/components/image/_macro.njk +7 -5
- package/components/input/_macro.njk +114 -95
- package/components/input/example-input-search-with-character-check.njk +1 -1
- package/components/input/example-input-search-with-placeholder.njk +1 -1
- package/components/input/example-input-search.njk +1 -1
- package/components/label/_macro.njk +32 -26
- package/components/language-selector/_macro.njk +11 -2
- package/components/list/_list.scss +13 -0
- package/components/list/_macro.njk +93 -73
- package/components/message/_macro.njk +20 -7
- package/components/message-list/_macro.njk +26 -20
- package/components/modal/_macro.njk +11 -12
- package/components/multiple-input-fields/_macro.njk +30 -28
- package/components/mutually-exclusive/_macro.njk +20 -13
- package/components/mutually-exclusive/example-mutually-exclusive-checkboxes.njk +6 -4
- package/components/mutually-exclusive/example-mutually-exclusive-date.njk +7 -5
- package/components/mutually-exclusive/example-mutually-exclusive-duration.njk +44 -40
- package/components/mutually-exclusive/example-mutually-exclusive-email.njk +7 -5
- package/components/mutually-exclusive/example-mutually-exclusive-multiple-options.njk +6 -4
- package/components/mutually-exclusive/example-mutually-exclusive-number.njk +6 -4
- package/components/mutually-exclusive/example-mutually-exclusive-textarea.njk +6 -4
- package/components/navigation/_macro.njk +133 -67
- package/components/navigation/_navigation.scss +0 -9
- package/components/pagination/_macro.njk +42 -20
- package/components/panel/_macro.njk +27 -16
- package/components/panel/example-panel-bare.njk +6 -4
- package/components/panel/example-panel-with-announcement.njk +7 -4
- package/components/panel/example-panel-with-error-summary.njk +6 -4
- package/components/panel/example-panel-with-warning.njk +5 -3
- package/components/password/_macro.njk +7 -5
- package/components/phase-banner/_macro.njk +3 -3
- package/components/phase-banner/example-phase-banner-alpha.njk +2 -1
- package/components/phase-banner/example-phase-banner-beta.njk +4 -3
- package/components/question/_macro.njk +62 -47
- package/components/question/example-question-ccs.njk +40 -35
- package/components/question/example-question-fieldset.njk +84 -80
- package/components/question/example-question-interviewer-note.njk +27 -24
- package/components/question/example-question-no-fieldset.njk +39 -33
- package/components/quote/_macro.njk +3 -1
- package/components/radios/_macro.njk +54 -36
- package/components/radios/_macro.spec.js +21 -0
- package/components/radios/example-radios-with-clear-button-expanded.njk +6 -4
- package/components/radios/example-radios-with-clear-button.njk +6 -4
- package/components/radios/example-radios-with-descriptions.njk +7 -5
- package/components/radios/example-radios-with-revealed-select-expanded.njk +6 -4
- package/components/radios/example-radios-with-revealed-select.njk +6 -4
- package/components/radios/example-radios-with-revealed-text-area-expanded.njk +7 -5
- package/components/radios/example-radios-with-revealed-text-area.njk +7 -5
- package/components/radios/example-radios-with-revealed-text-input-expanded.njk +7 -5
- package/components/radios/example-radios-with-revealed-text-input.njk +7 -5
- package/components/radios/example-radios-with-separator.njk +6 -4
- package/components/radios/example-radios-with-visible-text-input.njk +7 -5
- package/components/radios/example-radios-without-border.njk +0 -1
- package/components/radios/example-radios.njk +7 -5
- package/components/related-content/_macro.njk +10 -11
- package/components/related-content/_section-macro.njk +7 -7
- package/components/related-content/example-related-content-general.njk +5 -3
- package/components/related-content/example-related-content-multiple-rows-of-links.njk +51 -49
- package/components/related-content/example-related-content-social-media.njk +40 -38
- package/components/relationships/_macro.njk +10 -8
- package/components/relationships/example-relationships-error.njk +176 -168
- package/components/relationships/example-relationships-you.njk +169 -163
- package/components/relationships/example-relationships.njk +167 -161
- package/components/section-navigation/_macro.njk +34 -12
- package/components/section-navigation/example-section-navigation-single-vertical-with-title.njk +23 -0
- package/components/select/_macro.njk +21 -18
- package/components/share-page/_macro.njk +10 -5
- package/components/skip-to-content/_macro.njk +1 -1
- package/components/skip-to-content/example-skip-to-content.njk +1 -0
- package/components/status/_macro.njk +1 -1
- package/components/summary/_macro.njk +53 -23
- package/components/summary/example-summary-household-no-rows.njk +18 -16
- package/components/summary/example-summary-household.njk +75 -73
- package/components/summary/example-summary-hub-minimal.njk +74 -72
- package/components/summary/example-summary-hub.njk +169 -167
- package/components/table/_macro.njk +72 -45
- package/components/table-of-contents/_macro.njk +34 -32
- package/components/table-of-contents/example-table-of-contents-grouped.njk +1 -1
- package/components/table-of-contents/example-table-of-contents-single.njk +1 -1
- package/components/table-of-contents/example-table-of-contents-sticky-full-page.njk +79 -38
- package/components/table-of-contents/example-table-of-contents-sticky.njk +50 -13
- package/components/tabs/_macro.njk +12 -6
- package/components/tabs/example-tabs-details.njk +5 -6
- package/components/text-indent/_macro.njk +1 -3
- package/components/textarea/_macro.njk +49 -46
- package/components/textarea/_macro.spec.js +0 -11
- package/components/timeline/_macro.njk +4 -6
- package/components/timeout-modal/_macro.njk +21 -19
- package/components/timeout-modal/example-timeout-modal.njk +16 -14
- package/components/timeout-panel/_macro.njk +19 -17
- package/components/timeout-panel/example-panel-with-timeout-warning.njk +13 -11
- package/components/upload/_macro.njk +20 -16
- package/components/video/_macro.njk +16 -2
- package/components/video/example-video.njk +2 -2
- package/css/main.css +1 -1
- package/layout/_dsTemplate.njk +22 -20
- package/layout/_template.njk +63 -49
- package/package.json +4 -3
- package/scripts/main.es5.js +1 -1
- package/scripts/main.js +1 -1
- package/scss/overrides/hcm.scss +1 -1
- package/scss/vars/_colors.scss +1 -1
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
{% from "components/input/_macro.njk" import onsInput %}
|
|
2
2
|
{% from "components/question/_macro.njk" import onsQuestion %}
|
|
3
3
|
|
|
4
|
-
{%
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
{%
|
|
5
|
+
call onsQuestion({
|
|
6
|
+
"title": "What was your annual income before tax in 2018/19?",
|
|
7
|
+
"legendIsQuestionTitle": true
|
|
8
|
+
})
|
|
9
|
+
%}
|
|
8
10
|
{{
|
|
9
11
|
onsInput({
|
|
10
12
|
"id": "currency",
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
{% from "components/textarea/_macro.njk" import onsTextarea %}
|
|
2
2
|
{% from "components/question/_macro.njk" import onsQuestion %}
|
|
3
3
|
|
|
4
|
-
{%
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
{%
|
|
5
|
+
call onsQuestion({
|
|
6
|
+
"title": "What do you think of this service?",
|
|
7
|
+
"legendIsQuestionTitle": true
|
|
8
|
+
})
|
|
9
|
+
%}
|
|
8
10
|
{{
|
|
9
11
|
onsTextarea({
|
|
10
12
|
"id": "feedback",
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
{% macro onsNavigation(params) %}
|
|
2
2
|
{% from "components/button/_macro.njk" import onsButton %}
|
|
3
3
|
{% from "components/autosuggest/_macro.njk" import onsAutosuggest %}
|
|
4
|
-
<div class="ons-navigation-wrapper{
|
|
5
|
-
<div
|
|
4
|
+
<div class="ons-navigation-wrapper{{ ' ons-navigation-wrapper--neutral' if params.variants == 'neutral' }}">
|
|
5
|
+
<div
|
|
6
|
+
class="ons-container ons-container--gutterless@xxs@l{{ ' ons-container--full-width' if params.fullWidth or params.navigation.fullWidth }}{{ ' ons-container--wide' if params.wide or params.navigation.wide }}"
|
|
7
|
+
>
|
|
6
8
|
{% if params.siteSearchAutosuggest %}
|
|
7
9
|
<div class="ons-navigation-search ons-js-navigation-search">
|
|
8
10
|
{% set autosuggestClasses = "ons-input-search ons-input-search--icon" %}
|
|
@@ -12,43 +14,58 @@
|
|
|
12
14
|
{% else %}
|
|
13
15
|
{% set autosuggestLabelClasses = autosuggestLabelClasses + ' ons-label--white' %}
|
|
14
16
|
{% endif %}
|
|
15
|
-
{{
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
"
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
"
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
17
|
+
{{
|
|
18
|
+
onsAutosuggest({
|
|
19
|
+
"id": "ons-site-search",
|
|
20
|
+
"containerClasses": "ons-autosuggest--header",
|
|
21
|
+
"input": {
|
|
22
|
+
"classes": autosuggestClasses,
|
|
23
|
+
"accessiblePlaceholder": true,
|
|
24
|
+
"autocomplete": "off",
|
|
25
|
+
"label": {
|
|
26
|
+
"text": params.siteSearchAutosuggest.label,
|
|
27
|
+
"id": "ons-site-search-label",
|
|
28
|
+
"classes": autosuggestLabelClasses
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
"instructions": params.siteSearchAutosuggest.instructions,
|
|
32
|
+
"ariaYouHaveSelected":params.siteSearchAutosuggest.ariaYouHaveSelected,
|
|
33
|
+
"minChars": params.siteSearchAutosuggest.minChars,
|
|
34
|
+
"ariaMinChars": params.siteSearchAutosuggest.ariaMinChars,
|
|
35
|
+
"ariaResultsLabel": params.siteSearchAutosuggest.ariaResultsLabel,
|
|
36
|
+
"ariaOneResult": params.siteSearchAutosuggest.ariaOneResult,
|
|
37
|
+
"ariaNResults": params.siteSearchAutosuggest.ariaNResults,
|
|
38
|
+
"ariaLimitedResults": params.siteSearchAutosuggest.ariaLimitedResults,
|
|
39
|
+
"moreResults": params.siteSearchAutosuggest.moreResults,
|
|
40
|
+
"resultsTitle": params.siteSearchAutosuggest.resultsTitle,
|
|
41
|
+
"autosuggestData": params.siteSearchAutosuggest.autosuggestData,
|
|
42
|
+
"noResults": params.siteSearchAutosuggest.noResults,
|
|
43
|
+
"typeMore": params.siteSearchAutosuggest.typeMore,
|
|
44
|
+
"language": params.siteSearchAutosuggest.language
|
|
45
|
+
})
|
|
46
|
+
}}
|
|
43
47
|
</div>
|
|
44
48
|
{% endif %}
|
|
45
|
-
<nav
|
|
49
|
+
<nav
|
|
50
|
+
class="ons-navigation ons-navigation--main ons-js-navigation"
|
|
51
|
+
id="{{ params.navigation.id }}"
|
|
52
|
+
aria-label="{{ params.navigation.ariaLabel | default("Main menu") }}"
|
|
53
|
+
data-analytics="header-navigation"
|
|
54
|
+
>
|
|
46
55
|
<ul class="ons-navigation__list">
|
|
47
56
|
{% for item in params.navigation.itemsList %}
|
|
48
|
-
<li
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
57
|
+
<li
|
|
58
|
+
class="ons-navigation__item {{ item.classes }}{{ ' ons-navigation__item--active' if (item.url == params.navigation.currentPath) or (params.navigation.currentPath is not string and item.url in params.navigation.currentPath) }}"
|
|
59
|
+
>
|
|
60
|
+
<a
|
|
61
|
+
class="ons-navigation__link"
|
|
62
|
+
href="{{ item.url }}"
|
|
63
|
+
{% if item.id %}id="{{ item.id }}"{% endif %}{% if item.ariaLabel %}{{ ' ' }}aria-label="{{ item.ariaLabel }}"{% endif %}
|
|
64
|
+
>
|
|
65
|
+
{% if item.title %}
|
|
66
|
+
{{ item.title }}
|
|
67
|
+
{% elif item.text %}
|
|
68
|
+
{{ item.text }}
|
|
52
69
|
{% endif %}
|
|
53
70
|
</a>
|
|
54
71
|
</li>
|
|
@@ -59,14 +76,30 @@
|
|
|
59
76
|
</div>
|
|
60
77
|
{% if params.navigation.subNavigation %}
|
|
61
78
|
{% if not params.navigation.subNavigation.removeHorizontalSubNav %}
|
|
62
|
-
<nav
|
|
63
|
-
|
|
79
|
+
<nav
|
|
80
|
+
class="ons-navigation ons-navigation--sub ons-u-d-no@xxs@l{{ ' ' + params.navigation.subNavigation.classes if params.navigation.subNavigation.classes else '' }}"
|
|
81
|
+
id="{{ params.navigation.subNavigation.id }}"
|
|
82
|
+
aria-label="{{ params.navigation.subNavigation.ariaLabel | default('Section menu') }}"
|
|
83
|
+
data-analytics="header-section-navigation"
|
|
84
|
+
>
|
|
85
|
+
<div
|
|
86
|
+
class="ons-container ons-container--gutterless@xxs@l{{ ' ons-container--full-width' if params.fullWidth or params.navigation.fullWidth }}{{ ' ons-container--wide' if params.wide or params.navigation.wide }}"
|
|
87
|
+
>
|
|
64
88
|
<ul class="ons-navigation__list ons-navigation__list">
|
|
65
89
|
{% for item in params.navigation.subNavigation.itemsList %}
|
|
66
|
-
<li
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
90
|
+
<li
|
|
91
|
+
class="ons-navigation__item{{ ' ' + item.classes if item.classes else '' }}{{ ' ons-navigation__item--active' if (item.url == params.navigation.currentPath) or (params.navigation.currentPath is not string and item.url in params.navigation.currentPath) }}"
|
|
92
|
+
>
|
|
93
|
+
<a
|
|
94
|
+
class="ons-navigation__link ons-navigation__link"
|
|
95
|
+
href="{{ item.url }}"
|
|
96
|
+
{% if item.ariaLabel %}aria-label="{{ item.ariaLabel }}"{% endif %}
|
|
97
|
+
{% if item.id %}id="{{ item.id }}"{% endif %}
|
|
98
|
+
>
|
|
99
|
+
{% if item.title %}
|
|
100
|
+
{{ item.title }}
|
|
101
|
+
{% elif item.text %}
|
|
102
|
+
{{ item.text }}
|
|
70
103
|
{% endif %}
|
|
71
104
|
</a>
|
|
72
105
|
</li>
|
|
@@ -75,29 +108,52 @@
|
|
|
75
108
|
</div>
|
|
76
109
|
</nav>
|
|
77
110
|
{% endif %}
|
|
78
|
-
<div class="ons-u-d-no@l{{ ' ' + params.navigation.subNavigation.classes if params.navigation.subNavigation.classes }}">
|
|
79
|
-
{{
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
"
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
111
|
+
<div class="ons-u-d-no@l{{ ' ' + params.navigation.subNavigation.classes if params.navigation.subNavigation.classes else '' }}">
|
|
112
|
+
{{
|
|
113
|
+
onsButton({
|
|
114
|
+
"text": params.navigation.currentPageTitle,
|
|
115
|
+
"classes": "ons-u-d-no ons-js-sub-navigation-button",
|
|
116
|
+
"type": "button",
|
|
117
|
+
"variants": ["mobile", "dropdown"],
|
|
118
|
+
"attributes": {
|
|
119
|
+
"aria-label": "Toggle " + params.navigation.currentPageTitle + " menu" if params.navigation.currentPageTitle else "Toggle section menu",
|
|
120
|
+
"aria-controls": params.navigation.subNavigation.id,
|
|
121
|
+
"aria-expanded": "false"
|
|
122
|
+
}
|
|
123
|
+
})
|
|
124
|
+
}}
|
|
125
|
+
<nav
|
|
126
|
+
class="ons-navigation ons-navigation--sub-mobile ons-u-d-no ons-js-secondary-nav ons-u-mt-xs"
|
|
127
|
+
id="{{ params.navigation.subNavigation.id }}--mobile"
|
|
128
|
+
aria-hidden="true"
|
|
129
|
+
aria-label="{{ params.navigation.subNavigation.ariaLabel | default("Section menu") }}"
|
|
130
|
+
data-analytics="header-section-navigation"
|
|
131
|
+
>
|
|
132
|
+
<div
|
|
133
|
+
class="ons-container ons-container--gutterless@xxs@l{{ ' ons-container--full-width' if params.navigation.fullWidth }}{{ ' ons-container--wide' if params.navigation.wide }}"
|
|
134
|
+
>
|
|
92
135
|
<ul class="ons-navigation__list ons-navigation__list--parent">
|
|
93
|
-
<li
|
|
94
|
-
|
|
136
|
+
<li
|
|
137
|
+
class="ons-navigation__item{{ ' ons-navigation__item--active' if (params.navigation.subNavigation.overviewURL == params.navigation.subNavigation.currentPath) }}"
|
|
138
|
+
>
|
|
139
|
+
<a class="ons-navigation__link" href="{{ params.navigation.subNavigation.overviewURL }}"
|
|
140
|
+
>{{ params.navigation.subNavigation.overviewText | default('Overview') }}</a
|
|
141
|
+
>
|
|
95
142
|
</li>
|
|
96
143
|
{% for item in params.navigation.subNavigation.itemsList %}
|
|
97
|
-
<li
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
144
|
+
<li
|
|
145
|
+
class="ons-navigation__item{{ ' ons-navigation__item--active' if (item.url == params.navigation.subNavigation.currentPath) or (item.url == params.navigation.currentPath) or (params.navigation.currentPath is not string and item.url in params.navigation.currentPath) }}"
|
|
146
|
+
>
|
|
147
|
+
<a
|
|
148
|
+
class="ons-navigation__link"
|
|
149
|
+
href="{{ item.url }}"
|
|
150
|
+
{% if item.ariaLabel %}aria-label="{{ item.ariaLabel }}"{% endif %}
|
|
151
|
+
{% if item.id %}id="{{ item.id }}--mobile"{% endif %}
|
|
152
|
+
>
|
|
153
|
+
{% if item.title %}
|
|
154
|
+
{{ item.title }}
|
|
155
|
+
{% elif item.text %}
|
|
156
|
+
{{ item.text }}
|
|
101
157
|
{% endif %}
|
|
102
158
|
</a>
|
|
103
159
|
{% if item.sections %}
|
|
@@ -105,12 +161,23 @@
|
|
|
105
161
|
{% if section.sectionTitle %}
|
|
106
162
|
<h3 class="ons-navigation__list-header">{{ section.sectionTitle }}</h3>
|
|
107
163
|
{% endif %}
|
|
108
|
-
<ul
|
|
164
|
+
<ul
|
|
165
|
+
class="ons-navigation__list ons-navigation__list--child ons-list--dashed ons-u-ml-s ons-u-mt-xs"
|
|
166
|
+
>
|
|
109
167
|
{% for child in section.children %}
|
|
110
|
-
<li
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
168
|
+
<li
|
|
169
|
+
class="ons-navigation__item ons-list__item{{ ' ons-navigation__item--active' if (child.url == params.navigation.currentPath) or (params.navigation.currentPath is not string and child.url in params.navigation.currentPath) }}"
|
|
170
|
+
>
|
|
171
|
+
<a
|
|
172
|
+
class="ons-navigation__link ons-navigation__link--section"
|
|
173
|
+
href="{{ child.url }}"
|
|
174
|
+
{% if child.ariaLabel %}aria-label="{{ child.ariaLabel }}"{% endif %}
|
|
175
|
+
{% if child.id %}id="{{ child.id }}"{% endif %}
|
|
176
|
+
>
|
|
177
|
+
{% if child.title %}
|
|
178
|
+
{{ child.title }}
|
|
179
|
+
{% elif child.text %}
|
|
180
|
+
{{ child.text }}
|
|
114
181
|
{% endif %}
|
|
115
182
|
</a>
|
|
116
183
|
</li>
|
|
@@ -125,5 +192,4 @@
|
|
|
125
192
|
</nav>
|
|
126
193
|
</div>
|
|
127
194
|
{% endif %}
|
|
128
|
-
|
|
129
195
|
{% endmacro %}
|
|
@@ -7,15 +7,6 @@
|
|
|
7
7
|
|
|
8
8
|
&--neutral {
|
|
9
9
|
background: var(--ons-color-header-neutral);
|
|
10
|
-
.ons-navigation__item {
|
|
11
|
-
&--active,
|
|
12
|
-
&:hover {
|
|
13
|
-
border-color: var(--ons-color-links);
|
|
14
|
-
}
|
|
15
|
-
.ons-navigation__link {
|
|
16
|
-
color: var(--ons-color-header-navigation-links);
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
10
|
}
|
|
20
11
|
}
|
|
21
12
|
|
|
@@ -8,24 +8,34 @@
|
|
|
8
8
|
{% set prevPageIndex = currentPageIndex - 1 %}
|
|
9
9
|
{% set nextPageIndex = currentPageIndex + 1 %}
|
|
10
10
|
|
|
11
|
-
<nav
|
|
11
|
+
<nav
|
|
12
|
+
class="ons-pagination{{ ' ' + params.classes if params.classes else '' }}{{ ' ons-pagination--no-indicator' if params.hideRangeIndicator }}"
|
|
13
|
+
aria-label="Pagination ({{ position }})"
|
|
14
|
+
>
|
|
12
15
|
<div class="ons-pagination__position">{{ position }}</div>
|
|
13
16
|
<ul class="ons-pagination__items">
|
|
14
17
|
{% if currentPageIndex != 1 %}
|
|
15
18
|
{% set prevPageIndex = currentPageIndex - 2 %}
|
|
16
19
|
<li class="ons-pagination__item ons-pagination__item--previous">
|
|
17
|
-
<a
|
|
18
|
-
{{
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
<a
|
|
21
|
+
href="{{ params.pages[prevPageIndex].url }}"
|
|
22
|
+
class="ons-pagination__link ons-pagination__link--no-underline"
|
|
23
|
+
rel="prev"
|
|
24
|
+
aria-label="Go to the previous page (Page {{ currentPageIndex - 1 }})"
|
|
25
|
+
>
|
|
26
|
+
{{-
|
|
27
|
+
onsIcon({
|
|
28
|
+
"iconType": 'arrow-previous',
|
|
29
|
+
"classes": 'ons-u-mr-xs',
|
|
30
|
+
"iconSize": 'm'
|
|
31
|
+
})
|
|
32
|
+
-}}
|
|
23
33
|
<span class="ons-pagination__link-text">{{ params.previous | default("Previous") }}</span>
|
|
24
34
|
</a>
|
|
25
35
|
</li>
|
|
26
36
|
{% endif %}
|
|
27
37
|
{% if currentPageIndex > 2 %}
|
|
28
|
-
<li class="ons-pagination__item{
|
|
38
|
+
<li class="ons-pagination__item{{ ' ons-pagination__item--current' if currentPageIndex == 1 }}">
|
|
29
39
|
<a href="{{ firstPage.url }}" class="ons-pagination__link" aria-label="Go to the first page (Page 1)">1</a>
|
|
30
40
|
</li>
|
|
31
41
|
{% endif %}
|
|
@@ -36,13 +46,15 @@
|
|
|
36
46
|
{% set showPage = false %}
|
|
37
47
|
{# Show the current, next and previous page
|
|
38
48
|
Show page 2 if the current page index is within the first 4 pages
|
|
39
|
-
Show the penultimate page if the current page index is within the last 4 pages
|
|
49
|
+
Show the penultimate page if the current page index is within the last 4 pages #}
|
|
40
50
|
{% if (loop.index == currentPageIndex) or (loop.index == currentPageIndex + 1) or (loop.index == currentPageIndex - 1) or (loop.index == 2 and currentPageIndex <= 4) or ((loop.index == totalPages - 1) and (currentPageIndex > totalPages - 4)) %}
|
|
41
51
|
{% set showPage = true %}
|
|
42
52
|
{% endif %}
|
|
43
53
|
{% if showPage == true %}
|
|
44
|
-
<li class="ons-pagination__item{
|
|
45
|
-
<a
|
|
54
|
+
<li class="ons-pagination__item{{ ' ons-pagination__item--current' if loop.index == currentPageIndex }}">
|
|
55
|
+
<a
|
|
56
|
+
href="{{ page.url }}"
|
|
57
|
+
class="ons-pagination__link"
|
|
46
58
|
{%- if loop.index == currentPageIndex -%}
|
|
47
59
|
aria-current="true" aria-label="Current page ({{ position }})"
|
|
48
60
|
{%- else -%}
|
|
@@ -54,7 +66,8 @@
|
|
|
54
66
|
{%- if loop.index == currentPageIndex + 1 -%}
|
|
55
67
|
rel="next"
|
|
56
68
|
{%- endif -%}
|
|
57
|
-
|
|
69
|
+
>{{ loop.index }}</a
|
|
70
|
+
>
|
|
58
71
|
</li>
|
|
59
72
|
{% endif %}
|
|
60
73
|
{% endfor %}
|
|
@@ -62,19 +75,28 @@
|
|
|
62
75
|
<li class="ons-pagination__item ons-pagination__item--gap">…</li>
|
|
63
76
|
{% endif %}
|
|
64
77
|
{% if currentPageIndex < totalPages - 1 %}
|
|
65
|
-
<li class="ons-pagination__item{
|
|
66
|
-
<a href="{{ lastPage.url }}" class="ons-pagination__link" aria-label="Go to the last page (Page {{ totalPages }})"
|
|
78
|
+
<li class="ons-pagination__item{{ ' ons-pagination__item--current' if currentPageIndex == totalPages }}">
|
|
79
|
+
<a href="{{ lastPage.url }}" class="ons-pagination__link" aria-label="Go to the last page (Page {{ totalPages }})"
|
|
80
|
+
>{{ totalPages }}</a
|
|
81
|
+
>
|
|
67
82
|
</li>
|
|
68
83
|
{% endif %}
|
|
69
84
|
{% if totalPages > 1 and totalPages != currentPageIndex %}
|
|
70
85
|
<li class="ons-pagination__item ons-pagination__item--next">
|
|
71
|
-
<a
|
|
86
|
+
<a
|
|
87
|
+
href="{{ params.pages[currentPageIndex].url }}"
|
|
88
|
+
class="ons-pagination__link ons-pagination__link--no-underline"
|
|
89
|
+
rel="next"
|
|
90
|
+
aria-label="Go to the next page (Page {{ currentPageIndex + 1 }})"
|
|
91
|
+
>
|
|
72
92
|
<span class="ons-pagination__link-text">{{ params.next | default("Next") }}</span>
|
|
73
|
-
{{-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
93
|
+
{{-
|
|
94
|
+
onsIcon({
|
|
95
|
+
"iconType": 'arrow-next',
|
|
96
|
+
"classes": 'ons-u-ml-xs',
|
|
97
|
+
"iconSize": 'm'
|
|
98
|
+
})
|
|
99
|
+
-}}
|
|
78
100
|
</a>
|
|
79
101
|
</li>
|
|
80
102
|
{% endif %}
|
|
@@ -26,13 +26,13 @@
|
|
|
26
26
|
{% set spaciousClass = ' ons-panel--spacious' %}
|
|
27
27
|
{% endif %}
|
|
28
28
|
|
|
29
|
-
{%
|
|
30
|
-
<div
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
29
|
+
{% set panel %}
|
|
30
|
+
<div
|
|
31
|
+
{% if (params.variant == 'error' and params.title) or params.variant == 'success' %}
|
|
32
|
+
aria-labelledby="alert" role="alert" tabindex="-1" {% if not isDesignSystemExample %}autofocus="autofocus"{% endif %}
|
|
33
|
+
{% endif %}class="ons-panel{{ variantClass }}{{ iconClass }}{{ noTitleClass }}{{ spaciousClass }}{{ classes }}"
|
|
34
|
+
{% if params and params.attributes %}{% for attribute, value in (params.attributes.items() if params and params.attributes is mapping and params.attributes.items else params.attributes) %}{{ ' ' }}{{ attribute }}="{{ value }}"{% endfor %}{% endif %}{% if params and params.id %}id="{{ params.id }}"{% endif %}
|
|
35
|
+
>
|
|
36
36
|
{% if params.variant == "warn" or params.variant == "warn-branded" %}
|
|
37
37
|
<span class="ons-panel__icon" aria-hidden="true">!</span>
|
|
38
38
|
<span class="ons-panel__assistive-text ons-u-vh">{{ params.assistiveTextPrefix | default("Warning: ") }}</span>
|
|
@@ -57,21 +57,28 @@
|
|
|
57
57
|
{% set defaultTitleTag = "div" %}
|
|
58
58
|
{% endif %}
|
|
59
59
|
{% set titleTag = params.titleTag | default(defaultTitleTag) %}
|
|
60
|
+
{% set openingTag = "<" + titleTag %}
|
|
61
|
+
{% set closingTag = "</" + titleTag + ">" %}
|
|
60
62
|
<div class="ons-panel__header">
|
|
61
|
-
|
|
63
|
+
{{ openingTag | safe }} id="alert"{% if params.variant %}data-qa="{{ params.variant }}-header"{% endif %}
|
|
64
|
+
class="ons-panel__title ons-u-fs-r--b">{{ params.title | safe }}{{ closingTag | safe }}
|
|
62
65
|
</div>
|
|
63
66
|
{% else %}
|
|
64
67
|
{% if not params.variant or params.variant == "branded" or params.variant == "info" or params.variant == "bare" %}
|
|
65
|
-
<span class="ons-panel__assistive-text ons-u-vh"
|
|
66
|
-
|
|
68
|
+
<span class="ons-panel__assistive-text ons-u-vh"
|
|
69
|
+
>{{ params.assistiveTextPrefix | default("Important information: ") }}</span
|
|
70
|
+
>
|
|
71
|
+
{% elif params.variant == 'error' or params.variant == 'success' %}
|
|
67
72
|
{% set defaultText = "Completed" if params.variant == "success" else "Error" %}
|
|
68
|
-
<span{% if params.variant == "success" %}
|
|
73
|
+
<span {% if params.variant == "success" %}id="alert"{% endif %}class="ons-panel__assistive-text ons-u-vh"
|
|
74
|
+
>{{ params.assistiveTextPrefix | default(defaultText ~ ": ") }}</span
|
|
75
|
+
>
|
|
69
76
|
{% endif %}
|
|
70
77
|
{% endif %}
|
|
71
78
|
|
|
72
79
|
{% if params.iconType %}
|
|
73
80
|
{% from "components/icon/_macro.njk" import onsIcon %}
|
|
74
|
-
<span class=
|
|
81
|
+
<span class="ons-panel__icon ons-u-fs-{{ params.iconSize | default('r') }}">
|
|
75
82
|
{{-
|
|
76
83
|
onsIcon({
|
|
77
84
|
"iconType": params.iconType,
|
|
@@ -81,14 +88,18 @@
|
|
|
81
88
|
</span>
|
|
82
89
|
{% endif %}
|
|
83
90
|
|
|
84
|
-
<div class="ons-panel__body{% if params.iconSize %} ons-icon-margin--{{ params.iconSize }}{% endif %}">
|
|
91
|
+
<div class="ons-panel__body{% if params.iconSize %}{{ ' ' }}ons-icon-margin--{{ params.iconSize }}{% endif %}">
|
|
92
|
+
{{ (params.body if params) | safe }}
|
|
85
93
|
{{ caller() if caller }}
|
|
86
94
|
</div>
|
|
87
95
|
</div>
|
|
96
|
+
{% endset %}
|
|
88
97
|
|
|
89
|
-
{% if params.variant == "warn-branded" or params.variant == "announcement"
|
|
90
|
-
|
|
98
|
+
{% if params.variant == "warn-branded" or params.variant == "announcement" %}
|
|
99
|
+
<div class="{{ containerClass }}">
|
|
100
|
+
<div class="ons-container">{{ panel | safe }}</div>
|
|
91
101
|
</div>
|
|
102
|
+
{% else %}
|
|
103
|
+
{{ panel | safe }}
|
|
92
104
|
{% endif %}
|
|
93
|
-
|
|
94
105
|
{% endmacro %}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
{% from "components/panel/_macro.njk" import onsPanel %}
|
|
2
2
|
|
|
3
|
-
{%
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
{%
|
|
4
|
+
call onsPanel({
|
|
5
|
+
"variant": 'bare',
|
|
6
|
+
"iconType": 'lock'
|
|
7
|
+
})
|
|
8
|
+
%}
|
|
7
9
|
Here is some text with an icon
|
|
8
10
|
{% endcall %}
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
---
|
|
2
|
-
|
|
2
|
+
'fullWidth': true
|
|
3
3
|
---
|
|
4
|
+
|
|
4
5
|
{% from "components/panel/_macro.njk" import onsPanel %}
|
|
5
6
|
|
|
6
|
-
{%
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
{%
|
|
8
|
+
call onsPanel({
|
|
9
|
+
"variant": 'announcement'
|
|
10
|
+
})
|
|
11
|
+
%}
|
|
9
12
|
<p class="ons-u-mb-no">National lockdown: stay at home</p>
|
|
10
13
|
|
|
11
14
|
<div class="ons-u-fs-r">
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
{% from "components/panel/_macro.njk" import onsPanel %}
|
|
2
2
|
{% from "components/list/_macro.njk" import onsList %}
|
|
3
3
|
|
|
4
|
-
{%
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
{%
|
|
5
|
+
call onsPanel({
|
|
6
|
+
"title": 'There are 2 problems with your answer',
|
|
7
|
+
"variant": 'error'
|
|
8
|
+
})
|
|
9
|
+
%}
|
|
8
10
|
{{
|
|
9
11
|
onsList({
|
|
10
12
|
"element": 'ol',
|
|
@@ -4,11 +4,13 @@
|
|
|
4
4
|
{% from "components/checkboxes/_checkbox-macro.njk" import onsCheckbox %}
|
|
5
5
|
{% from "components/input/_macro.njk" import onsInput %}
|
|
6
6
|
|
|
7
|
-
{%
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
{%
|
|
8
|
+
call onsField({
|
|
9
|
+
"id": params.fieldId,
|
|
10
|
+
"classes": "ons-js-password" + (" " + params.fieldClasses if params.fieldClasses else ""),
|
|
11
|
+
"error": params.error
|
|
12
|
+
})
|
|
13
|
+
%}
|
|
12
14
|
{{
|
|
13
15
|
onsLabel({
|
|
14
16
|
"for": params.id,
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
<div class="ons-container{{ ' ons-container--full-width' if params.fullWidth }}{{ ' ons-container--wide' if params.wide }}">
|
|
4
4
|
<div class="ons-grid ons-grid--flex ons-grid--gutterless ons-grid--vertical-top ons-grid--no-wrap">
|
|
5
5
|
{% if not params.hideBadge %}
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
<div class="ons-grid__col ons-col-auto ons-u-flex-no-grow ons-u-flex-no-shrink">
|
|
7
|
+
<strong class="ons-phase-banner__badge">{{ params.badge | default("Beta") }}</strong>
|
|
8
|
+
</div>
|
|
9
9
|
{% endif %}
|
|
10
10
|
<div class="ons-grid__col ons-col-auto ons-u-flex-shrink">
|
|
11
11
|
<p class="ons-phase-banner__desc ons-u-fs-s ons-u-mb-no">{{ params.html | safe }}</p>
|