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