@openeuropa/bcl-data-header 0.16.0 → 0.17.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.
@@ -0,0 +1,190 @@
1
+ const drupalAttribute = require("drupal-attribute");
2
+
3
+ module.exports = {
4
+ variant: "eu",
5
+ head: {
6
+ attributes: new drupalAttribute().addClass(["w-100", "shadow-sm"]),
7
+ disable_collapse: true,
8
+ brand: {
9
+ logos: [
10
+ {
11
+ class: "d-none d-lg-block",
12
+ src: "https://cdn1.fpfis.tech.ec.europa.eu/ecl/v3.0.2/eu/images/logo/standard-version/positive/logo-eu--en.svg",
13
+ },
14
+ {
15
+ class: "d-lg-none",
16
+ src: "https://cdn1.fpfis.tech.ec.europa.eu/ecl/v3.0.2/eu/images/logo/condensed-version/positive/logo-eu--en.svg",
17
+ },
18
+ ],
19
+ },
20
+ navigation: {
21
+ items: [
22
+ {
23
+ label: "<span class='d-block d-lg-inline-block'>English</span>",
24
+ path: "#",
25
+ icon_position: "before",
26
+ icon: {
27
+ path: "/icons.svg",
28
+ name: "chat-left-dots-fill",
29
+ size: "xs",
30
+ },
31
+ attributes: new drupalAttribute()
32
+ .setAttribute("data-bs-toggle", "modal")
33
+ .setAttribute("data-bs-target", "#languageModal")
34
+ .addClass("text-center"),
35
+ },
36
+ {
37
+ label: "<span class='d-block d-lg-inline-block'>Log in</span>",
38
+ path: "#",
39
+ icon_position: "before",
40
+ icon: {
41
+ name: "person-fill",
42
+ size: "xs",
43
+ path: "/icons.svg",
44
+ },
45
+ attributes: new drupalAttribute()
46
+ .setAttribute("data-bs-toggle", "modal")
47
+ .setAttribute("data-bs-target", "#loginModal")
48
+ .addClass("text-center"),
49
+ },
50
+ ],
51
+ },
52
+ },
53
+ navbar: {
54
+ color_set: "dark",
55
+ collapse_id: "navbarNavDropdown",
56
+ attributes: new drupalAttribute().addClass("bcl-header__navbar"),
57
+ navigation: {
58
+ navbar: true,
59
+ attributes: new drupalAttribute().addClass("me-auto"),
60
+ items: [
61
+ {
62
+ label: "Home",
63
+ path: "/example",
64
+ active: true,
65
+ attributes: new drupalAttribute().setAttribute(
66
+ "aria-current",
67
+ "page"
68
+ ),
69
+ },
70
+ {
71
+ label: "Item 01",
72
+ path: "/example",
73
+ },
74
+ {
75
+ label: "Item 02",
76
+ path: "/example",
77
+ },
78
+ {
79
+ id: "navbarDropdownMenuLink",
80
+ link: true,
81
+ dropdown: true,
82
+ trigger: {
83
+ label: "Dropdown link",
84
+ path: "#",
85
+ attributes: new drupalAttribute().addClass("nav-link"),
86
+ },
87
+ items: [
88
+ {
89
+ label: "Action",
90
+ path: "/example.html",
91
+ },
92
+ {
93
+ label: "Another action",
94
+ path: "/example.html",
95
+ },
96
+ {
97
+ label: "Something else here",
98
+ path: "/example.html",
99
+ },
100
+ ],
101
+ },
102
+ ],
103
+ },
104
+ },
105
+ modals: [
106
+ {
107
+ id: "loginModal",
108
+ header:
109
+ '<h5 class="modal-title" id="loginModalLabel">Log in</h5>' +
110
+ '<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>',
111
+ body:
112
+ "<h5>Disclaimer 1</h5>" +
113
+ "<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum accumsan eget orci eu aliquet. Suspendisse potenti. Integer volutpat, nisl et placerat tincidunt</p>" +
114
+ "<h5>Disclaimer 2</h5>" +
115
+ "<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>",
116
+ footer:
117
+ '<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>' +
118
+ '<button type="button" class="btn btn-primary">Access EU login</button>',
119
+ },
120
+ {
121
+ id: "languageModal",
122
+ size: "fullscreen",
123
+ attributes: new drupalAttribute().addClass("bcl-language"),
124
+ header:
125
+ '<h5 class="modal-title" id="languageeModalLabel">Select your language</h5>' +
126
+ '<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>',
127
+ body:
128
+ '<div class="container">' +
129
+ '<div class="row">' +
130
+ '<div class="col col-lg-8 offset-lg-2">' +
131
+ '<h5 class="bcl-language__title">EU official languages</h5>' +
132
+ "</div>" +
133
+ "</div>" +
134
+ '<div class="row">' +
135
+ '<div class="col col-lg-4 offset-lg-2">' +
136
+ '<div class="bcl-language__list">' +
137
+ '<a href="#" class="bcl-language__item">Language 01</a>' +
138
+ '<a href="#" class="bcl-language__item">Language 02</a>' +
139
+ '<a href="#" class="bcl-language__item">Language 03</a>' +
140
+ "</div>" +
141
+ "</div>" +
142
+ '<div class="col col-lg-4">' +
143
+ '<div class="bcl-language__list">' +
144
+ '<a href="#" class="bcl-language__item">Language 04</a>' +
145
+ '<a href="#" class="bcl-language__item">Language 05</a>' +
146
+ '<a href="#" class="bcl-language__item">Language 06</a>' +
147
+ "</div>" +
148
+ "</div>" +
149
+ "</div>" +
150
+ '<div class="row">' +
151
+ '<div class="col col-lg-8 offset-lg-2">' +
152
+ '<h5 class="bcl-language__title">Non EU languages</h5>' +
153
+ "</div>" +
154
+ "</div>" +
155
+ '<div class="row">' +
156
+ '<div class="col col-lg-4 offset-lg-2">' +
157
+ '<div class="bcl-language__list">' +
158
+ '<a href="#" class="bcl-language__item">Language 07</a>' +
159
+ '<a href="#" class="bcl-language__item">Language 08</a>' +
160
+ "</div>" +
161
+ "</div>" +
162
+ '<div class="col col-lg-4">' +
163
+ '<div class="bcl-language__list">' +
164
+ '<a href="#" class="bcl-language__item">Language 09</a>' +
165
+ '<a href="#" class="bcl-language__item">Language 10</a>' +
166
+ "</div>" +
167
+ "</div>" +
168
+ "</div>" +
169
+ "</div>",
170
+ footer:
171
+ '<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>',
172
+ },
173
+ ],
174
+ breadcrumbs: {
175
+ attributes: new drupalAttribute().addClass(["mt-3"]),
176
+ links: [
177
+ { label: "Home", path: "/example" },
178
+ {
179
+ label: "European Union",
180
+ path: "/example",
181
+ },
182
+ {
183
+ label: "About the European Union",
184
+ path: "/example",
185
+ },
186
+ { label: "News" },
187
+ ],
188
+ icons_path: "/icons.svg",
189
+ },
190
+ };
package/data-ec.js CHANGED
@@ -165,6 +165,11 @@ module.exports = {
165
165
  label: "Something else here",
166
166
  path: "/example.html",
167
167
  },
168
+ {
169
+ label:
170
+ "Very long label with custom text and custom link as an example",
171
+ path: "/example.html",
172
+ },
168
173
  ],
169
174
  },
170
175
  ],
package/data-ucpkn.js CHANGED
@@ -2,13 +2,169 @@ const drupalAttribute = require("drupal-attribute");
2
2
 
3
3
  module.exports = {
4
4
  variant: "ucpkn",
5
- site_name_classes: "pb-3 pb-lg-0",
6
- site_name: "Union Civil Protection Knowledge Network",
5
+ site_name: "UCP Knowledge Network: Applied knowledge for action",
7
6
  light: true,
8
7
  project_logo: {
9
8
  path: "ucpkn_logo.svg",
10
9
  classes: "d-none d-lg-inline-block",
11
10
  },
11
+ navbar: {
12
+ color_set: "dark",
13
+ collapse_id: "navbarNavDropdown",
14
+ attributes: new drupalAttribute().addClass("bcl-header__navbar"),
15
+ form: {
16
+ attributes: new drupalAttribute().addClass(["d-flex", "mt-3", "mt-lg-0"]),
17
+ submit: {
18
+ variant: "light",
19
+ icon: {
20
+ name: "search",
21
+ size: "xs",
22
+ path: "/icons.svg",
23
+ },
24
+ attributes: new drupalAttribute().addClass([
25
+ "border-start-0",
26
+ "rounded-0",
27
+ "rounded-end",
28
+ "d-flex",
29
+ ]),
30
+ },
31
+ items: [
32
+ [
33
+ {
34
+ type: "text",
35
+ required: true,
36
+ label: "Search",
37
+ hidden_label: true,
38
+ placeholder: "Search",
39
+ id: "inlineFormInputGroupSearch",
40
+ attributes: new drupalAttribute().addClass([
41
+ "border-start-0",
42
+ "rounded-0",
43
+ "rounded-start",
44
+ ]),
45
+ },
46
+ ],
47
+ ],
48
+ },
49
+ navigation: {
50
+ navbar: true,
51
+ attributes: new drupalAttribute().addClass("me-auto"),
52
+ items: [
53
+ {
54
+ id: "navbarDropdownMenuLink",
55
+ link: true,
56
+ dropdown: true,
57
+ trigger: {
58
+ label: "Knowledge & Capacity",
59
+ path: "#",
60
+ attributes: new drupalAttribute().addClass("nav-link"),
61
+ },
62
+ items: [
63
+ {
64
+ label: "Knowledge Network Capacity Development Pillar",
65
+ path: "/example.html",
66
+ },
67
+ {
68
+ label: "Disaster Prevention and Risk Management",
69
+ path: "/example.html",
70
+ },
71
+ {
72
+ label: "Disaster Preparedness",
73
+ path: "/example.html",
74
+ },
75
+ {
76
+ label: "Emergency Response Coordination Centre",
77
+ path: "/example.html",
78
+ },
79
+ {
80
+ label: "UCPM Lessons Learnt Programme",
81
+ path: "/example.html",
82
+ },
83
+ ],
84
+ },
85
+ {
86
+ id: "navbarDropdownMenuLinkSecond",
87
+ link: true,
88
+ dropdown: true,
89
+ trigger: {
90
+ label: "Science & Research",
91
+ path: "#",
92
+ attributes: new drupalAttribute().addClass("nav-link"),
93
+ },
94
+ items: [
95
+ {
96
+ label: "Knowledge Network Science Pillar",
97
+ path: "/example.html",
98
+ },
99
+ {
100
+ label: "Disaster Risk Management Knowledge Centre",
101
+ path: "/example.html",
102
+ },
103
+ {
104
+ label: "Knowledge Gaps",
105
+ path: "/example.html",
106
+ },
107
+ {
108
+ label: "Data & Tools",
109
+ path: "/example.html",
110
+ },
111
+ ],
112
+ },
113
+ {
114
+ id: "navbarDropdownMenuLinkThird",
115
+ link: true,
116
+ dropdown: true,
117
+ trigger: {
118
+ label: "Projects",
119
+ path: "#",
120
+ attributes: new drupalAttribute().addClass("nav-link"),
121
+ },
122
+ items: [
123
+ {
124
+ label: "Union Civil Protection Mechanism Projects",
125
+ path: "/example.html",
126
+ },
127
+ {
128
+ label: "Other Disaster Risk Management Projects",
129
+ path: "/example.html",
130
+ },
131
+ {
132
+ label: "EU funding for disaster management",
133
+ path: "/example.html",
134
+ },
135
+ ],
136
+ },
137
+ {
138
+ label: "Stories",
139
+ path: "/example",
140
+ },
141
+ {
142
+ id: "navbarDropdownMenuLinkThird",
143
+ link: true,
144
+ dropdown: true,
145
+ trigger: {
146
+ label: "About",
147
+ path: "#",
148
+ attributes: new drupalAttribute().addClass("nav-link"),
149
+ },
150
+ items: [
151
+ {
152
+ label: "Knowledge Network Governance",
153
+ path: "/example.html",
154
+ },
155
+ {
156
+ label: "The EU Civil Protection Mechanism",
157
+ path: "/example.html",
158
+ },
159
+ {
160
+ label: "Information pack",
161
+ path: "/example.html",
162
+ },
163
+ ],
164
+ },
165
+ ],
166
+ },
167
+ },
12
168
  head: {
13
169
  attributes: new drupalAttribute().addClass(["w-100", "shadow-sm"]),
14
170
  disable_collapse: true,
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@openeuropa/bcl-data-header",
3
3
  "author": "European Commission",
4
4
  "license": "EUPL-1.2",
5
- "version": "0.16.0",
5
+ "version": "0.17.0",
6
6
  "description": "OE header data",
7
7
  "publishConfig": {
8
8
  "access": "public"
@@ -20,5 +20,5 @@
20
20
  "component-library",
21
21
  "design-system"
22
22
  ],
23
- "gitHead": "39a52d25c36789a0c4712b0f6e55cbc5cbbedcb5"
23
+ "gitHead": "07ff24de8a209d80750a32cd52dfe9663fabf8e2"
24
24
  }