@openeuropa/bcl-theme-joinup 0.3791.202505281825 → 0.3880.202510091030

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.
Files changed (32) hide show
  1. package/bcl-builder.config.js +2 -0
  2. package/css/oe-bcl-joinup.css +759 -269
  3. package/css/oe-bcl-joinup.css.map +1 -1
  4. package/css/oe-bcl-joinup.min.css +1 -1
  5. package/css/oe-bcl-joinup.min.css.map +1 -1
  6. package/js/oe-bcl-joinup.bundle.js +187 -0
  7. package/js/oe-bcl-joinup.bundle.js.map +1 -1
  8. package/js/oe-bcl-joinup.bundle.min.js +1 -1
  9. package/js/oe-bcl-joinup.bundle.min.js.map +1 -1
  10. package/js/oe-bcl-joinup.esm.js +186 -1
  11. package/js/oe-bcl-joinup.esm.js.map +1 -1
  12. package/js/oe-bcl-joinup.esm.min.js +1 -1
  13. package/js/oe-bcl-joinup.esm.min.js.map +1 -1
  14. package/js/oe-bcl-joinup.umd.js +187 -0
  15. package/js/oe-bcl-joinup.umd.js.map +1 -1
  16. package/js/oe-bcl-joinup.umd.min.js +1 -1
  17. package/js/oe-bcl-joinup.umd.min.js.map +1 -1
  18. package/js/slim-select-2/slimselect.min.js +1 -1
  19. package/package.json +8 -8
  20. package/src/js/index.esm.js +4 -0
  21. package/src/js/index.umd.js +4 -0
  22. package/src/scss/oe-bcl-joinup.scss +1 -0
  23. package/templates/bcl-button/button.html.twig +3 -2
  24. package/templates/bcl-header/header.html.twig +37 -6
  25. package/templates/bcl-inpage-navigation/inpage-navigation.html.twig +7 -2
  26. package/templates/bcl-mega-menu/mega-menu-items.html.twig +35 -0
  27. package/templates/bcl-mega-menu/mega-menu-submenu.html.twig +65 -0
  28. package/templates/bcl-mega-menu/mega-menu.html.twig +115 -0
  29. package/templates/bcl-modal/modal.html.twig +16 -4
  30. package/templates/bcl-navigation/navigation.html.twig +3 -1
  31. package/templates/bcl-offcanvas/offcanvas.html.twig +9 -6
  32. package/templates/bcl-toast/toasts.html.twig +13 -4
@@ -0,0 +1,115 @@
1
+ {% apply spaceless %}
2
+
3
+ {# Parameters:
4
+ - id (string) (default: dropdown-random(1000))
5
+ - link (boolean) (default: false) - sets trigger to link, default is button
6
+ - trigger (link or button)
7
+ - content_block (block) (default: '')
8
+ - content_link (link)
9
+ - icon_path (string) (default: '')
10
+ - min_height (string) (default: '300px')
11
+ ! set min-height of mega-menu
12
+ - items (object[])
13
+ format: [
14
+ {
15
+ - link or dropdown
16
+ }
17
+ ]
18
+ - back_button_label (string) (default: 'Back')
19
+ - icon_path (string) (default: '')
20
+ #}
21
+
22
+ {% set _id = id|default('dropdown-' ~ random(1000)) %}
23
+ {% set _link = link ?? false %}
24
+ {% set _trigger = trigger|default({}) %}
25
+ {% set _content_block = content_block|default('') %}
26
+ {% set _content_link = content_link|default({}) %}
27
+ {% set _icon_path = icon_path|default('') %}
28
+ {% set _items = items|default([]) %}
29
+ {% set _back_button_label = back_button_label|default('Back') %}
30
+ {% set _icon_path = icon_path|default('') %}
31
+ {% set _menu_id = 'mega-menu-' ~ _id %}
32
+
33
+ {% if attributes is empty %}
34
+ {% set attributes = create_attribute() %}
35
+ {% endif %}
36
+
37
+ {% set _classes = ['bcl-mega-menu'] %}
38
+
39
+ {% set attributes = attributes.addClass(_classes) %}
40
+
41
+ {% if _trigger.attributes is empty %}
42
+ {% set _trigger = _trigger|merge({
43
+ attributes: create_attribute()
44
+ }) %}
45
+ {% endif %}
46
+ {% set _trigger = _trigger|merge({
47
+ attributes: _trigger.attributes.addClass(['dropdown-toggle', 'nav-link'])
48
+ .setAttribute('aria-expanded', 'false')
49
+ .setAttribute('aria-haspopup', 'menu')
50
+ .setAttribute('aria-controls', _menu_id)
51
+ .setAttribute('data-bs-toggle', 'dropdown')
52
+ .setAttribute('data-bs-auto-close', 'outside')
53
+ .setAttribute('id', _id)
54
+ }) %}
55
+
56
+ <div {{ attributes }}>
57
+ {% include '@oe-bcl/bcl-button/button.html.twig' with _trigger|merge({
58
+ variant: 'link',
59
+ clean_class: true,
60
+ }) only %}
61
+ {# Mega menu panel. #}
62
+ <nav id="{{ _menu_id }}" class="bcl-mega-menu__container dropdown-menu" aria-labelledby="{{ _id }}" aria-label="Main mega menu">
63
+ <div class="container">
64
+ {# Mobile back button. #}
65
+ <div class="container d-lg-none bcl-mega-menu__back-button-block">
66
+ {% include '@oe-bcl/bcl-button/button.html.twig' with {
67
+ label: _back_button_label,
68
+ icon_position: "before",
69
+ variant: 'link',
70
+ icon: {
71
+ path: _icon_path,
72
+ name: "arrow-left",
73
+ },
74
+ attributes: create_attribute().addClass(['back-button']).setAttribute('aria-label', 'Back to main menu')
75
+ } only %}
76
+ </div>
77
+ {# Info/summary and submenu columns. #}
78
+ <div class="position-relative">
79
+ <div class="row">
80
+ {# Content / summary column. #}
81
+ {% if content_block is defined %}
82
+ <div class="col-md-12 col-xl-3 position-relative bcl-mega-menu__info">
83
+ <div class="content-block">
84
+ {%- block content_block -%}
85
+ {{ _content_block }}
86
+ {%- endblock -%}
87
+ {% if _content_link.path is not empty %}
88
+ {% set _content_link = _content_link|merge({
89
+ icon: _content_link.icon|default({})|merge({
90
+ path: _icon_path
91
+ }),
92
+ attributes: (_content_link.attributes is defined
93
+ ? _content_link.attributes
94
+ : create_attribute()
95
+ ).addClass('content-link')
96
+ }) %}
97
+ <p class="m-0">{% include '@oe-bcl/bcl-link/link.html.twig' with _content_link only %}</p>
98
+ {% endif %}
99
+ </div>
100
+ <div class="shadow-container">
101
+ <span class="shadow-bg"></span>
102
+ </div>
103
+ </div>
104
+ {% endif %}
105
+ {# Submenu column. #}
106
+ <div class="col-md-12 col-lg-4 col-xl-3 bcl-mega-menu__menu">
107
+ {% include '@oe-bcl/bcl-mega-menu/mega-menu-items.html.twig' %}
108
+ </div>
109
+ </div>
110
+ </div>
111
+ </div>
112
+ </nav>
113
+ </div>
114
+
115
+ {% endapply %}
@@ -14,7 +14,10 @@
14
14
  - body (block) (default: '')
15
15
  - footer (block) (default: '')
16
16
  - attributes (drupal attrs)
17
-
17
+ - header_attributes (drupal attrs)
18
+ - body_attributes (drupal attrs)
19
+ - footer_attributes (drupal attrs)
20
+
18
21
  Blocks
19
22
  - header
20
23
  - messages
@@ -29,9 +32,12 @@
29
32
  {% set _verticaly_centered = verticaly_centered ?? false %}
30
33
  {% set _scrollable = scrollable ?? false %}
31
34
  {% set _header = header|default('') %}
35
+ {% set _header_attributes = header_attributes ?: create_attribute() %}
32
36
  {% set _messages = messages|default('') %}
33
37
  {% set _body = body|default('') %}
38
+ {% set _body_attributes = body_attributes ?: create_attribute() %}
34
39
  {% set _footer = footer|default('') %}
40
+ {% set _footer_attributes = footer_attributes ?: create_attribute() %}
35
41
 
36
42
  {% set _classes = ['modal', 'fade'] %}
37
43
 
@@ -62,16 +68,22 @@
62
68
  >
63
69
  <div class="modal-content">
64
70
  {% if header is not empty %}
65
- <div class="modal-header">
71
+ <div
72
+ {{- _header_attributes.addClass(['modal-header']) -}}
73
+ >
66
74
  {%- block header _header -%}
67
75
  </div>
68
76
  {% endif %}
69
77
  {%- block messages _messages -%}
70
- <div class="modal-body">
78
+ <div
79
+ {{- _body_attributes.addClass(['modal-body']) -}}
80
+ >
71
81
  {%- block body _body -%}
72
82
  </div>
73
83
  {% if footer is not empty %}
74
- <div class="modal-footer">
84
+ <div
85
+ {{- _footer_attributes.addClass(['modal-footer']) -}}
86
+ >
75
87
  {%- block footer _footer -%}
76
88
  </div>
77
89
  {% endif %}
@@ -91,7 +91,7 @@
91
91
  {% set _nav_class = _nav_class ~ ' dropdown' %}
92
92
  {% set _item = _item|merge({remove_wrapper: true}) %}
93
93
  {% endif %}
94
- {% if _item.dropdown %}
94
+ {% if _item.dropdown or _item.mega_menu %}
95
95
  {% set _item_classes = [] %}
96
96
  {% else %}
97
97
  {% set _item_classes = ['nav-link'] %}
@@ -124,6 +124,8 @@
124
124
  {% include '@oe-bcl/bcl-dropdown/dropdown.html.twig' with _item only %}
125
125
  {% elseif _item.button is defined %}
126
126
  {% include '@oe-bcl/bcl-button/button.html.twig' with _item only %}
127
+ {% elseif _item.mega_menu is defined %}
128
+ {% include '@oe-bcl/bcl-mega-menu/mega-menu.html.twig' with _item only %}
127
129
  {% else %}
128
130
  {% include '@oe-bcl/bcl-link/link.html.twig' with _item only %}
129
131
  {% endif %}
@@ -25,7 +25,7 @@
25
25
  {% set _title_link = title_link|default({}) %}
26
26
  {% set _title_attributes = title_attributes ?: create_attribute() %}
27
27
  {% set _placement = placement|default('') %}
28
- {% set _id = id|default('') %}
28
+ {% set _id = id|default('bcl-offcanvas-' ~ random(10000)) %}
29
29
  {% set _body = body|default('') %}
30
30
  {% set _with_body_scroll = with_body_scroll ?? false %}
31
31
  {% set _with_backdrop = with_backdrop ?? true %}
@@ -57,14 +57,12 @@
57
57
  {% set attributes = create_attribute() %}
58
58
  {% endif %}
59
59
 
60
+ {% set attributes = attributes.setAttribute('id', _id) %}
61
+
60
62
  {% if _aria_labelled is defined and _aria_labelled is not empty %}
61
63
  {% set attributes = attributes.setAttribute('aria-labelledby', _aria_labelled) %}
62
64
  {% endif %}
63
65
 
64
- {% if _id is not empty %}
65
- {% set attributes = attributes.setAttribute('id', _id) %}
66
- {% endif %}
67
-
68
66
  {% if _with_body_scroll %}
69
67
  {% set attributes = attributes.setAttribute('data-bs-scroll', 'true') %}
70
68
  {% endif %}
@@ -73,6 +71,10 @@
73
71
  {% set attributes = attributes.setAttribute('data-bs-backdrop', 'false') %}
74
72
  {% endif %}
75
73
 
74
+ {% if _title is not empty %}
75
+ {% set attributes = attributes.setAttribute('aria-labelledby', _id ~ '-title') %}
76
+ {% endif %}
77
+
76
78
  {% set attributes = attributes.setAttribute('tabindex', '-1').addClass(_classes) %}
77
79
 
78
80
  <div
@@ -85,7 +87,7 @@
85
87
  title: _title,
86
88
  title_tag: _title_tag,
87
89
  title_link: _title_link,
88
- attributes: _title_attributes.addClass(['offcanvas-title']),
90
+ attributes: _title_attributes.setAttribute('id', _id ~ '-title').addClass(['offcanvas-title']),
89
91
  } only %}
90
92
  {% endif %}
91
93
  {% if _with_close %}
@@ -94,6 +96,7 @@
94
96
  .setAttribute('data-bs-dismiss', 'offcanvas')
95
97
  .setAttribute('data-bs-target', '#' ~ _id)
96
98
  .setAttribute('aria-label', _close_aria_label)
99
+ .setAttribute('aria-controls', _id)
97
100
  %}
98
101
  {% if _extra_classes_close is not empty %}
99
102
  {% set button_attributes = button_attributes.addClass(_extra_classes_close) %}
@@ -10,6 +10,11 @@
10
10
  - toasts (object[]) format: [
11
11
  {
12
12
  - body (string) (default: '')
13
+ - body_attributes (drupal attrs)
14
+ - header (string) (default: '')
15
+ - header_attributes (drupal attrs)
16
+ - button_attributes (drupal attrs)
17
+ - custom_content (string) (default: '')
13
18
  - role (string) (default: 'alert')
14
19
  - with_close (boolean) (default: true)
15
20
  - autohide (boolean) (default: false)
@@ -66,6 +71,9 @@
66
71
  {% set _with_body_wrapper = _toast.with_body_wrapper ?? false %}
67
72
  {% set _body_wrapper_classes = _toast.body_wrapper_classes|default('') %}
68
73
  {% set _toast_attributes = _toast.attributes ?: create_attribute() %}
74
+ {% set _body_attributes = _toast.body_attributes ?: create_attribute() %}
75
+ {% set _header_attributes = _toast.header_attributes ?: create_attribute() %}
76
+ {% set _button_attributes = _toast.button_attributes ?: create_attribute() %}
69
77
  {% set _toast_attributes = _toast_attributes.addClass(_classes).setAttribute('aria-atomic', 'true') %}
70
78
  {% if _aria_live is not empty %}
71
79
  {% set _toast_attributes = _toast_attributes.setAttribute('aria-live', _aria_live) %}
@@ -82,16 +90,16 @@
82
90
  {% if _with_close or
83
91
  (_toast.header is defined and _toast.header is not empty)
84
92
  %}
85
- <div class="toast-header">
93
+ <div{{ _header_attributes.addClass(['toast-header']) }}>
86
94
  {{- _toast.header|default('') -}}
87
95
  {% if _with_close %}
88
- {% set button_attributes = create_attribute()
96
+ {% set _button_attributes = _button_attributes
89
97
  .addClass(['btn-close'])
90
98
  .setAttribute('aria-label', 'close')
91
99
  .setAttribute('data-bs-dismiss', 'toast')
92
100
  %}
93
101
  {%- include '@oe-bcl/bcl-button/button.html.twig' with {
94
- attributes: button_attributes,
102
+ attributes: _button_attributes,
95
103
  clean_class: true
96
104
  } only -%}
97
105
  {% endif %}
@@ -104,12 +112,13 @@
104
112
  {% endif %}
105
113
  >
106
114
  {% endif %}
107
- <div class="toast-body">
115
+ <div{{ _body_attributes.addClass(['toast-body']) }}>
108
116
  {{- _body -}}
109
117
  </div>
110
118
  {% if _with_body_wrapper %}
111
119
  </div>
112
120
  {% endif %}
121
+ {{- _toast.custom_content|default('') -}}
113
122
  </div>
114
123
  {% endfor %}
115
124
  {% endif %}