@ons/design-system 70.0.17 → 72.0.1
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 +4 -4
- package/components/access-code/_macro.spec.js +8 -8
- package/components/access-code/example-access-code-error.njk +2 -2
- package/components/access-code/example-access-code.njk +2 -2
- package/components/accordion/_macro.njk +1 -1
- package/components/accordion/_macro.spec.js +1 -1
- package/components/address-input/_macro.njk +7 -7
- package/components/address-input/_macro.spec.js +16 -15
- package/components/address-input/autosuggest.address.error.js +1 -1
- package/components/address-input/autosuggest.address.js +25 -25
- package/components/address-input/autosuggest.address.spec.js +6 -5
- package/components/address-input/example-address-input-editable.njk +5 -4
- package/components/address-input/example-address-input.njk +4 -5
- package/components/autosuggest/_autosuggest.scss +8 -8
- package/components/autosuggest/_macro.njk +5 -5
- package/components/autosuggest/autosuggest.spec.js +1 -1
- package/components/back-to-top/_back-to-top.scss +2 -2
- package/components/back-to-top/example-full-page-back-to-top.njk +6 -6
- package/components/breadcrumbs/_breadcrumbs.scss +1 -1
- package/components/button/_button.scss +24 -16
- package/components/button/_macro.njk +3 -3
- package/components/button/example-button-custom.njk +1 -1
- package/components/card/_card.scss +0 -6
- package/components/card/_macro.njk +9 -9
- package/components/card/_macro.spec.js +57 -24
- package/components/card/example-card-set-with-images.njk +30 -18
- package/components/card/example-card-set-with-lists.njk +57 -45
- package/components/card/example-card-set.njk +27 -15
- package/components/card/example-card.njk +9 -5
- package/components/char-check-limit/_macro.njk +1 -1
- package/components/checkboxes/_checkbox.scss +4 -4
- package/components/checkboxes/_checkboxes.scss +1 -1
- package/components/checkboxes/example-checkboxes-with-hidden-label.njk +4 -4
- package/components/cookies-banner/_cookies-banner.scss +5 -5
- package/components/cookies-banner/_macro.njk +15 -13
- package/components/cookies-banner/_macro.spec.js +1 -1
- package/components/details/_details.scss +5 -6
- package/components/details/_macro.njk +4 -4
- package/components/details/_macro.spec.js +1 -1
- package/components/document-list/_document-list.scss +0 -2
- package/components/document-list/_macro.njk +18 -18
- package/components/document-list/_macro.spec.js +16 -14
- package/components/document-list/example-document-list-article-featured.njk +5 -3
- package/components/document-list/example-document-list-articles.njk +15 -9
- package/components/document-list/example-document-list-downloads.njk +15 -9
- package/components/document-list/example-document-list-search-result-featured.njk +5 -3
- package/components/document-list/example-document-list-search-results.njk +20 -12
- package/components/download-resources/_download-resources.scss +1 -2
- package/components/download-resources/download-resources.spec.js +12 -6
- package/components/external-link/_macro.njk +1 -1
- package/components/external-link/_macro.spec.js +1 -1
- package/components/external-link/example-external-link.njk +1 -1
- package/components/feedback/_macro.njk +1 -1
- package/components/feedback/_macro.spec.js +3 -3
- package/components/feedback/example-feedback-call-to-action.njk +1 -1
- package/components/field/_field-group.scss +0 -2
- package/components/field/_field.scss +1 -2
- package/components/fieldset/_fieldset.scss +2 -2
- package/components/fieldset/_macro.njk +1 -1
- package/components/fieldset/_macro.spec.js +1 -1
- package/components/footer/_footer.scss +12 -7
- package/components/footer/_macro.njk +54 -34
- package/components/footer/_macro.spec.js +90 -28
- package/components/footer/example-footer-cymraeg.njk +1 -1
- package/components/footer/example-footer-transactional.njk +1 -1
- package/components/footer/example-footer-warning.njk +1 -1
- package/components/footer/example-footer-with-alternative-organisation.njk +99 -94
- package/components/footer/example-footer-with-coat-of-arms.njk +1 -1
- package/components/footer/example-footer-with-copyright.njk +1 -1
- package/components/footer/example-footer-with-multiple-logos-and-split-display.njk +173 -0
- package/components/footer/example-footer-with-multiple-logos.njk +172 -0
- package/components/footer/example-footer.njk +1 -1
- package/components/header/_header.scss +7 -14
- package/components/header/_macro.njk +19 -19
- package/components/header/_macro.spec.js +17 -17
- package/components/header/example-header-external-for-surveys.njk +2 -2
- package/components/header/example-header-external-welsh.njk +2 -2
- package/components/header/example-header-external-with-sub-navigation-removed.njk +1 -1
- package/components/header/example-header-external-with-sub-navigation.njk +1 -1
- package/components/header/example-header-multiple-logos.njk +4 -4
- package/components/hero/_hero.scss +6 -8
- package/components/hero/_macro.njk +1 -1
- package/components/icon/_icon.scss +4 -4
- package/components/icon/_macro.njk +4 -4
- package/components/icon/_macro.spec.js +2 -2
- package/components/image/_image.scss +1 -1
- package/components/image/_macro.njk +1 -1
- package/components/image/_macro.spec.js +10 -10
- package/components/image/example-image-for-regular-screens.njk +1 -1
- package/components/input/_input-type.scss +0 -2
- package/components/input/_input.scss +10 -10
- package/components/input/_macro.njk +4 -2
- package/components/input/example-input-search-with-character-check.njk +1 -1
- package/components/input/example-input-search.njk +1 -1
- package/components/label/_label.scss +1 -3
- package/components/language-selector/_macro.njk +3 -3
- package/components/language-selector/_macro.spec.js +7 -7
- package/components/list/_list.scss +1 -5
- package/components/list/_macro.njk +9 -10
- package/components/list/_macro.spec.js +50 -9
- package/components/list/example-inline-list-with-social-icon-prefix.njk +1 -1
- package/components/message/_macro.njk +3 -3
- package/components/message/_macro.spec.js +3 -3
- package/components/message-list/_macro.njk +2 -2
- package/components/message-list/_macro.spec.js +8 -4
- package/components/message-list/_message-list.scss +2 -2
- package/components/navigation/_macro.njk +9 -9
- package/components/navigation/_macro.spec.js +2 -2
- package/components/navigation/_navigation.scss +2 -6
- package/components/navigation/navigation.dom.js +1 -1
- package/components/navigation/navigation.spec.js +4 -4
- package/components/pagination/_macro.njk +2 -2
- package/components/pagination/_pagination.scss +1 -7
- package/components/panel/_macro.njk +5 -4
- package/components/panel/_macro.spec.js +2 -2
- package/components/panel/_panel.scss +12 -8
- package/components/password/_macro.njk +1 -1
- package/components/password/_macro.spec.js +2 -2
- package/components/phase-banner/_macro.njk +1 -1
- package/components/phase-banner/_phase-banner.scss +3 -4
- package/components/phase-banner/example-phase-banner-alpha.njk +1 -1
- package/components/phase-banner/example-phase-banner-beta.njk +1 -1
- package/components/question/_macro.njk +8 -8
- package/components/question/_macro.spec.js +3 -3
- package/components/question/_question.scss +3 -3
- package/components/radios/_macro.njk +1 -1
- package/components/radios/_macro.spec.js +1 -1
- package/components/radios/_radios.scss +1 -1
- package/components/radios/example-radios-with-clear-button-expanded.njk +1 -1
- package/components/radios/example-radios-with-clear-button.njk +1 -1
- package/components/related-content/_macro.spec.js +2 -2
- package/components/related-content/_related-content.scss +1 -1
- package/components/related-content/example-related-content-general.njk +2 -2
- package/components/related-content/example-related-content-social-media.njk +1 -1
- package/components/reply/_macro.njk +3 -1
- package/components/reply/_macro.spec.js +1 -1
- package/components/reply/reply.spec.js +1 -1
- package/components/section-navigation/_macro.njk +10 -10
- package/components/section-navigation/_macro.spec.js +15 -15
- package/components/section-navigation/_section-navigation.scss +4 -10
- package/components/section-navigation/example-section-navigation-single-vertical-with-title.njk +3 -3
- package/components/section-navigation/example-section-navigation-vertical.njk +14 -14
- package/components/section-navigation/example-section-navigation.njk +3 -3
- package/components/select/example-select-with-inline-label.njk +1 -1
- package/components/share-page/_macro.njk +7 -7
- package/components/share-page/_macro.spec.js +2 -2
- package/components/share-page/example-share-page.njk +1 -1
- package/components/status/_status.scss +1 -1
- package/components/summary/_macro.njk +33 -33
- package/components/summary/_macro.spec.js +34 -34
- package/components/summary/_summary.scss +2 -4
- package/components/summary/example-summary-card-grouped.njk +34 -34
- package/components/summary/example-summary-grouped-total.njk +7 -7
- package/components/summary/example-summary-grouped-with-errors.njk +9 -9
- package/components/summary/example-summary-grouped.njk +34 -34
- package/components/summary/example-summary-household.njk +7 -7
- package/components/summary/example-summary-hub-minimal.njk +8 -8
- package/components/summary/example-summary-hub.njk +16 -16
- package/components/summary/example-summary-multiple.njk +7 -7
- package/components/summary/example-summary-no-action.njk +5 -5
- package/components/summary/example-summary.njk +9 -9
- package/components/table/_table.scss +2 -3
- package/components/table-of-contents/_macro.njk +3 -3
- package/components/table-of-contents/_macro.spec.js +3 -3
- package/components/table-of-contents/example-table-of-contents-sticky-full-page.njk +1 -1
- package/components/tabs/_macro.njk +3 -3
- package/components/tabs/_macro.spec.js +3 -3
- package/components/tabs/_tabs.scss +3 -4
- package/components/tabs/example-tabs-details.njk +1 -1
- package/components/text-indent/_text-indent.scss +1 -1
- package/components/timeline/_macro.njk +4 -4
- package/components/timeline/_macro.spec.js +3 -3
- package/components/timeline/_timeline.scss +4 -3
- package/components/timeline/example-timeline.njk +1 -1
- package/components/upload/_upload.scss +2 -2
- package/components/video/_macro.njk +4 -4
- package/components/video/_macro.spec.js +2 -2
- package/components/video/_video.scss +1 -1
- package/components/video/example-video.njk +2 -2
- package/components/video/video.spec.js +2 -2
- package/css/main.css +1 -1
- package/layout/_dsTemplate.njk +1 -1
- package/layout/_template.njk +31 -31
- package/package.json +4 -5
- package/scripts/main.es5.js +1 -1
- package/scripts/main.js +1 -1
- package/scss/base/_global.scss +2 -0
- package/scss/base/_typography.scss +0 -2
- package/scss/main.scss +0 -1
- package/scss/objects/_container.scss +1 -1
- package/scss/objects/_page.scss +2 -3
- package/scss/overrides/rtl.scss +1 -1
- package/scss/utilities/_grid.scss +103 -96
- package/scss/utilities/_margin.scss +11 -5
- package/scss/utilities/_padding.scss +12 -5
- package/scss/utilities/_typography.scss +2 -1
- package/scss/vars/_forms.scss +8 -10
- package/scss/vars/_grid.scss +4 -4
- package/scss/vars/_typography.scss +26 -19
- package/components/call-to-action/_call-to-action.scss +0 -8
- package/components/call-to-action/_macro.njk +0 -24
- package/components/call-to-action/_macro.spec.js +0 -48
- package/components/call-to-action/example-call-to-action-default.njk +0 -15
- package/components/metadata/_macro.njk +0 -14
|
@@ -16,14 +16,14 @@
|
|
|
16
16
|
{{- params.description | safe -}}
|
|
17
17
|
</div>
|
|
18
18
|
{% elif params.legendIsQuestionTitle is not defined %}
|
|
19
|
-
<div class="ons-question__description ons-u-mb-
|
|
19
|
+
<div class="ons-question__description ons-u-mb-l">{{- params.description | safe -}}</div>
|
|
20
20
|
{% else %}
|
|
21
21
|
{{- params.description | safe -}}
|
|
22
22
|
{%- endif -%}
|
|
23
23
|
{%- endset -%}
|
|
24
24
|
|
|
25
25
|
{% set instHtml %}
|
|
26
|
-
<div class="ons-question__instruction ons-u-mb-
|
|
26
|
+
<div class="ons-question__instruction ons-u-mb-l">{{ params.instruction | safe }}</div>
|
|
27
27
|
{% endset %}
|
|
28
28
|
|
|
29
29
|
{% if params.definition %}
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
{%
|
|
33
33
|
call onsDetails({
|
|
34
34
|
"id": params.definition.id,
|
|
35
|
-
"classes": 'ons-u-mb-
|
|
35
|
+
"classes": 'ons-u-mb-l',
|
|
36
36
|
"title": params.definition.title,
|
|
37
37
|
"headingAttributes": params.definition.headingAttributes,
|
|
38
38
|
"contentAttributes": params.definition.contentAttributes
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
{%
|
|
52
52
|
call onsPanel({
|
|
53
53
|
"id": params.guidance.id,
|
|
54
|
-
"classes": "ons-question-guidance ons-u-mb-
|
|
54
|
+
"classes": "ons-question-guidance ons-u-mb-l",
|
|
55
55
|
"attributes": params.guidance.attributes
|
|
56
56
|
})
|
|
57
57
|
%}
|
|
@@ -80,7 +80,7 @@
|
|
|
80
80
|
|
|
81
81
|
<div
|
|
82
82
|
{% if params.id %}id="{{ params.id }}"{% endif %}
|
|
83
|
-
class="ons-question ons-u-mb-
|
|
83
|
+
class="ons-question ons-u-mb-xl{{ ' ' + params.classes if params.classes else '' }}"
|
|
84
84
|
{% if params.attributes %}{% for attribute, value in (params.attributes.items() if params.attributes is mapping and params.attributes.items else params.attributes) %}{{ ' ' }}{{ attribute }}{% if value %}="{{ value }}"{% endif %}{% endfor %}{% endif %}
|
|
85
85
|
>
|
|
86
86
|
{% set additionalContent %}
|
|
@@ -114,7 +114,7 @@
|
|
|
114
114
|
|
|
115
115
|
{# Resolves caller issue in Jinja: https://github.com/pallets/jinja/issues/371 #}
|
|
116
116
|
{% set content = caller() if caller %}
|
|
117
|
-
<div class="ons-question__answer ons-u-mb-
|
|
117
|
+
<div class="ons-question__answer ons-u-mb-l">
|
|
118
118
|
{%
|
|
119
119
|
call onsFieldset({
|
|
120
120
|
"legendIsQuestionTitle": params.legendIsQuestionTitle,
|
|
@@ -137,7 +137,7 @@
|
|
|
137
137
|
|
|
138
138
|
{{- additionalContent | safe -}}
|
|
139
139
|
|
|
140
|
-
<div class="ons-question__answer ons-u-mb-
|
|
140
|
+
<div class="ons-question__answer ons-u-mb-l">{{ caller() if caller }}</div>
|
|
141
141
|
{% endif %}
|
|
142
142
|
|
|
143
143
|
{% if params.justification %}
|
|
@@ -145,7 +145,7 @@
|
|
|
145
145
|
{%
|
|
146
146
|
call onsDetails({
|
|
147
147
|
"id": params.justification.id,
|
|
148
|
-
"classes": 'ons-u-mb-
|
|
148
|
+
"classes": 'ons-u-mb-l',
|
|
149
149
|
"title": params.justification.title | default('Why we ask this question'),
|
|
150
150
|
"headingAttributes": params.justification.headingAttributes,
|
|
151
151
|
"contentAttributes": params.justification.contentAttributes
|
|
@@ -187,7 +187,7 @@ describe('macro: question', () => {
|
|
|
187
187
|
|
|
188
188
|
faker.renderComponent('question', EXAMPLE_QUESTION_DEFINITION);
|
|
189
189
|
|
|
190
|
-
expect(detailsSpy.occurrences[0]).toHaveProperty('classes', 'ons-u-mb-
|
|
190
|
+
expect(detailsSpy.occurrences[0]).toHaveProperty('classes', 'ons-u-mb-l');
|
|
191
191
|
expect(detailsSpy.occurrences[0]).toHaveProperty('id', 'definition-id');
|
|
192
192
|
expect(detailsSpy.occurrences[0]).toHaveProperty('title', 'Definition title');
|
|
193
193
|
});
|
|
@@ -206,7 +206,7 @@ describe('macro: question', () => {
|
|
|
206
206
|
|
|
207
207
|
faker.renderComponent('question', EXAMPLE_QUESTION_GUIDANCE);
|
|
208
208
|
|
|
209
|
-
expect(panelSpy.occurrences[0]).toHaveProperty('classes', 'ons-question-guidance ons-u-mb-
|
|
209
|
+
expect(panelSpy.occurrences[0]).toHaveProperty('classes', 'ons-question-guidance ons-u-mb-l');
|
|
210
210
|
});
|
|
211
211
|
|
|
212
212
|
it('outputs the expected panel call content', () => {
|
|
@@ -251,7 +251,7 @@ describe('macro: question', () => {
|
|
|
251
251
|
|
|
252
252
|
faker.renderComponent('question', EXAMPLE_QUESTION_JUSTIFICATION);
|
|
253
253
|
|
|
254
|
-
expect(detailsSpy.occurrences[0]).toHaveProperty('classes', 'ons-u-mb-
|
|
254
|
+
expect(detailsSpy.occurrences[0]).toHaveProperty('classes', 'ons-u-mb-l');
|
|
255
255
|
expect(detailsSpy.occurrences[0]).toHaveProperty('id', 'justification-id');
|
|
256
256
|
expect(detailsSpy.occurrences[0]).toHaveProperty('title', 'Justification title');
|
|
257
257
|
});
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
margin: 1rem 0 0;
|
|
3
3
|
|
|
4
4
|
&__title {
|
|
5
|
-
@extend .ons-u-mb-
|
|
5
|
+
@extend .ons-u-mb-l;
|
|
6
6
|
|
|
7
7
|
mark,
|
|
8
8
|
.ons-instruction {
|
|
@@ -16,13 +16,13 @@
|
|
|
16
16
|
|
|
17
17
|
&__description {
|
|
18
18
|
p:last-of-type {
|
|
19
|
-
|
|
19
|
+
@extend .ons-u-mb-no;
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
&__instruction {
|
|
24
24
|
background-color: var(--ons-color-instruction-tint);
|
|
25
|
-
border:
|
|
25
|
+
border: 4px solid var(--ons-color-instruction);
|
|
26
26
|
display: block;
|
|
27
27
|
font-weight: $font-weight-regular;
|
|
28
28
|
padding: 1rem;
|
|
@@ -117,7 +117,7 @@
|
|
|
117
117
|
"name": radio.other.name,
|
|
118
118
|
"borderless": true,
|
|
119
119
|
"legend": radio.other.legend,
|
|
120
|
-
"legendClasses": radio.other.legendClasses | default('') + ' ons-u-mb-
|
|
120
|
+
"legendClasses": radio.other.legendClasses | default('') + ' ons-u-mb-2xs',
|
|
121
121
|
"attributes": radio.other.attributes,
|
|
122
122
|
"classes": "ons-js-other-fieldset-radio",
|
|
123
123
|
"radios": radio.other.radios
|
|
@@ -541,7 +541,7 @@ describe('macro: radios', () => {
|
|
|
541
541
|
name: 'example-radios-name',
|
|
542
542
|
borderless: true,
|
|
543
543
|
legend: 'Select preferred times of day',
|
|
544
|
-
legendClasses: 'extra-legend-class ons-u-mb-
|
|
544
|
+
legendClasses: 'extra-legend-class ons-u-mb-2xs',
|
|
545
545
|
attributes: { a: 42 },
|
|
546
546
|
classes: 'ons-js-other-fieldset-radio',
|
|
547
547
|
radios: EXAMPLE_RADIO_ITEM_RADIOS.other.radios,
|
|
@@ -27,7 +27,7 @@ const EXAMPLE_RELATED_CONTENT_LINKS = {
|
|
|
27
27
|
id: 'related-links',
|
|
28
28
|
title: 'Related links',
|
|
29
29
|
iconPosition: 'after',
|
|
30
|
-
iconSize: '
|
|
30
|
+
iconSize: '2xl',
|
|
31
31
|
itemsList: [
|
|
32
32
|
{ text: 'A', url: '/article/a' },
|
|
33
33
|
{ text: 'B', url: '/article/b' },
|
|
@@ -121,7 +121,7 @@ describe('macro: related-content', () => {
|
|
|
121
121
|
]);
|
|
122
122
|
|
|
123
123
|
expect(listsSpy.occurrences[1]).toHaveProperty('iconPosition', 'after');
|
|
124
|
-
expect(listsSpy.occurrences[1]).toHaveProperty('iconSize', '
|
|
124
|
+
expect(listsSpy.occurrences[1]).toHaveProperty('iconSize', '2xl');
|
|
125
125
|
expect(listsSpy.occurrences[1]).toHaveProperty('itemsList', [
|
|
126
126
|
{ text: 'A', url: '/article/a' },
|
|
127
127
|
{ text: 'B', url: '/article/b' },
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
})
|
|
9
9
|
%}
|
|
10
10
|
{% call onsRelatedContentSection() %}
|
|
11
|
-
<p class="ons-u-mb-
|
|
11
|
+
<p class="ons-u-mb-2xs">Telephone: 0800 587 2021</p>
|
|
12
12
|
|
|
13
13
|
{{
|
|
14
14
|
onsList({
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
}}
|
|
27
27
|
{% endcall %}
|
|
28
28
|
{% call onsRelatedContentSection() %}
|
|
29
|
-
<p class="ons-u-mb-
|
|
29
|
+
<p class="ons-u-mb-2xs">Live chat</p>
|
|
30
30
|
|
|
31
31
|
{{
|
|
32
32
|
onsList({
|
|
@@ -14,7 +14,9 @@
|
|
|
14
14
|
"rows": params.textarea.rows
|
|
15
15
|
})
|
|
16
16
|
}}
|
|
17
|
-
<div
|
|
17
|
+
<div
|
|
18
|
+
class="ons-grid ons-grid-flex ons-grid--gutterless ons-grid-flex--vertical-center ons-grid-flex--no-wrap@s ons-u-mt-l ons-u-mb-l"
|
|
19
|
+
>
|
|
18
20
|
<div class="ons-grid__col ons-u-mr-m ons-u-mb-s">
|
|
19
21
|
{{
|
|
20
22
|
onsButton({
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
{% endif %}
|
|
23
23
|
<ul class="ons-section-nav__list">
|
|
24
24
|
{% for item in section.itemsList %}
|
|
25
|
-
{% if (params.currentPath and item.url == params.currentPath) or (params.tabQuery and params.tabQuery == item.
|
|
25
|
+
{% if (params.currentPath and item.url == params.currentPath) or (params.tabQuery and params.tabQuery == item.text | lower) %}
|
|
26
26
|
{% set isCurrent = true %}
|
|
27
27
|
{% else %}
|
|
28
28
|
{% set isCurrent = false %}
|
|
@@ -33,16 +33,16 @@
|
|
|
33
33
|
{% if isCurrent == true %}
|
|
34
34
|
{{ openingHeadingTag | replace(headingLevel, sectionItemHeadingLevel | string) | safe }}
|
|
35
35
|
class="ons-section-nav__link ons-section-nav__item-header" href="{{ item.url }}"
|
|
36
|
-
aria-current="location">{{ item.
|
|
36
|
+
aria-current="location">{{ item.text }}{{ closingHeadingTag | replace(headingLevel, sectionItemHeadingLevel | string) | safe }}
|
|
37
37
|
{% else %}
|
|
38
|
-
<a class="ons-section-nav__link" href="{{ item.url }}">{{ item.
|
|
38
|
+
<a class="ons-section-nav__link" href="{{ item.url }}">{{ item.text }}</a>
|
|
39
39
|
{% endif %}
|
|
40
40
|
{% if item.anchors and isCurrent == true %}
|
|
41
|
-
<ul class="ons-section-nav__sub-items ons-list ons-list--dashed ons-u-mt-
|
|
41
|
+
<ul class="ons-section-nav__sub-items ons-list ons-list--dashed ons-u-mt-2xs ons-u-mb-2xs">
|
|
42
42
|
{% for anchor in item.anchors %}
|
|
43
43
|
<li class="ons-section-nav__item ons-list__item">
|
|
44
44
|
<a href="{{ anchor.url }}" class="ons-section-nav__link ons-list__link"
|
|
45
|
-
>{{ anchor.
|
|
45
|
+
>{{ anchor.text }}</a
|
|
46
46
|
>
|
|
47
47
|
</li>
|
|
48
48
|
{% endfor %}
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
<ul class="ons-section-nav__list">
|
|
63
63
|
{% for item in params.itemsList %}
|
|
64
64
|
{% set sectionItemHeadingLevel = headingLevel + 2 if params.title else headingLevel + 1 %}
|
|
65
|
-
{% if (params.currentPath and item.url == params.currentPath) or (params.tabQuery and params.tabQuery == item.
|
|
65
|
+
{% if (params.currentPath and item.url == params.currentPath) or (params.tabQuery and params.tabQuery == item.text | lower) %}
|
|
66
66
|
{% set isCurrent = true %}
|
|
67
67
|
{% else %}
|
|
68
68
|
{% set isCurrent = false %}
|
|
@@ -73,15 +73,15 @@
|
|
|
73
73
|
{% if isCurrent == true %}
|
|
74
74
|
{{ openingHeadingTag | replace(headingLevel, sectionItemHeadingLevel | string) | safe }}
|
|
75
75
|
class="ons-section-nav__link ons-section-nav__item-header" href="{{ item.url }}"
|
|
76
|
-
aria-current="location">{{ item.
|
|
76
|
+
aria-current="location">{{ item.text }}{{ closingHeadingTag | replace(headingLevel, sectionItemHeadingLevel | string) | safe }}
|
|
77
77
|
{% else %}
|
|
78
|
-
<a class="ons-section-nav__link" href="{{ item.url }}">{{ item.
|
|
78
|
+
<a class="ons-section-nav__link" href="{{ item.url }}">{{ item.text }}</a>
|
|
79
79
|
{% endif %}
|
|
80
80
|
{% if item.anchors %}
|
|
81
|
-
<ul class="ons-section-nav__sub-items ons-list ons-list--dashed ons-u-mt-
|
|
81
|
+
<ul class="ons-section-nav__sub-items ons-list ons-list--dashed ons-u-mt-2xs ons-u-mb-2xs">
|
|
82
82
|
{% for anchor in item.anchors %}
|
|
83
83
|
<li class="ons-section-nav__item ons-list__item">
|
|
84
|
-
<a href="{{ anchor.url }}" class="ons-section-nav__link ons-list__link">{{ anchor.
|
|
84
|
+
<a href="{{ anchor.url }}" class="ons-section-nav__link ons-list__link">{{ anchor.text }}</a>
|
|
85
85
|
</li>
|
|
86
86
|
{% endfor %}
|
|
87
87
|
</ul>
|
|
@@ -11,11 +11,11 @@ const EXAMPLE_SECTION_NAVIGATION = {
|
|
|
11
11
|
currentPath: '/results',
|
|
12
12
|
itemsList: [
|
|
13
13
|
{
|
|
14
|
-
|
|
14
|
+
text: 'Results',
|
|
15
15
|
url: '/results',
|
|
16
16
|
},
|
|
17
17
|
{
|
|
18
|
-
|
|
18
|
+
text: 'Dashboard',
|
|
19
19
|
url: '/results/dashboard',
|
|
20
20
|
},
|
|
21
21
|
],
|
|
@@ -26,29 +26,29 @@ const EXAMPLE_SECTION_NAVIGATION_VERTICAL = {
|
|
|
26
26
|
currentPath: '#section-2',
|
|
27
27
|
itemsList: [
|
|
28
28
|
{
|
|
29
|
-
|
|
29
|
+
text: 'Section 1',
|
|
30
30
|
url: '#section-1',
|
|
31
31
|
},
|
|
32
32
|
{
|
|
33
|
-
|
|
33
|
+
text: 'Section 2',
|
|
34
34
|
url: '#section-2',
|
|
35
35
|
anchors: [
|
|
36
36
|
{
|
|
37
|
-
|
|
37
|
+
text: 'Sub section 1',
|
|
38
38
|
url: '#sub-section-1',
|
|
39
39
|
},
|
|
40
40
|
{
|
|
41
|
-
|
|
41
|
+
text: 'Sub section 2',
|
|
42
42
|
url: '#sub-section-2',
|
|
43
43
|
},
|
|
44
44
|
{
|
|
45
|
-
|
|
45
|
+
text: 'Sub section 3',
|
|
46
46
|
url: '#sub-section-3',
|
|
47
47
|
},
|
|
48
48
|
],
|
|
49
49
|
},
|
|
50
50
|
{
|
|
51
|
-
|
|
51
|
+
text: 'Section 3',
|
|
52
52
|
url: '#0',
|
|
53
53
|
},
|
|
54
54
|
],
|
|
@@ -62,29 +62,29 @@ const EXAMPLE_SECTION_NAVIGATION_VERTICAL_WITH_SECTIONS = {
|
|
|
62
62
|
title: 'Section Title',
|
|
63
63
|
itemsList: [
|
|
64
64
|
{
|
|
65
|
-
|
|
65
|
+
text: 'Section 1',
|
|
66
66
|
url: '#section-1',
|
|
67
67
|
},
|
|
68
68
|
{
|
|
69
|
-
|
|
69
|
+
text: 'Section 2',
|
|
70
70
|
url: '#section-2',
|
|
71
71
|
anchors: [
|
|
72
72
|
{
|
|
73
|
-
|
|
73
|
+
text: 'Sub section 1',
|
|
74
74
|
url: '#sub-section-1',
|
|
75
75
|
},
|
|
76
76
|
{
|
|
77
|
-
|
|
77
|
+
text: 'Sub section 2',
|
|
78
78
|
url: '#sub-section-2',
|
|
79
79
|
},
|
|
80
80
|
{
|
|
81
|
-
|
|
81
|
+
text: 'Sub section 3',
|
|
82
82
|
url: '#sub-section-3',
|
|
83
83
|
},
|
|
84
84
|
],
|
|
85
85
|
},
|
|
86
86
|
{
|
|
87
|
-
|
|
87
|
+
text: 'Section 3',
|
|
88
88
|
url: '#0',
|
|
89
89
|
},
|
|
90
90
|
],
|
|
@@ -159,7 +159,7 @@ describe('macro: section-navigation', () => {
|
|
|
159
159
|
itemsList: [
|
|
160
160
|
{
|
|
161
161
|
classes: 'extra-class another-extra-class',
|
|
162
|
-
|
|
162
|
+
text: 'Section 1',
|
|
163
163
|
url: '#section-1',
|
|
164
164
|
},
|
|
165
165
|
],
|
|
@@ -23,13 +23,11 @@
|
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
&__item {
|
|
26
|
-
font-size: 1rem;
|
|
27
26
|
padding: 0;
|
|
28
27
|
&--active {
|
|
29
28
|
border-left: 4px solid var(--ons-color-text-link-active);
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
padding-left: 14px;
|
|
29
|
+
margin-left: -1rem;
|
|
30
|
+
padding-left: 0.75rem;
|
|
33
31
|
a,
|
|
34
32
|
h2,
|
|
35
33
|
h3,
|
|
@@ -40,16 +38,13 @@
|
|
|
40
38
|
}
|
|
41
39
|
}
|
|
42
40
|
& & {
|
|
43
|
-
margin-bottom: 0.
|
|
41
|
+
margin-bottom: 0.25rem;
|
|
44
42
|
}
|
|
45
43
|
}
|
|
46
44
|
|
|
47
45
|
&__item-header {
|
|
48
46
|
@extend .ons-u-mb-no;
|
|
49
|
-
|
|
50
|
-
font-size: 1rem;
|
|
51
|
-
font-weight: 700;
|
|
52
|
-
line-height: 1.6;
|
|
47
|
+
@extend .ons-u-fs-r--b;
|
|
53
48
|
}
|
|
54
49
|
|
|
55
50
|
&__sub-items {
|
|
@@ -69,7 +64,6 @@
|
|
|
69
64
|
&--active,
|
|
70
65
|
&:hover {
|
|
71
66
|
border-color: var(--ons-color-text-link-active);
|
|
72
|
-
margin: 0 1rem 0 0;
|
|
73
67
|
padding: 0;
|
|
74
68
|
a,
|
|
75
69
|
h2,
|
package/components/section-navigation/example-section-navigation-single-vertical-with-title.njk
CHANGED
|
@@ -7,15 +7,15 @@
|
|
|
7
7
|
"title": "Sections title",
|
|
8
8
|
"itemsList": [
|
|
9
9
|
{
|
|
10
|
-
"
|
|
10
|
+
"text": "Section 1",
|
|
11
11
|
"url": "#section-1"
|
|
12
12
|
},
|
|
13
13
|
{
|
|
14
|
-
"
|
|
14
|
+
"text": "Section 2",
|
|
15
15
|
"url": "#0"
|
|
16
16
|
},
|
|
17
17
|
{
|
|
18
|
-
"
|
|
18
|
+
"text": "Section 3",
|
|
19
19
|
"url": "#0"
|
|
20
20
|
}
|
|
21
21
|
]
|
|
@@ -9,33 +9,33 @@
|
|
|
9
9
|
"title": "Section Title",
|
|
10
10
|
"itemsList": [
|
|
11
11
|
{
|
|
12
|
-
"
|
|
12
|
+
"text": "Section 1",
|
|
13
13
|
"url": "#section-1",
|
|
14
14
|
"anchors": [
|
|
15
15
|
{
|
|
16
|
-
"
|
|
16
|
+
"text": "Sub section 1",
|
|
17
17
|
"url": "#sub-section-1"
|
|
18
18
|
},
|
|
19
19
|
{
|
|
20
|
-
"
|
|
20
|
+
"text": "Sub section 2",
|
|
21
21
|
"url": "#sub-section-2"
|
|
22
22
|
},
|
|
23
23
|
{
|
|
24
|
-
"
|
|
24
|
+
"text": "Sub section 3",
|
|
25
25
|
"url": "#sub-section-3"
|
|
26
26
|
}
|
|
27
27
|
]
|
|
28
28
|
},
|
|
29
29
|
{
|
|
30
|
-
"
|
|
30
|
+
"text": "Section 2",
|
|
31
31
|
"url": "#section-2"
|
|
32
32
|
},
|
|
33
33
|
{
|
|
34
|
-
"
|
|
34
|
+
"text": "Section 3",
|
|
35
35
|
"url": "#section-3"
|
|
36
36
|
},
|
|
37
37
|
{
|
|
38
|
-
"
|
|
38
|
+
"text": "Section 4",
|
|
39
39
|
"url": "#section-4"
|
|
40
40
|
}
|
|
41
41
|
]
|
|
@@ -44,33 +44,33 @@
|
|
|
44
44
|
"title": "Section Title",
|
|
45
45
|
"itemsList": [
|
|
46
46
|
{
|
|
47
|
-
"
|
|
47
|
+
"text": "Section 5",
|
|
48
48
|
"url": "#section-5"
|
|
49
49
|
},
|
|
50
50
|
{
|
|
51
|
-
"
|
|
51
|
+
"text": "Section 6",
|
|
52
52
|
"url": "#section-6",
|
|
53
53
|
"anchors": [
|
|
54
54
|
{
|
|
55
|
-
"
|
|
55
|
+
"text": "Sub section 1",
|
|
56
56
|
"url": "#sub-section-1"
|
|
57
57
|
},
|
|
58
58
|
{
|
|
59
|
-
"
|
|
59
|
+
"text": "Sub section 2",
|
|
60
60
|
"url": "#sub-section-2"
|
|
61
61
|
},
|
|
62
62
|
{
|
|
63
|
-
"
|
|
63
|
+
"text": "Sub section 3",
|
|
64
64
|
"url": "#sub-section-3"
|
|
65
65
|
}
|
|
66
66
|
]
|
|
67
67
|
},
|
|
68
68
|
{
|
|
69
|
-
"
|
|
69
|
+
"text": "Section 7",
|
|
70
70
|
"url": "#0"
|
|
71
71
|
},
|
|
72
72
|
{
|
|
73
|
-
"
|
|
73
|
+
"text": "Section 8",
|
|
74
74
|
"url": "#0"
|
|
75
75
|
}
|
|
76
76
|
]
|
|
@@ -5,15 +5,15 @@
|
|
|
5
5
|
"currentPath": "#section-1",
|
|
6
6
|
"itemsList": [
|
|
7
7
|
{
|
|
8
|
-
"
|
|
8
|
+
"text": "Section 1",
|
|
9
9
|
"url": "#section-1"
|
|
10
10
|
},
|
|
11
11
|
{
|
|
12
|
-
"
|
|
12
|
+
"text": "Section 2",
|
|
13
13
|
"url": "#0"
|
|
14
14
|
},
|
|
15
15
|
{
|
|
16
|
-
"
|
|
16
|
+
"text": "Section 3",
|
|
17
17
|
"url": "#0"
|
|
18
18
|
}
|
|
19
19
|
]
|
|
@@ -2,18 +2,18 @@
|
|
|
2
2
|
{% from "components/list/_macro.njk" import onsList %}
|
|
3
3
|
|
|
4
4
|
{% if params.title %}
|
|
5
|
-
{% set titleTag = params.
|
|
6
|
-
{% set openingTag = "<"
|
|
7
|
-
{% set closingTag = "</"
|
|
5
|
+
{% set titleTag = params.headingLevel | default(2) %}
|
|
6
|
+
{% set openingTag = "<h" ~ titleTag %}
|
|
7
|
+
{% set closingTag = "</h" ~ titleTag ~ ">" %}
|
|
8
8
|
{{ openingTag | safe }}
|
|
9
|
-
class="ons-u-fs-r--b ons-u-mb-
|
|
9
|
+
class="ons-u-fs-r--b ons-u-mb-2xs">{{ params.title }}{{ closingTag | safe }}
|
|
10
10
|
{% endif %}
|
|
11
11
|
|
|
12
12
|
{% if params.facebook and params.facebook == true %}
|
|
13
13
|
{%
|
|
14
14
|
set facebook =
|
|
15
15
|
{
|
|
16
|
-
"url": 'https://www.facebook.com/sharer/sharer.php?u=' ~ params.
|
|
16
|
+
"url": 'https://www.facebook.com/sharer/sharer.php?u=' ~ params.pageUrl|urlencode,
|
|
17
17
|
"text": 'Facebook',
|
|
18
18
|
"iconType": 'facebook',
|
|
19
19
|
"rel": 'noreferrer external',
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
{%
|
|
26
26
|
set twitter =
|
|
27
27
|
{
|
|
28
|
-
"url": 'https://twitter.com/intent/tweet?original_referer&text=' ~ params.pageTitle|urlencode ~ '&url=' ~ params.
|
|
28
|
+
"url": 'https://twitter.com/intent/tweet?original_referer&text=' ~ params.pageTitle|urlencode ~ '&url=' ~ params.pageUrl|urlencode,
|
|
29
29
|
"text": 'Twitter',
|
|
30
30
|
"iconType": 'twitter',
|
|
31
31
|
"rel": 'noreferrer external',
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
onsList({
|
|
38
38
|
"variants": 'inline',
|
|
39
39
|
"iconPosition": 'before',
|
|
40
|
-
"iconSize": params.iconSize | default("
|
|
40
|
+
"iconSize": params.iconSize | default("2xl"),
|
|
41
41
|
"itemsList": [facebook, twitter]
|
|
42
42
|
})
|
|
43
43
|
}}
|