@openeuropa/bcl-data-header 0.24.1 → 0.26.0
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/data--ec.js +15 -321
- package/data--loggedIn.js +37 -0
- package/data--modals.js +15 -0
- package/data--navbar.js +92 -0
- package/data--neutral.js +15 -291
- package/data--no-form.js +23 -132
- package/data--simple.js +21 -241
- package/data--top-navbar.js +52 -0
- package/data--ucpkn.js +3 -3
- package/data.js +15 -292
- package/package.json +6 -2
package/data--ec.js
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
const drupalAttribute = require("drupal-attribute");
|
|
2
2
|
|
|
3
|
+
const languageList = require("@openeuropa/bcl-language-list/data/data-modal");
|
|
4
|
+
const breadcrumbs = require("@openeuropa/bcl-data-breadcrumb/data");
|
|
5
|
+
const navbarTop = require("@openeuropa/bcl-data-header/data--top-navbar");
|
|
6
|
+
const navbar = require("@openeuropa/bcl-data-header/data--navbar");
|
|
7
|
+
const modals = require("@openeuropa/bcl-data-header/data--modals");
|
|
8
|
+
|
|
3
9
|
module.exports = {
|
|
4
10
|
variant: "ec",
|
|
5
11
|
site_name: "Project name",
|
|
@@ -11,10 +17,12 @@ module.exports = {
|
|
|
11
17
|
project_link: "/example.html",
|
|
12
18
|
head: {
|
|
13
19
|
attributes: new drupalAttribute()
|
|
14
|
-
.addClass(["w-100", "shadow-sm"])
|
|
20
|
+
.addClass(["w-100", "shadow-sm", "bcl-header__top-navbar"])
|
|
15
21
|
.setAttribute("aria-label", "Top Navigation"),
|
|
16
|
-
disable_collapse:
|
|
22
|
+
disable_collapse: false,
|
|
23
|
+
collapse_id: "topNavbarDropdown",
|
|
17
24
|
brand: {
|
|
25
|
+
link: "/example.html",
|
|
18
26
|
logos: [
|
|
19
27
|
{
|
|
20
28
|
src: "https://cdn1.fpfis.tech.ec.europa.eu/ecl/v3.0.2/ec/images/logo/logo-ec--en.svg",
|
|
@@ -23,328 +31,14 @@ module.exports = {
|
|
|
23
31
|
],
|
|
24
32
|
},
|
|
25
33
|
navigation: {
|
|
26
|
-
items:
|
|
27
|
-
{
|
|
28
|
-
label: "Link",
|
|
29
|
-
icon_position: "before",
|
|
30
|
-
icon: {
|
|
31
|
-
name: "link",
|
|
32
|
-
path: "/icons.svg",
|
|
33
|
-
},
|
|
34
|
-
attributes: new drupalAttribute().addClass(["d-none", "d-lg-block"]),
|
|
35
|
-
},
|
|
36
|
-
{
|
|
37
|
-
label: "Link",
|
|
38
|
-
icon_position: "before",
|
|
39
|
-
icon: {
|
|
40
|
-
name: "link",
|
|
41
|
-
path: "/icons.svg",
|
|
42
|
-
},
|
|
43
|
-
attributes: new drupalAttribute().addClass(["d-none", "d-lg-block"]),
|
|
44
|
-
},
|
|
45
|
-
{
|
|
46
|
-
label: "<span class='d-block d-lg-inline-block'>English</span>",
|
|
47
|
-
path: "#",
|
|
48
|
-
icon_position: "before",
|
|
49
|
-
remove_icon_spacers: true,
|
|
50
|
-
icon: {
|
|
51
|
-
name: "chat-left-dots-fill",
|
|
52
|
-
size: "xs",
|
|
53
|
-
path: "/icons.svg",
|
|
54
|
-
attributes: new drupalAttribute().addClass("me-lg-2-5"),
|
|
55
|
-
},
|
|
56
|
-
attributes: new drupalAttribute()
|
|
57
|
-
.setAttribute("data-bs-toggle", "modal")
|
|
58
|
-
.setAttribute("data-bs-target", "#languageModal")
|
|
59
|
-
.addClass("text-center"),
|
|
60
|
-
},
|
|
61
|
-
{
|
|
62
|
-
label: "<span class='d-block d-lg-inline-block'>Log in</span>",
|
|
63
|
-
path: "#",
|
|
64
|
-
icon_position: "before",
|
|
65
|
-
remove_icon_spacers: true,
|
|
66
|
-
icon: {
|
|
67
|
-
name: "person-fill",
|
|
68
|
-
size: "xs",
|
|
69
|
-
path: "/icons.svg",
|
|
70
|
-
attributes: new drupalAttribute().addClass("me-lg-2-5"),
|
|
71
|
-
},
|
|
72
|
-
attributes: new drupalAttribute()
|
|
73
|
-
.setAttribute("data-bs-toggle", "modal")
|
|
74
|
-
.setAttribute("data-bs-target", "#loginModal")
|
|
75
|
-
.addClass("text-center"),
|
|
76
|
-
},
|
|
77
|
-
{
|
|
78
|
-
label: "<span class='badge bg-danger'>5</span>",
|
|
79
|
-
path: "#",
|
|
80
|
-
remove_icon_spacers: true,
|
|
81
|
-
icon_position: "before",
|
|
82
|
-
icon: {
|
|
83
|
-
name: "bell-fill",
|
|
84
|
-
size: "s",
|
|
85
|
-
path: "/icons.svg",
|
|
86
|
-
},
|
|
87
|
-
attributes: new drupalAttribute().addClass([
|
|
88
|
-
"notification",
|
|
89
|
-
"mt-2",
|
|
90
|
-
"mt-lg-0",
|
|
91
|
-
]),
|
|
92
|
-
},
|
|
93
|
-
],
|
|
94
|
-
},
|
|
95
|
-
},
|
|
96
|
-
navbar: {
|
|
97
|
-
color_set: "dark",
|
|
98
|
-
collapse_id: "navbarNavDropdown",
|
|
99
|
-
attributes: new drupalAttribute().addClass("bcl-header__navbar"),
|
|
100
|
-
form: {
|
|
101
|
-
attributes: new drupalAttribute().addClass(["d-flex", "mt-3", "mt-lg-0"]),
|
|
102
|
-
submit: {
|
|
103
|
-
variant: "light",
|
|
104
|
-
assistive_text: "search",
|
|
105
|
-
icon: {
|
|
106
|
-
name: "search",
|
|
107
|
-
size: "xs",
|
|
108
|
-
path: "/icons.svg",
|
|
109
|
-
},
|
|
110
|
-
attributes: new drupalAttribute().addClass([
|
|
111
|
-
"border-start-0",
|
|
112
|
-
"rounded-0",
|
|
113
|
-
"rounded-end",
|
|
114
|
-
]),
|
|
115
|
-
},
|
|
116
|
-
items: [
|
|
117
|
-
[
|
|
118
|
-
{
|
|
119
|
-
type: "text",
|
|
120
|
-
required: true,
|
|
121
|
-
label: "Search",
|
|
122
|
-
hidden_label: true,
|
|
123
|
-
placeholder: "Search",
|
|
124
|
-
id: "inlineFormInputGroupSearch",
|
|
125
|
-
attributes: new drupalAttribute().addClass([
|
|
126
|
-
"border-start-0",
|
|
127
|
-
"rounded-0",
|
|
128
|
-
"rounded-start",
|
|
129
|
-
]),
|
|
130
|
-
},
|
|
131
|
-
],
|
|
132
|
-
],
|
|
133
|
-
},
|
|
134
|
-
navigation: {
|
|
135
|
-
navbar: true,
|
|
136
|
-
attributes: new drupalAttribute().addClass("me-auto"),
|
|
137
|
-
items: [
|
|
138
|
-
{
|
|
139
|
-
label: "Home",
|
|
140
|
-
path: "/example.html",
|
|
141
|
-
active: true,
|
|
142
|
-
attributes: new drupalAttribute().setAttribute(
|
|
143
|
-
"aria-current",
|
|
144
|
-
"page"
|
|
145
|
-
),
|
|
146
|
-
},
|
|
147
|
-
{
|
|
148
|
-
label: "Item 01",
|
|
149
|
-
path: "/example.html",
|
|
150
|
-
},
|
|
151
|
-
{
|
|
152
|
-
label: "Item 02",
|
|
153
|
-
path: "/example.html",
|
|
154
|
-
},
|
|
155
|
-
{
|
|
156
|
-
id: "navbarDropdownMenuLink",
|
|
157
|
-
link: true,
|
|
158
|
-
dropdown: true,
|
|
159
|
-
trigger: {
|
|
160
|
-
label: "Dropdown link",
|
|
161
|
-
path: "#",
|
|
162
|
-
attributes: new drupalAttribute().addClass("nav-link"),
|
|
163
|
-
},
|
|
164
|
-
items: [
|
|
165
|
-
{
|
|
166
|
-
label: "Action",
|
|
167
|
-
path: "/example.html",
|
|
168
|
-
},
|
|
169
|
-
{
|
|
170
|
-
label: "Another action",
|
|
171
|
-
path: "/example.html",
|
|
172
|
-
},
|
|
173
|
-
{
|
|
174
|
-
label: "Something else here",
|
|
175
|
-
path: "/example.html",
|
|
176
|
-
},
|
|
177
|
-
{
|
|
178
|
-
label:
|
|
179
|
-
"Very long label with custom text and custom link as an example",
|
|
180
|
-
path: "/example.html",
|
|
181
|
-
},
|
|
182
|
-
],
|
|
183
|
-
},
|
|
184
|
-
],
|
|
185
|
-
},
|
|
186
|
-
},
|
|
187
|
-
modals: [
|
|
188
|
-
{
|
|
189
|
-
id: "loginModal",
|
|
190
|
-
header:
|
|
191
|
-
'<h5 class="modal-title" id="loginModalLabel">Log in</h5>' +
|
|
192
|
-
'<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>',
|
|
193
|
-
body:
|
|
194
|
-
"<h5>Disclaimer 1</h5>" +
|
|
195
|
-
"<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum accumsan eget orci eu aliquet. Suspendisse potenti. Integer volutpat, nisl et placerat tincidunt</p>" +
|
|
196
|
-
"<h5>Disclaimer 2</h5>" +
|
|
197
|
-
"<p>Duis bibendum tristique lobortis. Nam luctus nisi sit amet turpis faucibus, ut dapibus elit sollicitudin. Phasellus a massa magna. Nullam ac imperdiet leo.</p>",
|
|
198
|
-
footer:
|
|
199
|
-
'<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>' +
|
|
200
|
-
'<button type="button" class="btn btn-primary">Access EU login</button>',
|
|
34
|
+
items: navbarTop,
|
|
201
35
|
},
|
|
202
|
-
],
|
|
203
|
-
language_modal: {
|
|
204
|
-
id: "languageModal",
|
|
205
|
-
title: "Select your language",
|
|
206
|
-
variant: "ec",
|
|
207
|
-
icon_path: "/icons.svg",
|
|
208
|
-
close_label: "Close",
|
|
209
|
-
overlay: true,
|
|
210
|
-
items: [
|
|
211
|
-
{
|
|
212
|
-
label: "български",
|
|
213
|
-
lang: "bg",
|
|
214
|
-
},
|
|
215
|
-
{
|
|
216
|
-
label: "español",
|
|
217
|
-
lang: "es",
|
|
218
|
-
},
|
|
219
|
-
{
|
|
220
|
-
label: "čeština",
|
|
221
|
-
lang: "cs",
|
|
222
|
-
},
|
|
223
|
-
{
|
|
224
|
-
label: "dansk",
|
|
225
|
-
lang: "da",
|
|
226
|
-
},
|
|
227
|
-
{
|
|
228
|
-
label: "Deutsch",
|
|
229
|
-
lang: "de",
|
|
230
|
-
},
|
|
231
|
-
{
|
|
232
|
-
label: "eesti",
|
|
233
|
-
lang: "et",
|
|
234
|
-
},
|
|
235
|
-
{
|
|
236
|
-
label: "ελληνικά",
|
|
237
|
-
lang: "el",
|
|
238
|
-
},
|
|
239
|
-
{
|
|
240
|
-
label: "English",
|
|
241
|
-
active: true,
|
|
242
|
-
lang: "en",
|
|
243
|
-
},
|
|
244
|
-
{
|
|
245
|
-
label: "français",
|
|
246
|
-
lang: "fr",
|
|
247
|
-
},
|
|
248
|
-
{
|
|
249
|
-
label: "Gaeilge",
|
|
250
|
-
lang: "ga",
|
|
251
|
-
},
|
|
252
|
-
{
|
|
253
|
-
label: "hrvatski",
|
|
254
|
-
lang: "hr",
|
|
255
|
-
},
|
|
256
|
-
{
|
|
257
|
-
label: "italiano",
|
|
258
|
-
lang: "it",
|
|
259
|
-
},
|
|
260
|
-
{
|
|
261
|
-
label: "latviešu",
|
|
262
|
-
lang: "lv",
|
|
263
|
-
},
|
|
264
|
-
{
|
|
265
|
-
label: "lietuvių",
|
|
266
|
-
lang: "lt",
|
|
267
|
-
},
|
|
268
|
-
{
|
|
269
|
-
label: "magyar",
|
|
270
|
-
lang: "hu",
|
|
271
|
-
},
|
|
272
|
-
{
|
|
273
|
-
label: "Malti",
|
|
274
|
-
lang: "mt",
|
|
275
|
-
},
|
|
276
|
-
{
|
|
277
|
-
label: "Nederlands",
|
|
278
|
-
lang: "nl",
|
|
279
|
-
},
|
|
280
|
-
{
|
|
281
|
-
label: "polski",
|
|
282
|
-
lang: "pl",
|
|
283
|
-
},
|
|
284
|
-
{
|
|
285
|
-
label: "português",
|
|
286
|
-
lang: "pt",
|
|
287
|
-
},
|
|
288
|
-
{
|
|
289
|
-
label: "română",
|
|
290
|
-
lang: "ro",
|
|
291
|
-
},
|
|
292
|
-
{
|
|
293
|
-
label: "slovenčina",
|
|
294
|
-
lang: "sk",
|
|
295
|
-
},
|
|
296
|
-
{
|
|
297
|
-
label: "slovenščina",
|
|
298
|
-
lang: "sl",
|
|
299
|
-
},
|
|
300
|
-
{
|
|
301
|
-
label: "suomi",
|
|
302
|
-
lang: "fi",
|
|
303
|
-
},
|
|
304
|
-
{
|
|
305
|
-
label: "svenska",
|
|
306
|
-
lang: "sv",
|
|
307
|
-
},
|
|
308
|
-
],
|
|
309
|
-
non_eu_items: [
|
|
310
|
-
{
|
|
311
|
-
label: "中文",
|
|
312
|
-
lang: "zh",
|
|
313
|
-
},
|
|
314
|
-
{
|
|
315
|
-
label: "Türk",
|
|
316
|
-
lang: "tr",
|
|
317
|
-
},
|
|
318
|
-
{
|
|
319
|
-
label: "pусский",
|
|
320
|
-
lang: "ru",
|
|
321
|
-
},
|
|
322
|
-
{
|
|
323
|
-
label: "Català",
|
|
324
|
-
lang: "ca",
|
|
325
|
-
},
|
|
326
|
-
{
|
|
327
|
-
label: "عَرَبِيّ",
|
|
328
|
-
lang: "ar",
|
|
329
|
-
},
|
|
330
|
-
],
|
|
331
|
-
eu_category: "EU official languages",
|
|
332
|
-
non_eu_category: "Other languages",
|
|
333
36
|
},
|
|
37
|
+
navbar,
|
|
38
|
+
modals,
|
|
39
|
+
language_modal: { ...languageList, variant: "ec" },
|
|
334
40
|
breadcrumbs: {
|
|
41
|
+
...breadcrumbs,
|
|
335
42
|
attributes: new drupalAttribute().addClass(["mt-3"]),
|
|
336
|
-
links: [
|
|
337
|
-
{ label: "Home", path: "/example.html" },
|
|
338
|
-
{
|
|
339
|
-
label: "European Commission",
|
|
340
|
-
path: "/example.html",
|
|
341
|
-
},
|
|
342
|
-
{
|
|
343
|
-
label: "About the European Commission",
|
|
344
|
-
path: "/example.html",
|
|
345
|
-
},
|
|
346
|
-
{ label: "News" },
|
|
347
|
-
],
|
|
348
|
-
icon_path: "/icons.svg",
|
|
349
43
|
},
|
|
350
44
|
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
const drupalAttribute = require("drupal-attribute");
|
|
2
|
+
|
|
3
|
+
module.exports = [
|
|
4
|
+
{
|
|
5
|
+
label: "My account",
|
|
6
|
+
path: "/example.html",
|
|
7
|
+
icon_position: "before",
|
|
8
|
+
remove_icon_spacers: true,
|
|
9
|
+
attributes: new drupalAttribute().addClass(["py-lg-2", "pb-3"]),
|
|
10
|
+
icon: {
|
|
11
|
+
name: "person-fill",
|
|
12
|
+
size: "xs",
|
|
13
|
+
path: "/icons.svg",
|
|
14
|
+
attributes: new drupalAttribute().addClass(["me-2-5"]),
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
label: "Log out",
|
|
19
|
+
path: "/example.html",
|
|
20
|
+
icon_position: "before",
|
|
21
|
+
remove_icon_spacers: true,
|
|
22
|
+
attributes: new drupalAttribute().addClass([
|
|
23
|
+
"border-top-lg-0",
|
|
24
|
+
"border-top",
|
|
25
|
+
"mx-n3",
|
|
26
|
+
"px-4",
|
|
27
|
+
"py-lg-2",
|
|
28
|
+
"pt-3",
|
|
29
|
+
]),
|
|
30
|
+
icon: {
|
|
31
|
+
name: "lock-fill",
|
|
32
|
+
size: "xs",
|
|
33
|
+
path: "/icons.svg",
|
|
34
|
+
attributes: new drupalAttribute().addClass("me-2-5"),
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
];
|
package/data--modals.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
const { getDummyText } = require("@openeuropa/bcl-data-utils");
|
|
2
|
+
|
|
3
|
+
module.exports = [
|
|
4
|
+
{
|
|
5
|
+
id: "loginModal",
|
|
6
|
+
header: `<h5 class="modal-title" id="loginModalLabel">Log in</h5>
|
|
7
|
+
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>`,
|
|
8
|
+
body: `<h5>Disclaimer 1</h5>
|
|
9
|
+
${getDummyText(3, true)}
|
|
10
|
+
<h5>Disclaimer 2</h5>
|
|
11
|
+
${getDummyText(3, true)}`,
|
|
12
|
+
footer: `<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
|
|
13
|
+
<button type="button" class="btn btn-primary">Access EU login</button>`,
|
|
14
|
+
},
|
|
15
|
+
];
|
package/data--navbar.js
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
const drupalAttribute = require("drupal-attribute");
|
|
2
|
+
|
|
3
|
+
module.exports = {
|
|
4
|
+
color_set: "dark",
|
|
5
|
+
collapse_id: "navbarNavDropdown",
|
|
6
|
+
attributes: new drupalAttribute()
|
|
7
|
+
.addClass("bcl-header__navbar")
|
|
8
|
+
.setAttribute("aria-label", "Main Navigation"),
|
|
9
|
+
form: {
|
|
10
|
+
attributes: new drupalAttribute().addClass(["d-flex", "mt-3", "mt-lg-0"]),
|
|
11
|
+
submit: {
|
|
12
|
+
variant: "light",
|
|
13
|
+
assistive_text: "search",
|
|
14
|
+
icon: {
|
|
15
|
+
name: "search",
|
|
16
|
+
size: "xs",
|
|
17
|
+
path: "/icons.svg",
|
|
18
|
+
},
|
|
19
|
+
attributes: new drupalAttribute().addClass([
|
|
20
|
+
"border-start-0",
|
|
21
|
+
"rounded-0",
|
|
22
|
+
"rounded-end",
|
|
23
|
+
]),
|
|
24
|
+
},
|
|
25
|
+
items: [
|
|
26
|
+
[
|
|
27
|
+
{
|
|
28
|
+
type: "text",
|
|
29
|
+
required: true,
|
|
30
|
+
label: "Search",
|
|
31
|
+
hidden_label: true,
|
|
32
|
+
placeholder: "Search",
|
|
33
|
+
id: "inlineFormInputGroupSearch",
|
|
34
|
+
attributes: new drupalAttribute().addClass([
|
|
35
|
+
"border-start-0",
|
|
36
|
+
"rounded-0",
|
|
37
|
+
"rounded-start",
|
|
38
|
+
]),
|
|
39
|
+
},
|
|
40
|
+
],
|
|
41
|
+
],
|
|
42
|
+
},
|
|
43
|
+
navigation: {
|
|
44
|
+
navbar: true,
|
|
45
|
+
attributes: new drupalAttribute().addClass("me-auto"),
|
|
46
|
+
items: [
|
|
47
|
+
{
|
|
48
|
+
label: "Home",
|
|
49
|
+
path: "/example.html",
|
|
50
|
+
active: true,
|
|
51
|
+
attributes: new drupalAttribute().setAttribute("aria-current", "page"),
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
label: "Item 01",
|
|
55
|
+
path: "/example.html",
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
label: "Item 02",
|
|
59
|
+
path: "/example.html",
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
id: "navbarDropdownMenuLink",
|
|
63
|
+
link: true,
|
|
64
|
+
dropdown: true,
|
|
65
|
+
trigger: {
|
|
66
|
+
label: "Dropdown link",
|
|
67
|
+
path: "#",
|
|
68
|
+
attributes: new drupalAttribute().addClass("nav-link"),
|
|
69
|
+
},
|
|
70
|
+
items: [
|
|
71
|
+
{
|
|
72
|
+
label: "Action",
|
|
73
|
+
path: "/example.html",
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
label: "Another action",
|
|
77
|
+
path: "/example.html",
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
label: "Something else here",
|
|
81
|
+
path: "/example.html",
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
label:
|
|
85
|
+
"Very long label with custom text and custom link as an example",
|
|
86
|
+
path: "/example.html",
|
|
87
|
+
},
|
|
88
|
+
],
|
|
89
|
+
},
|
|
90
|
+
],
|
|
91
|
+
},
|
|
92
|
+
};
|