@openeuropa/bcl-header 1.10.9 → 1.10.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/header.html.twig +44 -48
- package/package.json +6 -6
package/header.html.twig
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
{% apply spaceless %}
|
|
2
|
-
|
|
3
1
|
{# Parameters:
|
|
4
2
|
- variant (string) (default: 'neutral')
|
|
5
3
|
- options: ['ec', 'eu', 'neutral']
|
|
@@ -22,7 +20,7 @@
|
|
|
22
20
|
- attributes (drupal attrs)
|
|
23
21
|
#}
|
|
24
22
|
|
|
25
|
-
{
|
|
23
|
+
{%- set _variant = variant|default('neutral') %}
|
|
26
24
|
{% set _navbar = navbar|default({}) %}
|
|
27
25
|
{% set _project_logo = project_logo|default({}) %}
|
|
28
26
|
{% set _site_name = site_name|default('') %}
|
|
@@ -36,24 +34,24 @@
|
|
|
36
34
|
{% set _icon_path = icon_path|default('') %}
|
|
37
35
|
{% set _modals = modals|default([]) %}
|
|
38
36
|
|
|
39
|
-
{
|
|
37
|
+
{%- set _site_name_classes = 'bcl-header__site-name' %}
|
|
40
38
|
|
|
41
|
-
{
|
|
42
|
-
{
|
|
39
|
+
{%- if attributes is empty %}
|
|
40
|
+
{%- set attributes = create_attribute() %}
|
|
43
41
|
{% endif %}
|
|
44
42
|
|
|
45
|
-
{
|
|
43
|
+
{%- set attributes = attributes.addClass(['bcl-header', 'bcl-header--' ~ _variant, 'shadow-sm']) %}
|
|
46
44
|
|
|
47
|
-
{
|
|
48
|
-
{
|
|
45
|
+
{%- if site_name_classes is not empty %}
|
|
46
|
+
{%- set _site_name_classes = _site_name_classes ~ ' ' ~ site_name_classes %}
|
|
49
47
|
{% endif %}
|
|
50
48
|
|
|
51
|
-
{
|
|
49
|
+
{%- set _project_classes = 'bcl-header__project' %}
|
|
52
50
|
{% if _light is not empty %}
|
|
53
|
-
{
|
|
51
|
+
{%- set _project_classes = _project_classes ~ ' light' %}
|
|
54
52
|
{% endif %}
|
|
55
53
|
|
|
56
|
-
{
|
|
54
|
+
{%- set toggler_attributes = _toggler_attributes.addClass(['bcl-navbar-toggler', 'd-lg-none'])
|
|
57
55
|
.setAttribute('type', 'button')
|
|
58
56
|
.setAttribute('data-bs-toggle', 'collapse')
|
|
59
57
|
.setAttribute('data-bs-target', '#' ~ navbar_id)
|
|
@@ -61,79 +59,77 @@
|
|
|
61
59
|
.setAttribute('aria-expanded', 'false')
|
|
62
60
|
%}
|
|
63
61
|
|
|
64
|
-
{
|
|
62
|
+
{%- set navbar_toggle_button -%}
|
|
65
63
|
<button
|
|
66
64
|
{{ toggler_attributes }}
|
|
67
65
|
>
|
|
68
|
-
{
|
|
66
|
+
{%- include '@oe-bcl/bcl-icon/icon.html.twig' with {
|
|
69
67
|
name: 'list',
|
|
70
68
|
size: 'fluid',
|
|
71
69
|
path: _icon_path,
|
|
72
70
|
attributes: create_attribute().addClass(['default-icon']),
|
|
73
71
|
} only %}
|
|
74
|
-
{
|
|
72
|
+
{%- include '@oe-bcl/bcl-icon/icon.html.twig' with {
|
|
75
73
|
name: 'x',
|
|
76
74
|
size: 'fluid',
|
|
77
75
|
path: _icon_path,
|
|
78
76
|
attributes: create_attribute().addClass(['active-icon']),
|
|
79
|
-
} only
|
|
77
|
+
} only -%}
|
|
80
78
|
</button>
|
|
81
|
-
{
|
|
79
|
+
{%- endset -%}
|
|
82
80
|
|
|
83
81
|
<header
|
|
84
82
|
{{ attributes }}
|
|
85
|
-
>
|
|
83
|
+
>{# -#}
|
|
86
84
|
<nav
|
|
87
|
-
{{ _head.attributes.addClass(['navbar', 'navbar-expand-lg', 'navbar-light']) }}>
|
|
85
|
+
{{ _head.attributes.addClass(['navbar', 'navbar-expand-lg', 'navbar-light']) }}>{# -#}
|
|
88
86
|
<div class='container'>
|
|
89
|
-
{
|
|
87
|
+
{%- if _head.brand is not empty -%}
|
|
90
88
|
<a class='navbar-brand' href='{{ _head.brand.link }}'>
|
|
91
|
-
{
|
|
89
|
+
{%- for logo in _head.brand.logos -%}
|
|
92
90
|
<img
|
|
93
91
|
src='{{ logo.src }}'
|
|
94
92
|
{% if logo.alt is not empty %}
|
|
95
93
|
alt='{{ logo.alt }}'
|
|
96
94
|
{% endif %}
|
|
97
|
-
{
|
|
95
|
+
{%- if logo.class is not empty %}
|
|
98
96
|
class='{{ logo.class }}'
|
|
99
97
|
{% endif %}
|
|
100
98
|
/>
|
|
101
|
-
{
|
|
99
|
+
{%- endfor -%}
|
|
102
100
|
</a>
|
|
103
|
-
{
|
|
104
|
-
{{ navbar_toggle_button }}
|
|
105
|
-
</div>
|
|
106
|
-
</nav>
|
|
107
|
-
|
|
108
|
-
<!-- site name -->
|
|
109
|
-
<div class="bcl-header__site-name" id="site-name-heading">
|
|
110
|
-
<div class="container">
|
|
111
|
-
<span class="h5 py-3-5 border-top-subtle mb-0 d-block">{{ _site_name }}</span>
|
|
112
|
-
</div>
|
|
113
|
-
</div>
|
|
101
|
+
{%- endif %}
|
|
102
|
+
{{- navbar_toggle_button -}}
|
|
103
|
+
</div>{# -#}
|
|
104
|
+
</nav>{# -#}
|
|
105
|
+
|
|
106
|
+
<!-- site name -->{# -#}
|
|
107
|
+
<div class="bcl-header__site-name" id="site-name-heading">{# -#}
|
|
108
|
+
<div class="container">{# -#}
|
|
109
|
+
<span class="h5 py-3-5 border-top-subtle mb-0 d-block">{{ _site_name }}</span>{# -#}
|
|
110
|
+
</div>{# -#}
|
|
111
|
+
</div>{# -#}
|
|
114
112
|
|
|
115
113
|
<!-- navbar -->
|
|
116
|
-
{
|
|
117
|
-
{
|
|
114
|
+
{%- if _navbar is not empty %}
|
|
115
|
+
{%- include '@oe-bcl/bcl-navbar/navbar.html.twig' with _navbar|merge({
|
|
118
116
|
disable_collapse: true,
|
|
119
117
|
attributes: create_attribute().addClass('bcl-header__navbar collapse navbar-collapse').setAttribute('id', _navbar_id).setAttribute('aria-label', 'Main Navigation'),
|
|
120
118
|
}) only %}
|
|
121
|
-
{
|
|
122
|
-
</header>
|
|
119
|
+
{%- endif -%}
|
|
120
|
+
</header>{# -#}
|
|
123
121
|
|
|
124
122
|
<!-- breadcrumbs -->
|
|
125
|
-
{
|
|
123
|
+
{%- if _breadcrumbs is not empty -%}
|
|
126
124
|
<div class="container">
|
|
127
|
-
{
|
|
125
|
+
{%- include '@oe-bcl/bcl-breadcrumb/breadcrumb.html.twig' with _breadcrumbs only -%}
|
|
128
126
|
</div>
|
|
129
|
-
{
|
|
127
|
+
{%- endif %}
|
|
130
128
|
|
|
131
|
-
{
|
|
132
|
-
{
|
|
129
|
+
{%- for modal in _modals %}
|
|
130
|
+
{%- include '@oe-bcl/bcl-modal/modal.html.twig' with modal only %}
|
|
133
131
|
{% endfor %}
|
|
134
132
|
|
|
135
|
-
{
|
|
136
|
-
{
|
|
137
|
-
{% endif
|
|
138
|
-
|
|
139
|
-
{% endapply %}
|
|
133
|
+
{%- if _language_modal is not empty %}
|
|
134
|
+
{%- include '@oe-bcl/bcl-language-list/language-list.html.twig' with _language_modal only %}
|
|
135
|
+
{% endif -%}
|
package/package.json
CHANGED
|
@@ -2,16 +2,16 @@
|
|
|
2
2
|
"name": "@openeuropa/bcl-header",
|
|
3
3
|
"author": "European Commission",
|
|
4
4
|
"license": "EUPL-1.2",
|
|
5
|
-
"version": "1.10.
|
|
5
|
+
"version": "1.10.10",
|
|
6
6
|
"publishConfig": {
|
|
7
7
|
"access": "public"
|
|
8
8
|
},
|
|
9
9
|
"description": "OE - BCL header",
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"@openeuropa/bcl-breadcrumb": "^1.10.
|
|
12
|
-
"@openeuropa/bcl-language-list": "^1.10.
|
|
13
|
-
"@openeuropa/bcl-modal": "^1.10.
|
|
14
|
-
"@openeuropa/bcl-navbar": "^1.10.
|
|
11
|
+
"@openeuropa/bcl-breadcrumb": "^1.10.10",
|
|
12
|
+
"@openeuropa/bcl-language-list": "^1.10.10",
|
|
13
|
+
"@openeuropa/bcl-modal": "^1.10.10",
|
|
14
|
+
"@openeuropa/bcl-navbar": "^1.10.10"
|
|
15
15
|
},
|
|
16
16
|
"repository": {
|
|
17
17
|
"type": "git",
|
|
@@ -27,5 +27,5 @@
|
|
|
27
27
|
"design-system",
|
|
28
28
|
"twig"
|
|
29
29
|
],
|
|
30
|
-
"gitHead": "
|
|
30
|
+
"gitHead": "9f7c4a046e8f8f325e4de7e998f1c2a654f6eed1"
|
|
31
31
|
}
|