@ons/design-system 45.1.3 → 45.2.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/button/_button.scss +1 -1
- package/components/button/_macro.njk +5 -2
- package/components/fieldset/_macro.njk +20 -18
- package/components/footer/_footer.scss +2 -2
- package/components/footer/_macro.njk +3 -1
- package/components/header/_header.scss +10 -38
- package/components/header/_macro.njk +4 -4
- package/components/icons/_macro.njk +246 -191
- package/components/label/_macro.njk +15 -15
- package/components/lists/_macro.njk +1 -1
- package/components/pagination/_macro.njk +2 -2
- package/components/question/_macro.njk +0 -2
- package/components/section-navigation/_macro.njk +10 -1
- package/components/section-navigation/_section-navigation.scss +48 -13
- package/components/summary/_macro.njk +8 -8
- package/css/census.css +1 -1
- package/css/main.css +1 -1
- package/js/inpagelink.js +6 -8
- package/package.json +1 -1
- package/scripts/main.es5.js +1 -1
- package/scripts/main.js +1 -1
- package/scss/main.scss +1 -1
- package/scss/patternlib.scss +0 -1
- package/scss/vars/_colors.scss +0 -9
- package/components/header-navigation/_macro.njk +0 -0
- package/components/highlight/_highlight.scss +0 -5
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{% macro onsLabel(params) %}
|
|
2
|
-
{% set field
|
|
2
|
+
{% set field -%}
|
|
3
3
|
<span
|
|
4
4
|
{% if params.id is defined and params.id %} id="{{ params.id }}-description-hint"{% else %}id="description-hint"{% endif %}
|
|
5
5
|
class="ons-label__description {% if params.inputType is defined and params.inputType %}ons-{{ params.inputType }}__label--with-description{% else %} ons-input--with-description{% endif %}">
|
|
6
|
-
{{ params.description }}
|
|
6
|
+
{{- params.description -}}
|
|
7
7
|
</span>
|
|
8
|
-
{
|
|
8
|
+
{%- endset %}
|
|
9
9
|
|
|
10
10
|
<label
|
|
11
|
-
class="{% if params.inputType is not defined
|
|
11
|
+
class="{% if params.inputType is not defined -%}ons-label{%- endif %}{{- ' ' + params.classes if params.classes else "" -}}{%- if params.description is defined and params.description %} ons-label--with-description{%- endif %} {{- ' ons-label--placeholder' if params.accessiblePlaceholder else "" -}}"
|
|
12
12
|
{% if params.for is defined and params.for %} for="{{ params.for }}"{% endif %}
|
|
13
13
|
{% if params.id is defined and params.id %} id="{{ params.id }}"{% endif %}
|
|
14
14
|
{% if params.attributes is defined and params.attributes %}{% for attribute, value in (params.attributes.items() if params.attributes is mapping and params.attributes.items else params.attributes) %}{{ attribute }}{% if value is defined and value %}="{{ value }}"{% endif %}{% endfor %}{% endif %}
|
|
@@ -16,17 +16,17 @@
|
|
|
16
16
|
|
|
17
17
|
{{- params.text | safe -}}
|
|
18
18
|
|
|
19
|
-
{
|
|
20
|
-
{% if params.inputType == "checkbox" or params.inputType == "radio"
|
|
21
|
-
{%- if params.description is defined and params.description
|
|
22
|
-
{{ field | safe }}
|
|
23
|
-
{
|
|
24
|
-
{
|
|
19
|
+
{%- if params.inputType is defined and params.inputType -%}
|
|
20
|
+
{% if params.inputType == "checkbox" or params.inputType == "radio" -%}
|
|
21
|
+
{%- if params.description is defined and params.description -%}
|
|
22
|
+
{{- field | safe -}}
|
|
23
|
+
{%- endif -%}
|
|
24
|
+
{%- endif -%}
|
|
25
25
|
</label>
|
|
26
|
-
{
|
|
26
|
+
{%- else -%}
|
|
27
27
|
</label>
|
|
28
|
-
{%- if params.description is defined and params.description
|
|
29
|
-
{{ field | safe }}
|
|
30
|
-
{
|
|
31
|
-
{
|
|
28
|
+
{%- if params.description is defined and params.description -%}
|
|
29
|
+
{{- field | safe -}}
|
|
30
|
+
{%- endif -%}
|
|
31
|
+
{%- endif %}
|
|
32
32
|
{% endmacro %}
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
})
|
|
71
71
|
}}
|
|
72
72
|
{%- else -%}
|
|
73
|
-
<a href="{{ item.url }}" class="ons-list__link {% if item.
|
|
73
|
+
<a href="{{ item.url }}" class="ons-list__link {% if item.variants == 'inPageLink' %}ons-js-inpagelink {% endif %} {{ item.classes }}"{% if item.index is defined and item.index %} data-qa="list-item-{{ loop.index }}"{% endif %}{% if item.target is defined and item.target %} target="{{ item.target }}"{% endif %}{% if item.rel is defined and item.rel %} rel="{{ item.rel }}"{% endif %}>
|
|
74
74
|
{%- if item.prefix is defined and item.prefix -%}<span class="ons-u-vh">{{- item.prefix -}}</span>{%- endif -%} {{- itemText | safe -}}
|
|
75
75
|
{%- if item.target is defined and item.target == "_blank" -%}<span class="ons-u-vh">{{- item.screenreaderMessage | default("this link will open in a new tab") -}}</span>{%- endif -%}
|
|
76
76
|
</a>
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
</li>
|
|
42
42
|
{% endif %}
|
|
43
43
|
{% if currentPageIndex > 4 %}
|
|
44
|
-
<li class="ons-pagination__item ons-
|
|
44
|
+
<li class="ons-pagination__item ons-pagination__item--gap">…</li>
|
|
45
45
|
{% endif %}
|
|
46
46
|
{% for page in params.pages %}
|
|
47
47
|
{% if loop.index >= middlePagesStart and loop.index <= middlePagesEnd %}
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
{% endif %}
|
|
64
64
|
{% endfor %}
|
|
65
65
|
{% if currentPageIndex < totalPages - 3 %}
|
|
66
|
-
<li class="ons-pagination__item ons-
|
|
66
|
+
<li class="ons-pagination__item ons-pagination__item--gap">…</li>
|
|
67
67
|
{% endif %}
|
|
68
68
|
{% if currentPageIndex < totalPages - 2 %}
|
|
69
69
|
{% set lastPage = params.pages | last %}
|
|
@@ -26,7 +26,6 @@
|
|
|
26
26
|
{% from "components/collapsible/_macro.njk" import onsCollapsible %}
|
|
27
27
|
{% call onsCollapsible({
|
|
28
28
|
"id": params.definition.id if params.definition.id is defined and params.definition.id else '',
|
|
29
|
-
"titleTag": 'h2',
|
|
30
29
|
"classes": 'ons-u-mb-m',
|
|
31
30
|
"title": params.definition.title if params.definition.title is defined and params.definition.title else ''
|
|
32
31
|
}) %}
|
|
@@ -118,7 +117,6 @@
|
|
|
118
117
|
{% from "components/collapsible/_macro.njk" import onsCollapsible %}
|
|
119
118
|
{% call onsCollapsible({
|
|
120
119
|
"id": params.justification.id,
|
|
121
|
-
"titleTag": 'h2',
|
|
122
120
|
"classes": 'ons-u-mb-m',
|
|
123
121
|
"title": params.justification.title | default('Why we ask this question')
|
|
124
122
|
}) %}
|
|
@@ -1,9 +1,18 @@
|
|
|
1
1
|
{% macro onsSectionNavigation(params) %}
|
|
2
|
-
<nav class="ons-section-nav" id="{{ params.id }}" aria-label="{{ params.ariaLabel | default("Section menu") }}">
|
|
2
|
+
<nav class="ons-section-nav{% if params.variants is defined and params.variants == 'vertical' %} ons-section-nav--vertical{% endif %}" id="{{ params.id }}" aria-label="{{ params.ariaLabel | default("Section menu") }}">
|
|
3
3
|
<ul class="ons-section-nav__list" aria-label="{{ params.ariaListLabel | default("Section menu links") }}">
|
|
4
4
|
{% for item in (params.itemsList if params.itemsList is iterable else params.itemsList.items()) %}
|
|
5
5
|
<li class="ons-section-nav__item {{ item.classes }}{{ ' ons-section-nav__item--active' if (item.url == params.currentPath) or (item.url in params.currentPath) or (params.tabQuery == item.title|lower) }}">
|
|
6
6
|
<a class="ons-section-nav__link" href="{{ item.url }}" {% if (item.url == params.currentPath) or (item.url in params.currentPath) or (params.tabQuery == item.title|lower) %} aria-current="location" {% endif %}>{{ item.title }}</a>
|
|
7
|
+
{% if item.anchors is defined and item.anchors %}
|
|
8
|
+
<ul class="ons-section-nav__sub-items ons-list ons-list--dashed ons-u-mt-xs ons-u-mb-xs">
|
|
9
|
+
{% for anchor in item.anchors %}
|
|
10
|
+
<li class="ons-section-nav__item ons-list__item">
|
|
11
|
+
<a href="{{ anchor.url }}" class="ons-section-nav__link ons-list__link">{{ anchor.title }}</a>
|
|
12
|
+
</li>
|
|
13
|
+
{% endfor %}
|
|
14
|
+
</ul>
|
|
15
|
+
{% endif %}
|
|
7
16
|
</li>
|
|
8
17
|
{% endfor %}
|
|
9
18
|
</ul>
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
.ons-section-nav {
|
|
2
|
-
|
|
2
|
+
&:not(&--vertical) {
|
|
3
|
+
border-bottom: 1px solid $color-borders;
|
|
4
|
+
}
|
|
3
5
|
|
|
4
6
|
&__list {
|
|
5
7
|
list-style: none;
|
|
@@ -7,28 +9,61 @@
|
|
|
7
9
|
padding: 0;
|
|
8
10
|
}
|
|
9
11
|
|
|
12
|
+
&__link {
|
|
13
|
+
text-decoration: none;
|
|
14
|
+
&:hover {
|
|
15
|
+
color: $color-text-link-hover;
|
|
16
|
+
text-decoration: underline solid $color-text-link-hover 2px;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
10
20
|
&__item {
|
|
11
|
-
border-bottom: 4px solid transparent;
|
|
12
|
-
display: inline-block;
|
|
13
21
|
font-size: 1rem;
|
|
14
|
-
|
|
15
|
-
text-align: center;
|
|
16
|
-
&:hover,
|
|
22
|
+
padding: 0;
|
|
17
23
|
&--active {
|
|
18
|
-
border-
|
|
24
|
+
border-left: 4px solid $color-text-link-active;
|
|
25
|
+
font-weight: $font-weight-bold;
|
|
26
|
+
margin-left: -18px;
|
|
27
|
+
padding-left: 14px;
|
|
19
28
|
a {
|
|
20
|
-
color: $color-
|
|
29
|
+
color: $color-text-link-active;
|
|
21
30
|
}
|
|
22
31
|
}
|
|
23
|
-
|
|
24
|
-
|
|
32
|
+
& & {
|
|
33
|
+
margin-bottom: 0.3rem;
|
|
25
34
|
}
|
|
26
35
|
}
|
|
27
36
|
|
|
28
|
-
&
|
|
29
|
-
|
|
30
|
-
|
|
37
|
+
&__sub-items {
|
|
38
|
+
a {
|
|
39
|
+
color: $color-text-link;
|
|
40
|
+
font-weight: $font-weight-regular;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
&:not(&--vertical) & {
|
|
45
|
+
&__item {
|
|
46
|
+
border: none;
|
|
47
|
+
border-bottom: 4px solid transparent;
|
|
48
|
+
display: inline-block;
|
|
49
|
+
margin: 0 1rem 0 0;
|
|
50
|
+
text-align: center;
|
|
51
|
+
&--active,
|
|
52
|
+
&:hover {
|
|
53
|
+
border-color: $color-text-link-active;
|
|
54
|
+
margin: 0 1rem 0 0;
|
|
55
|
+
padding: 0;
|
|
56
|
+
a {
|
|
57
|
+
color: $color-text-link-active;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
&__link {
|
|
31
63
|
text-decoration: none;
|
|
64
|
+
&:hover {
|
|
65
|
+
text-decoration: none;
|
|
66
|
+
}
|
|
32
67
|
}
|
|
33
68
|
}
|
|
34
69
|
}
|
|
@@ -11,12 +11,12 @@
|
|
|
11
11
|
{% endif %}
|
|
12
12
|
<div class="{{ className }}">
|
|
13
13
|
{% for summary in params.summaries %}
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
{%
|
|
14
|
+
{% if summary.summaryTitle is defined and summary.summaryTitle %}
|
|
15
|
+
<h2 class="ons-summary__title ons-u-mb-m">{{ summary.summaryTitle }}</h2>
|
|
16
|
+
{% set titleSize = "3" %}
|
|
17
|
+
{% endif %}
|
|
18
|
+
{% for group in summary.groups %}
|
|
19
|
+
<div {% if group.id is defined and group.id %}id="{{ group.id }}" {% endif %} class="ons-summary__group">
|
|
20
20
|
{% if group.groupTitle is defined and group.groupTitle %}
|
|
21
21
|
<h{{ titleSize }} class="ons-summary__group-title">{{ group.groupTitle }}</h{{ titleSize }}>
|
|
22
22
|
{% endif %}
|
|
@@ -122,8 +122,8 @@
|
|
|
122
122
|
<a {% if group.summaryLink.attributes is defined and group.summaryLink.attributes %}{% for attribute, value in (group.summaryLink.attributes.items() if group.summaryLink.attributes is mapping and group.summaryLink.attributes.items else group.summaryLink.attributes) %}{{attribute}}="{{value}}" {% endfor %}{% endif %} href="{{ group.summaryLink.url }}">{{ group.summaryLink.text }}</a>
|
|
123
123
|
</div>
|
|
124
124
|
{% endif %}
|
|
125
|
-
|
|
126
|
-
|
|
125
|
+
</div>
|
|
126
|
+
{% endfor %}
|
|
127
127
|
{% endfor %}
|
|
128
128
|
</div>
|
|
129
129
|
{% endmacro %}
|