@openeuropa/bcl-theme-default 1.5.0 → 1.7.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/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@openeuropa/bcl-theme-default",
3
3
  "author": "European Commission",
4
4
  "license": "EUPL-1.2",
5
- "version": "1.5.0",
5
+ "version": "1.7.0",
6
6
  "description": "OE - BCL theme default",
7
7
  "scripts": {
8
8
  "align-templates": "lerna --scope \"@openeuropa/bcl-twig-templates\" run prepublish",
@@ -22,9 +22,9 @@
22
22
  "@ecl/resources-ec-logo": "3.7.1",
23
23
  "@ecl/resources-eu-logo": "3.7.1",
24
24
  "@ecl/resources-flag-icons": "3.7.1",
25
- "@openeuropa/bcl-bootstrap": "^1.5.0",
26
- "@openeuropa/bcl-builder": "^1.5.0",
27
- "@openeuropa/bcl-twig-templates": "^1.5.0",
25
+ "@openeuropa/bcl-bootstrap": "^1.7.0",
26
+ "@openeuropa/bcl-builder": "^1.7.0",
27
+ "@openeuropa/bcl-twig-templates": "^1.7.0",
28
28
  "copyfiles": "2.4.1",
29
29
  "cross-env": "7.0.3",
30
30
  "flag-icons": "6.9.2",
@@ -49,5 +49,5 @@
49
49
  "design-system",
50
50
  "twig"
51
51
  ],
52
- "gitHead": "7707e40523c6a3d4c719c80388f2df50fa6b7896"
52
+ "gitHead": "04c6da17515cbe8b0c1f3daaf32b3024e3582332"
53
53
  }
@@ -0,0 +1,58 @@
1
+ import Modal from "@openeuropa/bcl-bootstrap/js/src/modal";
2
+ import Offcanvas from "@openeuropa/bcl-bootstrap/js/src/offcanvas";
3
+ import EventHandler from "@openeuropa/bcl-bootstrap/js/src/dom/event-handler";
4
+ import SelectorEngine from "@openeuropa/bcl-bootstrap/js/src/dom/selector-engine";
5
+
6
+ /**
7
+ * AccessibleToggle enhances Bootstrap Modal and Offcanvas components by:
8
+ * - Adding ARIA attributes for improved accessibility.
9
+ * - Updating `aria-expanded` on trigger elements based on visibility.
10
+ * Automatically initializes all modal and offcanvas triggers on the page.
11
+ */
12
+ class AccessibleToggle {
13
+ constructor(triggerElement, type) {
14
+ this.triggerElement = triggerElement;
15
+ this.type = type;
16
+
17
+ const target = triggerElement.getAttribute("data-bs-target") || triggerElement.getAttribute("href");
18
+ this.targetElement = SelectorEngine.findOne(target);
19
+
20
+ if (this.type === "modal") {
21
+ this.instance = Modal.getOrCreateInstance(this.targetElement);
22
+ } else if (this.type === "offcanvas") {
23
+ this.instance = Offcanvas.getOrCreateInstance(this.targetElement);
24
+ }
25
+
26
+ this.addAriaAttributes();
27
+ this.addEventListeners();
28
+ }
29
+
30
+ addAriaAttributes() {
31
+ if (this.triggerElement) {
32
+ this.triggerElement.setAttribute("aria-haspopup", "true");
33
+ this.triggerElement.setAttribute("aria-expanded", "false");
34
+ }
35
+ }
36
+
37
+ addEventListeners() {
38
+ const showEvent = this.type === "modal" ? "show.bs.modal" : "show.bs.offcanvas";
39
+ const hideEvent = this.type === "modal" ? "hide.bs.modal" : "hide.bs.offcanvas";
40
+
41
+ EventHandler.on(this.targetElement, showEvent, () => {
42
+ this.triggerElement.setAttribute("aria-expanded", "true");
43
+ });
44
+
45
+ EventHandler.on(this.targetElement, hideEvent, () => {
46
+ this.triggerElement.setAttribute("aria-expanded", "false");
47
+ });
48
+ }
49
+
50
+ static init(toggles) {
51
+ toggles.forEach(toggle => {
52
+ const triggerElements = SelectorEngine.find(toggle.selector);
53
+ triggerElements.forEach(triggerElement => new AccessibleToggle(triggerElement, toggle.type));
54
+ });
55
+ }
56
+ }
57
+
58
+ export default AccessibleToggle;
@@ -12,6 +12,7 @@ import Collapse from "@openeuropa/bcl-bootstrap/js/src/collapse";
12
12
  import Dropdown from "@openeuropa/bcl-bootstrap/js/src/dropdown";
13
13
  import Gallery from "@openeuropa/bcl-theme-default/src/js/gallery/gallery";
14
14
  import Modal from "@openeuropa/bcl-bootstrap/js/src/modal";
15
+ import AccessibleToggle from "@openeuropa/bcl-theme-default/src/js/accessible-toggle/accessible-toggle";
15
16
  import Offcanvas from "@openeuropa/bcl-bootstrap/js/src/offcanvas";
16
17
  import Popover from "@openeuropa/bcl-bootstrap/js/src/popover";
17
18
  import ScrollSpyV2 from "@openeuropa/bcl-bootstrap/js/src/scrollspy";
@@ -28,6 +29,7 @@ export {
28
29
  Dropdown,
29
30
  Gallery,
30
31
  Modal,
32
+ AccessibleToggle,
31
33
  Offcanvas,
32
34
  Popover,
33
35
  ScrollSpyV2,
@@ -12,6 +12,7 @@ import Collapse from "@openeuropa/bcl-bootstrap/js/src/collapse";
12
12
  import Dropdown from "@openeuropa/bcl-bootstrap/js/src/dropdown";
13
13
  import Gallery from "@openeuropa/bcl-theme-default/src/js/gallery/gallery";
14
14
  import Modal from "@openeuropa/bcl-bootstrap/js/src/modal";
15
+ import AccessibleToggle from "@openeuropa/bcl-theme-default/src/js/accessible-toggle/accessible-toggle";
15
16
  import Offcanvas from "@openeuropa/bcl-bootstrap/js/src/offcanvas";
16
17
  import Popover from "@openeuropa/bcl-bootstrap/js/src/popover";
17
18
  import ScrollSpyV2 from "@openeuropa/bcl-bootstrap/js/src/scrollspy";
@@ -28,6 +29,7 @@ export default {
28
29
  Dropdown,
29
30
  Gallery,
30
31
  Modal,
32
+ AccessibleToggle,
31
33
  Offcanvas,
32
34
  Popover,
33
35
  ScrollSpyV2,
@@ -0,0 +1,4 @@
1
+ //Blockquote
2
+ .blockquote-footer {
3
+ color: $text-muted;
4
+ }
@@ -270,6 +270,10 @@ $header-link-active-background: #003776 !default;
270
270
  .btn-close {
271
271
  opacity: 1;
272
272
  }
273
+ .modal-title {
274
+ @extend %heading;
275
+ @include font-size($h5-font-size);
276
+ }
273
277
  &.bcl-language-list-modal--ec,
274
278
  &.bcl-language-list-modal--eu {
275
279
  .modal-body {
@@ -288,7 +292,7 @@ $header-link-active-background: #003776 !default;
288
292
  .modal-dialog {
289
293
  background: $white;
290
294
  }
291
- h5 {
295
+ .modal-title {
292
296
  color: $eu-cta-color;
293
297
  }
294
298
  svg {
@@ -303,7 +307,7 @@ $header-link-active-background: #003776 !default;
303
307
  .modal-content {
304
308
  background: $eu-background-color;
305
309
  }
306
- h5 {
310
+ .modal-title {
307
311
  color: $white;
308
312
  }
309
313
  svg {
@@ -94,6 +94,11 @@ select.multi-select {
94
94
  margin-top: 0;
95
95
  align-self: center;
96
96
  }
97
+ .ss-values {
98
+ .ss-disabled {
99
+ color: #6c757d;
100
+ }
101
+ }
97
102
  }
98
103
  }
99
104
 
@@ -59,6 +59,7 @@
59
59
  // Custom styles
60
60
  @import "@openeuropa/bcl-theme-default/src/scss/alert";
61
61
  @import "@openeuropa/bcl-theme-default/src/scss/button";
62
+ @import "@openeuropa/bcl-theme-default/src/scss/blockquote";
62
63
  @import "@openeuropa/bcl-theme-default/src/scss/card";
63
64
  @import "@openeuropa/bcl-theme-default/src/scss/collapse";
64
65
  @import "@openeuropa/bcl-theme-default/src/scss/circular-progress-bar";
@@ -26,7 +26,7 @@
26
26
  <div class="d-flex justify-content-between align-items-center">
27
27
  {% endif %}
28
28
  <div class="d-flex align-items-center">
29
- {% set _title_classes = 'mb-0' %}
29
+ {% set _title_classes = 'modal-title mb-0' %}
30
30
  {% if _icon_path is not empty %}
31
31
  {% set _title_classes = _title_classes ~ ' ms-2' %}
32
32
  {% include '@oe-bcl/bcl-icon/icon.html.twig' with {
@@ -34,7 +34,7 @@
34
34
  path: _icon_path
35
35
  } only %}
36
36
  {% endif %}
37
- <h5 class="{{ _title_classes }}">{{ _title }}</h5>
37
+ <div class="{{ _title_classes }}">{{ _title }}</div>
38
38
  </div>
39
39
  <button type="button" class="btn-close" data-bs-dismiss="modal"
40
40
  {% if _close_label is not empty %}