@ons/design-system 70.0.8 → 70.0.9
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/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
|
@@ -3,8 +3,9 @@
|
|
|
3
3
|
{% from "components/icon/_macro.njk" import onsIcon %}
|
|
4
4
|
{% from "components/navigation/_macro.njk" import onsNavigation %}
|
|
5
5
|
{% from "components/browser-banner/_macro.njk" import onsBrowserBanner %}
|
|
6
|
-
|
|
7
|
-
{% set
|
|
6
|
+
{% set titleTag = "h1" if params.titleAsH1 else "div" %}
|
|
7
|
+
{% set openingTag = "<" + titleTag %}
|
|
8
|
+
{% set closingTag = "</" + titleTag + ">" %}
|
|
8
9
|
{% set currentLanguageISOCode = "en" %}
|
|
9
10
|
|
|
10
11
|
{% if params.language and params.language.languages %}
|
|
@@ -12,7 +13,10 @@
|
|
|
12
13
|
{% set currentLanguageISOCode = currentLanguage.ISOCode %}
|
|
13
14
|
{% endif %}
|
|
14
15
|
|
|
15
|
-
<header
|
|
16
|
+
<header
|
|
17
|
+
class="ons-header{{ ' '+ params.classes if params.classes }}{% if params.variants is not string %}{% for variant in params.variants %}{{ ' ' }}ons-header--{{ variant }}{% endfor %}{% else %}{{ ' ' }}ons-header--{{ params.variants }}{% endif %}"
|
|
18
|
+
role="banner"
|
|
19
|
+
>
|
|
16
20
|
{{
|
|
17
21
|
onsBrowserBanner({
|
|
18
22
|
"lang": currentLanguageISOCode,
|
|
@@ -22,60 +26,42 @@
|
|
|
22
26
|
}}
|
|
23
27
|
{% if params.phase %}
|
|
24
28
|
{% from "components/phase-banner/_macro.njk" import onsPhaseBanner %}
|
|
25
|
-
{{
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
{{
|
|
30
|
+
onsPhaseBanner({
|
|
31
|
+
"fullWidth": params.fullWidth,
|
|
32
|
+
"wide": params.wide,
|
|
33
|
+
"hideBadge": params.phase.hideBadge,
|
|
34
|
+
"badge": params.phase.badge,
|
|
35
|
+
"html": params.phase.html
|
|
36
|
+
})
|
|
37
|
+
}}
|
|
32
38
|
{% endif %}
|
|
33
39
|
<div class="ons-header__top">
|
|
34
40
|
<div class="ons-container{{ ' ons-container--full-width' if params.fullWidth }}{{ ' ons-container--wide' if params.wide }}">
|
|
35
|
-
<div
|
|
41
|
+
<div
|
|
42
|
+
class="ons-header__grid-top ons-grid ons-grid--flex ons-grid--between ons-grid--vertical-center{{ ' '+ params.mastheadLogo.classes if params.mastheadLogo.classes }}{{ ' ons-grid--no-wrap ons-grid--gutterless' if not params.mastheadLogo.multipleLogos }}"
|
|
43
|
+
>
|
|
36
44
|
<div class="ons-grid__col ons-col-auto">
|
|
37
|
-
{%- if not params.mastheadLogo.multipleLogos
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
{
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
}
|
|
50
|
-
-}}
|
|
51
|
-
{% endif %}
|
|
52
|
-
</div>
|
|
53
|
-
<div class="ons-header__org-logo ons-header__org-logo--small">
|
|
54
|
-
{% if params.mastheadLogo.small %}
|
|
55
|
-
{{ params.mastheadLogo.small | safe }}
|
|
56
|
-
{% elif params.mastheadLogo.large %}
|
|
57
|
-
{{ params.mastheadLogo.large | safe }}
|
|
58
|
-
{% else %}
|
|
59
|
-
{{-
|
|
60
|
-
onsIcon({
|
|
61
|
-
"iconType": 'ons-logo-stacked-' + currentLanguageISOCode,
|
|
62
|
-
"altText": 'Office for National Statistics logo'
|
|
63
|
-
})
|
|
64
|
-
-}}
|
|
65
|
-
{% endif %}
|
|
66
|
-
</div>
|
|
67
|
-
{% if params.mastheadLogoUrl %}
|
|
68
|
-
</a>
|
|
69
|
-
{% endif %}
|
|
70
|
-
{% else %}
|
|
71
|
-
<div class="ons-header__org-logo ons-header__org-logo--multi">
|
|
72
|
-
{% set logos = [params.mastheadLogo.multipleLogos.logo1, params.mastheadLogo.multipleLogos.logo2, params.mastheadLogo.multipleLogos.logo3] %}
|
|
73
|
-
{% for logo in logos %}
|
|
74
|
-
{% if logo.logoURL %}
|
|
75
|
-
<a class="ons-header__org-logo-link" href="{{ logo.logoURL }}">
|
|
45
|
+
{%- if not params.mastheadLogo.multipleLogos -%}
|
|
46
|
+
|
|
47
|
+
{% set mastheadLogo %}
|
|
48
|
+
<div class="ons-header__org-logo ons-header__org-logo--large">
|
|
49
|
+
{% if params.mastheadLogo.large %}
|
|
50
|
+
{{ params.mastheadLogo.large | safe }}
|
|
51
|
+
{% else %}
|
|
52
|
+
{{-
|
|
53
|
+
onsIcon({
|
|
54
|
+
"iconType": 'ons-logo-' + currentLanguageISOCode,
|
|
55
|
+
"altText": 'Office for National Statistics homepage'
|
|
56
|
+
})
|
|
57
|
+
-}}
|
|
76
58
|
{% endif %}
|
|
77
|
-
|
|
78
|
-
|
|
59
|
+
</div>
|
|
60
|
+
<div class="ons-header__org-logo ons-header__org-logo--small">
|
|
61
|
+
{% if params.mastheadLogo.small %}
|
|
62
|
+
{{ params.mastheadLogo.small | safe }}
|
|
63
|
+
{% elif params.mastheadLogo.large %}
|
|
64
|
+
{{ params.mastheadLogo.large | safe }}
|
|
79
65
|
{% else %}
|
|
80
66
|
{{-
|
|
81
67
|
onsIcon({
|
|
@@ -84,17 +70,43 @@
|
|
|
84
70
|
})
|
|
85
71
|
-}}
|
|
86
72
|
{% endif %}
|
|
73
|
+
</div>
|
|
74
|
+
{% endset %}
|
|
75
|
+
|
|
76
|
+
{%- if params.mastheadLogoUrl -%}
|
|
77
|
+
<a class="ons-header__org-logo-link" href="{{ params.mastheadLogoUrl }}">{{ mastheadLogo | safe }}</a>
|
|
78
|
+
{% else %}
|
|
79
|
+
{{ mastheadLogo | safe }}
|
|
80
|
+
{% endif %}
|
|
81
|
+
{% else %}
|
|
82
|
+
<div class="ons-header__org-logo ons-header__org-logo--multi">
|
|
83
|
+
{% set logos = [params.mastheadLogo.multipleLogos.logo1, params.mastheadLogo.multipleLogos.logo2, params.mastheadLogo.multipleLogos.logo3] %}
|
|
84
|
+
{% for logo in logos %}
|
|
85
|
+
{% set mastheadLogo %}
|
|
86
|
+
{% if logo.logoImage != "ONS Logo" %}
|
|
87
|
+
{{ logo.logoImage | safe }}
|
|
88
|
+
{% else %}
|
|
89
|
+
{{-
|
|
90
|
+
onsIcon({
|
|
91
|
+
"iconType": 'ons-logo-stacked-' + currentLanguageISOCode,
|
|
92
|
+
"altText": 'Office for National Statistics logo'
|
|
93
|
+
})
|
|
94
|
+
-}}
|
|
95
|
+
{% endif %}
|
|
96
|
+
{% endset %}
|
|
87
97
|
{% if logo.logoURL %}
|
|
88
|
-
</a>
|
|
98
|
+
<a class="ons-header__org-logo-link" href="{{ logo.logoURL }}">{{ mastheadLogo | safe }}</a>
|
|
99
|
+
{% else %}
|
|
100
|
+
{{ mastheadLogo | safe }}
|
|
89
101
|
{% endif %}
|
|
90
102
|
{% endfor %}
|
|
91
103
|
</div>
|
|
92
|
-
{
|
|
104
|
+
{%- endif -%}
|
|
93
105
|
</div>
|
|
94
106
|
{% if params.language or params.serviceLinks %}
|
|
95
107
|
<div class="ons-header__links ons-grid__col ons-u-ml-auto">
|
|
96
108
|
{% if params.language %}
|
|
97
|
-
<div class="ons-grid__col ons-col-auto{{ ' ons-u-mr-s ons-u-d-no@xxs@xs' if params.serviceLinks
|
|
109
|
+
<div class="ons-grid__col ons-col-auto{{ ' ons-u-mr-s ons-u-d-no@xxs@xs' if params.serviceLinks }}">
|
|
98
110
|
{% from "components/language-selector/_macro.njk" import onsLanguageSelector %}
|
|
99
111
|
{{ onsLanguageSelector(params.language) }}
|
|
100
112
|
</div>
|
|
@@ -109,50 +121,60 @@
|
|
|
109
121
|
{% else %}
|
|
110
122
|
{% set controlVisibility = false %}
|
|
111
123
|
{% endif %}
|
|
112
|
-
<div
|
|
113
|
-
|
|
124
|
+
<div
|
|
125
|
+
class="ons-grid__col ons-col-auto{% if controlVisibility == true %}{{ ' ' }}ons-u-d-no@xxs@{{ breakpoint }}{% endif %}"
|
|
126
|
+
>
|
|
127
|
+
<nav
|
|
128
|
+
class="ons-header-service-nav ons-header-service-nav--main{{ ' ' + params.serviceLinks.classes if params.serviceLinks.classes else '' }}"
|
|
129
|
+
aria-label="{{ params.serviceLinks.ariaLabel | default('Service links navigation') }}"
|
|
130
|
+
>
|
|
114
131
|
<ul class="ons-header-service-nav__list">
|
|
115
132
|
{% for item in params.serviceLinks.itemsList %}
|
|
116
133
|
<li class="ons-header-service-nav__item">
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
{%
|
|
132
|
-
|
|
134
|
+
{% if item.iconType %}
|
|
135
|
+
{{-
|
|
136
|
+
onsIcon({
|
|
137
|
+
"iconType": item.iconType
|
|
138
|
+
})
|
|
139
|
+
-}}
|
|
140
|
+
{% endif %}
|
|
141
|
+
{% if item.url %}
|
|
142
|
+
<a
|
|
143
|
+
href="{{ item.url }}"
|
|
144
|
+
class="ons-header-service-nav__link"
|
|
145
|
+
{% if item.id %}id="{{ item.id }}"{% endif %}
|
|
146
|
+
>{% if item.title %}{{ item.title }}{% elif item.text %}{{ item.text }}{% endif %}</a
|
|
147
|
+
>
|
|
148
|
+
{% else %}
|
|
149
|
+
{% if item.title %}{{ item.title }}{% elif item.text %}{{ item.text }}{% endif %}
|
|
150
|
+
{% endif %}
|
|
133
151
|
</li>
|
|
134
152
|
{% endfor %}
|
|
135
153
|
</ul>
|
|
136
154
|
</nav>
|
|
137
155
|
</div>
|
|
138
156
|
{% if params.serviceLinks.itemsList | length > 1 or params.language %}
|
|
139
|
-
{% if params.variants == 'internal'
|
|
157
|
+
{% if params.variants == 'internal' %}
|
|
140
158
|
{% set buttonVariant = ["mobile", "text-link", "text-link-inverse"] %}
|
|
159
|
+
{% elif params.variants == 'neutral' %}
|
|
160
|
+
{% set buttonVariant = ["mobile", "neutral"] %}
|
|
141
161
|
{% else %}
|
|
142
162
|
{% set buttonVariant = ["mobile", "text-link"] %}
|
|
143
163
|
{% endif %}
|
|
144
164
|
<div class="ons-grid__col ons-col-auto ons-u-d-no@{{ breakpoint }}">
|
|
145
|
-
{{
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
"
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
165
|
+
{{
|
|
166
|
+
onsButton({
|
|
167
|
+
"text": params.serviceLinks.toggleServicesButton.text | default("Account"),
|
|
168
|
+
"classes": "ons-u-d-no ons-js-toggle-services",
|
|
169
|
+
"type": "button",
|
|
170
|
+
"variants": buttonVariant,
|
|
171
|
+
"attributes": {
|
|
172
|
+
"aria-label": params.serviceLinks.toggleServicesButton.ariaLabel | default("Toggle menu"),
|
|
173
|
+
"aria-controls": params.serviceLinks.id,
|
|
174
|
+
"aria-expanded": "false"
|
|
175
|
+
}
|
|
176
|
+
})
|
|
177
|
+
}}
|
|
156
178
|
</div>
|
|
157
179
|
{% endif %}
|
|
158
180
|
{% endif %}
|
|
@@ -161,7 +183,11 @@
|
|
|
161
183
|
</div>
|
|
162
184
|
</div>
|
|
163
185
|
{% if params.serviceLinks %}
|
|
164
|
-
<nav
|
|
186
|
+
<nav
|
|
187
|
+
class="ons-header-service-nav ons-header-service-nav--mobile ons-u-d-no ons-js-services-mobile-nav"
|
|
188
|
+
id="{{ params.serviceLinks.id }}"
|
|
189
|
+
aria-label="{{ params.serviceLinks.ariaLabel | default("Service links navigation") }}"
|
|
190
|
+
>
|
|
165
191
|
<ul class="ons-header-service-nav__list">
|
|
166
192
|
{% for item in params.serviceLinks.itemsList %}
|
|
167
193
|
<li class="ons-header-service-nav__item ons-header-service-nav__item--mobile">
|
|
@@ -176,8 +202,9 @@
|
|
|
176
202
|
<a
|
|
177
203
|
href="{{ item.url }}"
|
|
178
204
|
class="ons-header-service-nav__link"
|
|
179
|
-
{% if item.id %}
|
|
180
|
-
|
|
205
|
+
{% if item.id %}id="{{ item.id }}"{% endif %}
|
|
206
|
+
>{% if item.title %}{{ item.title }}{% elif item.text %}{{ item.text }}{% endif %}</a
|
|
207
|
+
>
|
|
181
208
|
{% else %}
|
|
182
209
|
{% if item.title %}{{ item.title }}{% elif item.text %}{{ item.text }}{% endif %}
|
|
183
210
|
{% endif %}
|
|
@@ -193,30 +220,43 @@
|
|
|
193
220
|
</div>
|
|
194
221
|
<div class="ons-header__main">
|
|
195
222
|
<div class="ons-container{{ ' ons-container--full-width' if params.fullWidth }}{{ ' ons-container--wide' if params.wide }}">
|
|
196
|
-
<div
|
|
223
|
+
<div
|
|
224
|
+
class="ons-grid ons-grid--flex ons-grid--between ons-grid--vertical-center ons-grid--no-wrap{{ ' ons-grid--gutterless' if not params.button }}"
|
|
225
|
+
>
|
|
197
226
|
<div class="ons-grid__col ons-col-auto ons-u-flex-shrink">
|
|
198
227
|
{% if params.titleLogo.large %}
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
{% if params.titleLogo.small %}
|
|
206
|
-
<div class="ons-header__title-logo ons-header__title-logo--small ons-u-d-no@s{% if params.titleLogo.classes %} {{ params.titleLogo.classes }}{% endif %}">
|
|
207
|
-
{{ params.titleLogo.small | safe}}
|
|
228
|
+
|
|
229
|
+
{% set title %}
|
|
230
|
+
<div
|
|
231
|
+
class="ons-header__title-logo ons-header__title-logo--large{{ ' ' + params.titleLogo.classes if params.titleLogo.classes else '' }}{{ ' ons-u-d-no@xxs@s' if params.titleLogo.small }}"
|
|
232
|
+
>
|
|
233
|
+
{{ params.titleLogo.large | safe }}
|
|
208
234
|
</div>
|
|
209
|
-
|
|
235
|
+
{% if params.titleLogo.small %}
|
|
236
|
+
<div
|
|
237
|
+
class="ons-header__title-logo ons-header__title-logo--small ons-u-d-no@s{{ ' ' + params.titleLogo.classes if params.titleLogo.classes else '' }}"
|
|
238
|
+
>
|
|
239
|
+
{{ params.titleLogo.small | safe }}
|
|
240
|
+
</div>
|
|
241
|
+
{% endif %}
|
|
242
|
+
{% endset %}
|
|
243
|
+
|
|
210
244
|
{% if params.titleUrl %}
|
|
211
|
-
</a>
|
|
245
|
+
<a class="ons-header__title-logo-link" href="{{ params.titleUrl }}">{{ title | safe }}</a>
|
|
246
|
+
{% else %}
|
|
247
|
+
{{ title | safe }}
|
|
212
248
|
{% endif %}
|
|
213
249
|
{% else %}
|
|
250
|
+
|
|
251
|
+
{% set title %}
|
|
252
|
+
{{ openingTag | safe }}
|
|
253
|
+
class="ons-header__title">{{ params.title }}{{ closingTag | safe }}
|
|
254
|
+
{% endset %}
|
|
255
|
+
|
|
214
256
|
{% if params.titleUrl %}
|
|
215
|
-
<a class="ons-header__title-link" href="{{ params.titleUrl }}">
|
|
216
|
-
{%
|
|
217
|
-
|
|
218
|
-
{% if params.titleUrl %}
|
|
219
|
-
</a>
|
|
257
|
+
<a class="ons-header__title-link" href="{{ params.titleUrl }}">{{ title | safe }}</a>
|
|
258
|
+
{% else %}
|
|
259
|
+
{{ title | safe }}
|
|
220
260
|
{% endif %}
|
|
221
261
|
{% endif %}
|
|
222
262
|
{% if params.description %}
|
|
@@ -231,16 +271,18 @@
|
|
|
231
271
|
{% set buttonVariant = "ghost" %}
|
|
232
272
|
{% endif %}
|
|
233
273
|
<div class="ons-grid__col ons-col-auto ons-u-flex-no-shrink">
|
|
234
|
-
{{
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
274
|
+
{{
|
|
275
|
+
onsButton({
|
|
276
|
+
"text": params.button.text,
|
|
277
|
+
"classes": "ons-u-d-no@xxs@l" if params.navigation else "ons-u-d-no@xxs@m",
|
|
278
|
+
"variants": buttonVariant,
|
|
279
|
+
"name": params.button.name,
|
|
280
|
+
"attributes": params.button.attributes,
|
|
281
|
+
"url": params.button.url,
|
|
282
|
+
"iconType": "exit",
|
|
283
|
+
"iconPosition": "after"
|
|
284
|
+
})
|
|
285
|
+
}}
|
|
244
286
|
</div>
|
|
245
287
|
{% endif %}
|
|
246
288
|
{% if params.navigation or params.siteSearchAutosuggest %}
|
|
@@ -252,36 +294,36 @@
|
|
|
252
294
|
{% set buttonVariant = ["small", "ghost"] %}
|
|
253
295
|
{% endif %}
|
|
254
296
|
<span class="ons-grid ons-u-d-no@xxs@xs ons-u-ml-no ons-u-d-no@l">
|
|
255
|
-
{{
|
|
256
|
-
|
|
257
|
-
|
|
297
|
+
{{
|
|
298
|
+
onsButton({
|
|
299
|
+
"text": "Search",
|
|
300
|
+
"classes": "ons-btn--search ons-u-ml-xs ons-u-d-no ons-js-toggle-search",
|
|
301
|
+
"variants": buttonVariant,
|
|
302
|
+
"iconType": "search",
|
|
303
|
+
"iconPosition": "only",
|
|
304
|
+
"attributes": {
|
|
305
|
+
"aria-label": "Toggle search" ,
|
|
306
|
+
"aria-controls": "ons-site-search",
|
|
307
|
+
"aria-expanded": "false"
|
|
308
|
+
}
|
|
309
|
+
})
|
|
310
|
+
}}
|
|
311
|
+
</span>
|
|
312
|
+
{% endif %}
|
|
313
|
+
{% if params.navigation.toggleNavigationButton %}
|
|
314
|
+
{% set buttonVariant = ["mobile", "ghost"] %}
|
|
315
|
+
{{
|
|
316
|
+
onsButton({
|
|
317
|
+
"text": params.navigation.toggleNavigationButton.text,
|
|
318
|
+
"classes": "ons-u-ml-xs ons-u-d-no ons-js-navigation-button ons-u-d-no@l",
|
|
258
319
|
"variants": buttonVariant,
|
|
259
|
-
"iconType": "search",
|
|
260
|
-
"iconPosition": "only",
|
|
261
320
|
"attributes": {
|
|
262
|
-
"aria-label": "Toggle
|
|
263
|
-
"aria-controls":
|
|
321
|
+
"aria-label": params.navigation.toggleNavigationButton.ariaLabel | default("Toggle main menu") ,
|
|
322
|
+
"aria-controls": params.navigation.id,
|
|
264
323
|
"aria-expanded": "false"
|
|
265
324
|
}
|
|
266
|
-
})
|
|
267
|
-
|
|
268
|
-
{% endif %}
|
|
269
|
-
{% if params.navigation.toggleNavigationButton %}
|
|
270
|
-
{% if params.variants == 'neutral' %}
|
|
271
|
-
{% set buttonVariant = ["mobile", "ghost-dark"] %}
|
|
272
|
-
{% else %}
|
|
273
|
-
{% set buttonVariant = ["mobile", "ghost"] %}
|
|
274
|
-
{% endif %}
|
|
275
|
-
{{ onsButton({
|
|
276
|
-
"text": params.navigation.toggleNavigationButton.text,
|
|
277
|
-
"classes": "ons-u-ml-xs ons-u-d-no ons-js-navigation-button ons-u-d-no@l",
|
|
278
|
-
"variants": buttonVariant,
|
|
279
|
-
"attributes": {
|
|
280
|
-
"aria-label": params.navigation.toggleNavigationButton.ariaLabel | default("Toggle main menu") ,
|
|
281
|
-
"aria-controls": params.navigation.id,
|
|
282
|
-
"aria-expanded": "false"
|
|
283
|
-
}
|
|
284
|
-
}) }}
|
|
325
|
+
})
|
|
326
|
+
}}
|
|
285
327
|
{% endif %}
|
|
286
328
|
</div>
|
|
287
329
|
{% endif %}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
---
|
|
2
2
|
fullWidth: true
|
|
3
|
-
layout: ~
|
|
4
3
|
---
|
|
5
|
-
{% extends "layout/_template.njk" %}
|
|
6
4
|
|
|
7
|
-
{%
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
{% from "components/header/_macro.njk" import onsHeader %}
|
|
6
|
+
|
|
7
|
+
{{
|
|
8
|
+
onsHeader({
|
|
10
9
|
"title": 'Gwasanaeth Cymraeg',
|
|
11
10
|
"titleUrl": '#0',
|
|
11
|
+
"mastheadLogoUrl": '#0',
|
|
12
12
|
"language": {
|
|
13
13
|
"languages": [
|
|
14
14
|
{
|
|
@@ -25,5 +25,5 @@ layout: ~
|
|
|
25
25
|
}
|
|
26
26
|
]
|
|
27
27
|
}
|
|
28
|
-
}
|
|
29
|
-
}
|
|
28
|
+
})
|
|
29
|
+
}}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
---
|
|
2
|
-
|
|
2
|
+
'fullWidth': true
|
|
3
3
|
---
|
|
4
|
+
|
|
4
5
|
{% from "components/header/_macro.njk" import onsHeader %}
|
|
5
6
|
|
|
6
7
|
{{
|
|
@@ -38,7 +39,7 @@
|
|
|
38
39
|
"ariaLabel": 'Toggle main menu'
|
|
39
40
|
}
|
|
40
41
|
},
|
|
41
|
-
|
|
42
|
+
"siteSearchAutosuggest": {
|
|
42
43
|
"autosuggestData": "/examples/data/country-of-birth.json",
|
|
43
44
|
"label": "search",
|
|
44
45
|
"instructions": "instructions",
|
|
@@ -1,19 +1,20 @@
|
|
|
1
|
-
{% macro
|
|
2
|
-
{% if params.container -%}
|
|
3
|
-
<div class="ons-container">
|
|
4
|
-
{% endif -%}
|
|
1
|
+
{% macro dsExampleGrid(params) %}
|
|
5
2
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
{
|
|
9
|
-
|
|
10
|
-
<div class="ons-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
{% if params.container -%}
|
|
3
|
+
{% set grid %}
|
|
4
|
+
<div class="ons-grid">
|
|
5
|
+
{%- for item in (params.itemsList if params.itemsList is iterable else params.itemsList.items()) -%}
|
|
6
|
+
{%- for i in range(0, item.repeat | default(1) ) -%}
|
|
7
|
+
<div class="ons-grid__col ons-col-{{ item.col }}@m {{ item.classes }}">
|
|
8
|
+
<div class="ons-pl-grid-col">{{ item.col }} col</div>
|
|
9
|
+
</div>
|
|
10
|
+
{%- endfor -%}
|
|
11
|
+
{%- endfor -%}
|
|
17
12
|
</div>
|
|
18
|
-
{%
|
|
13
|
+
{% endset %}
|
|
14
|
+
|
|
15
|
+
{%- if params.container -%}
|
|
16
|
+
<div class="ons-container">{{ grid | safe }}</div>
|
|
17
|
+
{% else %}
|
|
18
|
+
{{ grid | safe }}
|
|
19
|
+
{%- endif -%}
|
|
19
20
|
{% endmacro %}
|