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