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