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