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