@openeuropa/bcl-theme-default 1.9.0 → 1.9.2

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 (35) hide show
  1. package/css/color-scheme.min.css +1 -1
  2. package/css/color-scheme.min.css.map +1 -1
  3. package/css/oe-bcl-ckeditor5.min.css +1 -1
  4. package/css/oe-bcl-ckeditor5.min.css.map +1 -1
  5. package/css/oe-bcl-default.css +2312 -680
  6. package/css/oe-bcl-default.css.map +1 -1
  7. package/css/oe-bcl-default.min.css +1 -1
  8. package/css/oe-bcl-default.min.css.map +1 -1
  9. package/icons/bcl-default-icons.svg +1 -1
  10. package/icons/bootstrap-icons.svg +1 -1
  11. package/js/oe-bcl-default.bundle.js +842 -699
  12. package/js/oe-bcl-default.bundle.js.map +1 -1
  13. package/js/oe-bcl-default.bundle.min.js +1 -1
  14. package/js/oe-bcl-default.bundle.min.js.map +1 -1
  15. package/js/oe-bcl-default.esm.js +830 -688
  16. package/js/oe-bcl-default.esm.js.map +1 -1
  17. package/js/oe-bcl-default.esm.min.js +1 -1
  18. package/js/oe-bcl-default.esm.min.js.map +1 -1
  19. package/js/oe-bcl-default.umd.js +842 -699
  20. package/js/oe-bcl-default.umd.js.map +1 -1
  21. package/js/oe-bcl-default.umd.min.js +1 -1
  22. package/js/oe-bcl-default.umd.min.js.map +1 -1
  23. package/package.json +5 -5
  24. package/src/js/accordion-toggle/accordion-toggle.js +51 -0
  25. package/src/js/index.esm.js +6 -4
  26. package/src/js/index.umd.js +6 -4
  27. package/src/scss/_inpage-navigation.scss +69 -4
  28. package/src/scss/base/_colors.scss +31 -3
  29. package/src/scss/color_scheme/_alert.scss +14 -10
  30. package/src/scss/color_scheme/_background.scss +1 -0
  31. package/src/scss/color_scheme/_list_group.scss +15 -10
  32. package/src/scss/oe-bcl-default.scss +4 -2
  33. package/templates/bcl-accordion/accordion.html.twig +85 -46
  34. package/templates/bcl-inpage-navigation/inpage-navigation.html.twig +9 -1
  35. package/templates/bcl-mega-menu/mega-menu.html.twig +0 -123
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.9.0",
5
+ "version": "1.9.2",
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.9.0",
26
- "@openeuropa/bcl-builder": "^1.9.0",
27
- "@openeuropa/bcl-twig-templates": "^1.9.0",
25
+ "@openeuropa/bcl-bootstrap": "^1.9.2",
26
+ "@openeuropa/bcl-builder": "^1.9.2",
27
+ "@openeuropa/bcl-twig-templates": "^1.9.2",
28
28
  "@rollup/plugin-replace": "6.0.2",
29
29
  "copyfiles": "2.4.1",
30
30
  "cross-env": "7.0.3",
@@ -50,5 +50,5 @@
50
50
  "design-system",
51
51
  "twig"
52
52
  ],
53
- "gitHead": "461de595e5ddda95383ceaf5d02d513aef111246"
53
+ "gitHead": "4ffc129d7f11f3e1b7f283c36379ea458af986b7"
54
54
  }
@@ -0,0 +1,51 @@
1
+ import Collapse from "@openeuropa/bcl-bootstrap/js/src/collapse";
2
+ import EventHandler from "@openeuropa/bcl-bootstrap/js/src/dom/event-handler";
3
+ import SelectorEngine from "@openeuropa/bcl-bootstrap/js/src/dom/selector-engine";
4
+
5
+ class AccordionToggle {
6
+ static isInitialized = false;
7
+
8
+ constructor(buttonElement) {
9
+ this.buttonElement = buttonElement;
10
+ this.targetAccordionId = buttonElement.getAttribute("data-target");
11
+ this.action = buttonElement.getAttribute("data-action");
12
+
13
+ this.accordionElement = SelectorEngine.findOne(`#${this.targetAccordionId}`);
14
+ this.accordionItems = SelectorEngine.find(".accordion-collapse", this.accordionElement);
15
+
16
+ this.addEventListeners();
17
+ }
18
+
19
+ addEventListeners() {
20
+ EventHandler.on(this.buttonElement, "click", (event) => this.handleAccordionAction(event));
21
+ }
22
+
23
+ handleAccordionAction(event) {
24
+ const item = event.target;
25
+ const action = item.getAttribute('data-action');
26
+ const accordionItems = this.accordionItems;
27
+
28
+ accordionItems.forEach((accordionItem) => {
29
+ const collapseInstance = Collapse.getOrCreateInstance(accordionItem, { toggle: false });
30
+
31
+ if (action === 'expand') {
32
+ collapseInstance.show();
33
+ } else if (action === 'collapse') {
34
+ collapseInstance.hide();
35
+ }
36
+ });
37
+ }
38
+
39
+ static init() {
40
+ if (AccordionToggle.isInitialized) {
41
+ return;
42
+ }
43
+
44
+ const toggleButtons = SelectorEngine.find('[data-action][data-target]');
45
+ toggleButtons.forEach(buttonElement => new AccordionToggle(buttonElement));
46
+
47
+ AccordionToggle.isInitialized = true;
48
+ }
49
+ }
50
+
51
+ export default AccordionToggle;
@@ -10,9 +10,7 @@ import Button from "@openeuropa/bcl-bootstrap/js/src/button";
10
10
  import Carousel from "@openeuropa/bcl-bootstrap/js/src/carousel";
11
11
  import Collapse from "@openeuropa/bcl-bootstrap/js/src/collapse";
12
12
  import Dropdown from "@openeuropa/bcl-bootstrap/js/src/dropdown";
13
- import Gallery from "@openeuropa/bcl-theme-default/src/js/gallery/gallery";
14
13
  import Modal from "@openeuropa/bcl-bootstrap/js/src/modal";
15
- import AccessibleToggle from "@openeuropa/bcl-theme-default/src/js/accessible-toggle/accessible-toggle";
16
14
  import Offcanvas from "@openeuropa/bcl-bootstrap/js/src/offcanvas";
17
15
  import Popover from "@openeuropa/bcl-bootstrap/js/src/popover";
18
16
  import ScrollSpyV2 from "@openeuropa/bcl-bootstrap/js/src/scrollspy";
@@ -20,6 +18,9 @@ import ScrollSpy from "@openeuropa/bcl-bootstrap/js/src/scrollspy-legacy";
20
18
  import Tab from "@openeuropa/bcl-bootstrap/js/src/tab";
21
19
  import Toast from "@openeuropa/bcl-bootstrap/js/src/toast";
22
20
  import Tooltip from "@openeuropa/bcl-bootstrap/js/src/tooltip";
21
+ import Gallery from "@openeuropa/bcl-theme-default/src/js/gallery/gallery";
22
+ import AccordionToggle from "@openeuropa/bcl-theme-default/src/js/accordion-toggle/accordion-toggle";
23
+ import AccessibleToggle from "@openeuropa/bcl-theme-default/src/js/accessible-toggle/accessible-toggle";
23
24
 
24
25
  export {
25
26
  Alert,
@@ -27,9 +28,7 @@ export {
27
28
  Carousel,
28
29
  Collapse,
29
30
  Dropdown,
30
- Gallery,
31
31
  Modal,
32
- AccessibleToggle,
33
32
  Offcanvas,
34
33
  Popover,
35
34
  ScrollSpyV2,
@@ -37,4 +36,7 @@ export {
37
36
  Tab,
38
37
  Toast,
39
38
  Tooltip,
39
+ Gallery,
40
+ AccessibleToggle,
41
+ AccordionToggle,
40
42
  };
@@ -10,9 +10,7 @@ import Button from "@openeuropa/bcl-bootstrap/js/src/button";
10
10
  import Carousel from "@openeuropa/bcl-bootstrap/js/src/carousel";
11
11
  import Collapse from "@openeuropa/bcl-bootstrap/js/src/collapse";
12
12
  import Dropdown from "@openeuropa/bcl-bootstrap/js/src/dropdown";
13
- import Gallery from "@openeuropa/bcl-theme-default/src/js/gallery/gallery";
14
13
  import Modal from "@openeuropa/bcl-bootstrap/js/src/modal";
15
- import AccessibleToggle from "@openeuropa/bcl-theme-default/src/js/accessible-toggle/accessible-toggle";
16
14
  import Offcanvas from "@openeuropa/bcl-bootstrap/js/src/offcanvas";
17
15
  import Popover from "@openeuropa/bcl-bootstrap/js/src/popover";
18
16
  import ScrollSpyV2 from "@openeuropa/bcl-bootstrap/js/src/scrollspy";
@@ -20,6 +18,9 @@ import ScrollSpy from "@openeuropa/bcl-bootstrap/js/src/scrollspy-legacy";
20
18
  import Tab from "@openeuropa/bcl-bootstrap/js/src/tab";
21
19
  import Toast from "@openeuropa/bcl-bootstrap/js/src/toast";
22
20
  import Tooltip from "@openeuropa/bcl-bootstrap/js/src/tooltip";
21
+ import AccordionToggle from "@openeuropa/bcl-theme-default/src/js/accordion-toggle/accordion-toggle";
22
+ import Gallery from "@openeuropa/bcl-theme-default/src/js/gallery/gallery";
23
+ import AccessibleToggle from "@openeuropa/bcl-theme-default/src/js/accessible-toggle/accessible-toggle";
23
24
 
24
25
  export default {
25
26
  Alert,
@@ -27,9 +28,7 @@ export default {
27
28
  Carousel,
28
29
  Collapse,
29
30
  Dropdown,
30
- Gallery,
31
31
  Modal,
32
- AccessibleToggle,
33
32
  Offcanvas,
34
33
  Popover,
35
34
  ScrollSpyV2,
@@ -37,4 +36,7 @@ export default {
37
36
  Tab,
38
37
  Toast,
39
38
  Tooltip,
39
+ Gallery,
40
+ AccessibleToggle,
41
+ AccordionToggle,
40
42
  };
@@ -1,3 +1,4 @@
1
+ /* stylelint-disable no-descending-specificity */
1
2
  .bcl-sidebar:has(> .bcl-inpage-navigation) {
2
3
  position: sticky;
3
4
  top: 0;
@@ -66,10 +67,68 @@
66
67
  padding-right: 0;
67
68
  }
68
69
  }
69
-
70
- @include media-breakpoint-down(lg) {
71
- .bcl-sidebar:has(> .bcl-inpage-navigation) {
72
- padding-bottom: map-get($spacers, 3);
70
+ @include media-breakpoint-down(md) {
71
+ .bcl-inpage-navigation.dynamic-active {
72
+ display: none;
73
+ &:has(.active) {
74
+ display: block;
75
+ }
76
+ }
77
+ .bcl-sidebar {
78
+ .bcl-inpage-navigation.dynamic-active {
79
+ ul {
80
+ padding: map-get($spacers, 1);
81
+ }
82
+ .bcl-heading {
83
+ position: absolute;
84
+ left: 0;
85
+ top: 0;
86
+ width: 100%;
87
+ z-index: 2000;
88
+ height: 64px;
89
+ opacity: 0;
90
+ }
91
+ .dropdown-menu {
92
+ display: block;
93
+ padding: map-get($spacers, 2);
94
+ position: absolute;
95
+ &.show {
96
+ .nav-item {
97
+ display: block;
98
+ &:has(> .active) {
99
+ order: -1;
100
+ }
101
+ }
102
+ &:after {
103
+ border-top-color: transparent;
104
+ border-bottom: 5px solid #fff;
105
+ top: 25px;
106
+ }
107
+ }
108
+ .nav {
109
+ display: flex;
110
+ }
111
+ .nav-item {
112
+ display: none;
113
+ transition: none;
114
+ &:has(> .active) {
115
+ display: block;
116
+ }
117
+ .nav-link {
118
+ margin: 0;
119
+ }
120
+ }
121
+ &:after {
122
+ content: "";
123
+ border-left: 5px solid transparent;
124
+ border-right: 5px solid transparent;
125
+ border-top: 5px solid #fff;
126
+ position: absolute;
127
+ top: 30px;
128
+ right: 22px;
129
+ }
130
+ }
131
+ }
73
132
  }
74
133
  }
75
134
 
@@ -94,3 +153,9 @@
94
153
  }
95
154
  }
96
155
  }
156
+
157
+ @include media-breakpoint-down(lg) {
158
+ .bcl-sidebar:has(> .bcl-inpage-navigation) {
159
+ padding-bottom: map-get($spacers, 3);
160
+ }
161
+ }
@@ -9,6 +9,11 @@ $success: #09854c;
9
9
  $light: #f8f9fa;
10
10
  $dark: #212529;
11
11
 
12
+ $gray-200: #e9ecef;
13
+ $gray-400: #ced4da;
14
+ $gray-600: #6c757d;
15
+ $gray-700: #495057;
16
+
12
17
  $text-muted: #495057;
13
18
 
14
19
  // Color variants scales
@@ -16,6 +21,29 @@ $text-muted: #495057;
16
21
  // Tables
17
22
  $table-hover-bg-factor: 0.1;
18
23
 
19
- // Alerts
20
- $alert-bg-scale: -90%;
21
- $alert-border-scale: -80%;
24
+ // Background colors as before for Alerts and list-group
25
+ $primary-bg-subtle: tint-color($primary, 90%);
26
+ $secondary-bg-subtle: tint-color($secondary, 90%);
27
+ $success-bg-subtle: tint-color($success, 90%);
28
+ $info-bg-subtle: tint-color($info, 90%);
29
+ $warning-bg-subtle: tint-color($warning, 90%);
30
+ $danger-bg-subtle: tint-color($danger, 90%);
31
+
32
+ $primary-border-subtle: tint-color($primary, 80%);
33
+ $secondary-border-subtle: tint-color($secondary, 80%);
34
+ $success-border-subtle: tint-color($success, 80%);
35
+ $info-border-subtle: tint-color($info, 80%);
36
+ $warning-border-subtle: tint-color($warning, 80%);
37
+ $danger-border-subtle: tint-color($danger, 80%);
38
+
39
+ // Colors as in Bootstrap 5.2.3
40
+
41
+ $breadcrumb-active-color: $gray-600;
42
+ $form-check-input-border: 1px solid #00000040;
43
+ $input-border-color: $gray-400;
44
+ $body-secondary-color: $gray-700;
45
+ $input-placeholder-color: $gray-600;
46
+ $form-file-button-bg: $gray-200;
47
+ $nav-link-disabled-color: $gray-600;
48
+ $table-border-factor: 0.1;
49
+ $nav-tabs-link-active-color: $gray-700;
@@ -1,18 +1,22 @@
1
1
  // Color scheme - Alert
2
2
 
3
+ // No longer using $alert-bg-scale, $alert-border-scale, $alert-color-scale variables because they are deprecated in bootstrap 5.3.x
4
+
5
+ @use "sass:math";
6
+
3
7
  @mixin generate-alerts($color, $value) {
4
- $alert-background: shift-color($value, $alert-bg-scale);
5
- $alert-border: shift-color($value, $alert-border-scale);
6
- $alert-color: shift-color($value, $alert-color-scale);
8
+ $bg: shift-color($value, -80%);
9
+ $border: shift-color($value, -70%);
10
+ $text: shift-color($value, 40%);
7
11
 
8
- @if (contrast-ratio($alert-background, $alert-color) < $min-contrast-ratio) {
9
- $alert-color: mix(
10
- $value,
11
- color-contrast($alert-background),
12
- abs($alert-color-scale)
13
- );
12
+ @if (contrast-ratio($bg, $text) < $min-contrast-ratio) {
13
+ $text: mix($value, color-contrast($bg), math.abs(40%));
14
14
  }
15
+
15
16
  .alert-#{$color} {
16
- @include alert-variant($alert-background, $alert-border, $alert-color);
17
+ --#{$prefix}alert-bg: #{$bg};
18
+ --#{$prefix}alert-border-color: #{$border};
19
+ --#{$prefix}alert-color: #{$text};
20
+ --#{$prefix}alert-link-color: #{$text}; // or some other logic
17
21
  }
18
22
  }
@@ -6,6 +6,7 @@
6
6
  $accordion-button-active-bg: tint-color($value, 90%);
7
7
  --#{$prefix}accordion-bg: #{$value};
8
8
  --#{$prefix}accordion-active-bg: #{$accordion-button-active-bg};
9
+ --#{$prefix}table-bg: #{$value};
9
10
 
10
11
  // Card
11
12
  .card {
@@ -1,15 +1,20 @@
1
1
  // Color scheme - List Group
2
2
 
3
+ @use "sass:math";
4
+
3
5
  @mixin generate-list-group($color, $value) {
4
- // List group
5
- $lg-v-bg: shift-color($value, $list-group-item-bg-scale);
6
- $lg-v-color: shift-color($value, $list-group-item-color-scale);
7
- @if (contrast-ratio($lg-v-bg, $lg-v-color) < $min-contrast-ratio) {
8
- $lg-v-color: mix(
9
- $value,
10
- color-contrast($lg-v-bg),
11
- abs($list-group-item-color-scale)
12
- );
6
+ $bg: shift-color($value, -80%);
7
+ $text: $value;
8
+ $border: shift-color($value, 40%);
9
+
10
+ @if (contrast-ratio($bg, $text) < $min-contrast-ratio) {
11
+ $text: mix($value, color-contrast($bg), math.abs(40%));
12
+ }
13
+
14
+ .list-group-item-#{$color} {
15
+ // Required base CSS variables
16
+ --#{$prefix}list-group-color: #{$text};
17
+ --#{$prefix}list-group-bg: #{$bg};
18
+ --#{$prefix}list-group-border-color: #{$border};
13
19
  }
14
- @include list-group-item-variant($color, $lg-v-bg, $lg-v-color);
15
20
  }
@@ -1,8 +1,10 @@
1
+ // Configuration Variables
2
+ @import "@openeuropa/bcl-bootstrap/scss/functions";
3
+
1
4
  // Base theme colors
2
5
  @import "@openeuropa/bcl-theme-default/src/scss/base/colors";
3
6
 
4
- // Configuration
5
- @import "@openeuropa/bcl-bootstrap/scss/functions";
7
+ // Configuration Methods Maps and Mixins
6
8
  @import "@openeuropa/bcl-bootstrap/scss/variables";
7
9
  @import "@openeuropa/bcl-bootstrap/scss/maps";
8
10
  @import "@openeuropa/bcl-bootstrap/scss/mixins";
@@ -16,6 +16,8 @@
16
16
  stay_open (boolean) (default: false)
17
17
  },
18
18
  ]
19
+ - expand_button: (button object) (default: {})
20
+ - collapse_button: (button object) (default: {})
19
21
  - open_item_id (int) (default: 0)
20
22
  - attributes (drupal attrs)
21
23
  #}
@@ -27,6 +29,8 @@
27
29
  {% set _id = id|default(random(1000)) %}
28
30
  {% set _flush = flush ?? false %}
29
31
  {% set _items = items|default([]) %}
32
+ {% set _expand_button = expand_button|default({}) %}
33
+ {% set _collapse_button = collapse_button|default({}) %}
30
34
  {% set _open_item_id = open_item_id|default(0) %}
31
35
  {% set _classes = ['accordion'] %}
32
36
  {% if _flush %}
@@ -43,57 +47,92 @@
43
47
  <div
44
48
  {{ attributes }}
45
49
  >
46
- {%- if _title is not empty -%}
47
- {% include '@oe-bcl/bcl-heading/heading.html.twig' with {
48
- title: _title,
49
- title_tag: _title_tag,
50
- title_link: _title_link,
51
- attributes: _title_attributes,
52
- } only %}
53
- {%- endif -%}
50
+ {%- if _title is not empty -%}
51
+ {% include '@oe-bcl/bcl-heading/heading.html.twig' with {
52
+ title: _title,
53
+ title_tag: _title_tag,
54
+ title_link: _title_link,
55
+ attributes: _title_attributes,
56
+ } only %}
57
+ {%- endif -%}
54
58
 
55
- {% for _item in _items %}
56
- {% set _open_item = _open_item_id == loop.index %}
57
- {% set _button_classes = ['accordion-button'] %}
58
- {% if not _open_item %}
59
- {% set _button_classes = _button_classes|merge(['collapsed']) %}
60
- {% endif %}
61
- <div class="accordion-item">
62
- {%- set _item_title_tag = _item.title_tag|default('h2') %}
63
- <{{ _item_title_tag }}
64
- class="accordion-header"
65
- id="heading-{{ _id }}-{{ loop.index }}"
59
+ {% if _items|length > 1 and (_expand_button is not empty or _collapse_button is not empty) %}
60
+ {% set wrapper_attributes = create_attribute().addClass(['d-flex', 'justify-content-end', 'gap-3', 'mb-3']) %}
61
+ <div
62
+ {{ wrapper_attributes }}
66
63
  >
67
- {% set button_attributes = create_attribute()
68
- .addClass(_button_classes)
69
- .setAttribute('data-bs-toggle', 'collapse')
70
- .setAttribute('autocomplete', 'off')
71
- .setAttribute('data-bs-target', '#collapse-' ~ _id ~ '-' ~ loop.index)
72
- .setAttribute('aria-controls', 'collapse-' ~ _id ~ '-' ~ loop.index)
73
- .setAttribute('aria-expanded', open_item ? 'true' : 'false')
74
- %}
75
- {% include '@oe-bcl/bcl-button/button.html.twig' with {
76
- label: _item.title,
77
- clean_class: true,
78
- attributes: button_attributes
79
- } only %}
80
- </{{ _item_title_tag }}>
81
- <div
82
- id="collapse-{{ _id }}-{{ loop.index }}"
83
- class="accordion-collapse collapse{{ _open_item ? ' show' }}"
84
- aria-labelledby="heading-{{ _id }}-{{ loop.index }}"
85
- role="region"
86
- {% if not _item.stay_open %}
87
- data-bs-parent="#accordion-{{ _id }}"
64
+ {% if _expand_button is not empty %}
65
+ {% if _expand_button.attributes is empty %}
66
+ {% set _expand_button = _expand_button|merge({
67
+ attributes: create_attribute()
68
+ })
69
+ %}
70
+ {% endif %}
71
+ {% include '@oe-bcl/bcl-button/button.html.twig' with _expand_button|merge({
72
+ attributes: _expand_button.attributes
73
+ .setAttribute('data-target', 'accordion-' ~ _id)
74
+ .setAttribute('data-action', 'expand')
75
+ }) only %}
88
76
  {% endif %}
89
- >
90
- <div class="accordion-body">
91
- {%- set _content = _item.content|default('') %}
92
- {%- block content _content -%}
77
+ {% if _collapse_button is not empty %}
78
+ {% if _collapse_button.attributes is empty %}
79
+ {% set _collapse_button = _collapse_button|merge({
80
+ attributes: create_attribute()
81
+ })
82
+ %}
83
+ {% endif %}
84
+ {% include '@oe-bcl/bcl-button/button.html.twig' with _collapse_button|merge({
85
+ attributes: _collapse_button.attributes
86
+ .setAttribute('data-target', 'accordion-' ~ _id)
87
+ .setAttribute('data-action', 'collapse')
88
+ }) only %}
89
+ {% endif %}
90
+ </div>
91
+ {% endif %}
92
+ <div class="accordion-items-wrapper">
93
+ {% for _item in _items %}
94
+ {% set _open_item = _open_item_id == loop.index %}
95
+ {% set _button_classes = ['accordion-button'] %}
96
+ {% if not _open_item %}
97
+ {% set _button_classes = _button_classes|merge(['collapsed']) %}
98
+ {% endif %}
99
+ <div class="accordion-item">
100
+ {%- set _item_title_tag = _item.title_tag|default('h2') %}
101
+ <{{ _item_title_tag }}
102
+ class="accordion-header"
103
+ id="heading-{{ _id }}-{{ loop.index }}"
104
+ >
105
+ {% set button_attributes = create_attribute()
106
+ .addClass(_button_classes)
107
+ .setAttribute('data-bs-toggle', 'collapse')
108
+ .setAttribute('autocomplete', 'off')
109
+ .setAttribute('data-bs-target', '#collapse-' ~ _id ~ '-' ~ loop.index)
110
+ .setAttribute('aria-controls', 'collapse-' ~ _id ~ '-' ~ loop.index)
111
+ .setAttribute('aria-expanded', open_item ? 'true' : 'false')
112
+ %}
113
+ {% include '@oe-bcl/bcl-button/button.html.twig' with {
114
+ label: _item.title,
115
+ clean_class: true,
116
+ attributes: button_attributes
117
+ } only %}
118
+ </{{ _item_title_tag }}>
119
+ <div
120
+ id="collapse-{{ _id }}-{{ loop.index }}"
121
+ class="accordion-collapse collapse{{ _open_item ? ' show' }}"
122
+ aria-labelledby="heading-{{ _id }}-{{ loop.index }}"
123
+ role="region"
124
+ {% if not _item.stay_open and _expand_button is empty %}
125
+ data-bs-parent="#accordion-{{ _id }}"
126
+ {% endif %}
127
+ >
128
+ <div class="accordion-body">
129
+ {%- set _content = _item.content|default('') %}
130
+ {%- block content _content -%}
131
+ </div>
132
+ </div>
93
133
  </div>
94
- </div>
134
+ {% endfor %}
95
135
  </div>
96
- {% endfor %}
97
136
  </div>
98
137
  {% endif %}
99
138
 
@@ -9,6 +9,7 @@ Parameters:
9
9
  - links: (link[]) (default: [])
10
10
  - id (string) (default: bcl-inpage-navigation-random(100))
11
11
  - dropdown_id (string) (default: bcl-inpage-navigation-dropdown-random(100))
12
+ - dynamic_active: (boolean) (default: false)
12
13
  - icon_path (string) (default: '')
13
14
  - attributes (drupal attrs)
14
15
  #}
@@ -21,6 +22,7 @@ Parameters:
21
22
  {% set _id = id|default('bcl-inpage-navigation-' ~ random(100)) %}
22
23
  {% set _icon_path = icon_path|default('') %}
23
24
  {% set _dropdown_id = dropdown_id|default('bcl-inpage-navigation-dropdown' ~ random(100)) %}
25
+ {% set _dyanmic_active = dynamic_active|default(false) %}
24
26
 
25
27
  {% if attributes is empty %}
26
28
  {% set attributes = create_attribute() %}
@@ -37,7 +39,13 @@ Parameters:
37
39
  } only -%}
38
40
  {% endset %}
39
41
 
40
- <nav {{ attributes }}>
42
+ {% set _classes = [] %}
43
+
44
+ {% if _dyanmic_active %}
45
+ {% set _classes = _classes|merge(['dynamic-active']) %}
46
+ {% endif %}
47
+
48
+ <nav {{ attributes.addClass(_classes) }}>
41
49
  {% set trigger_attributes = create_attribute()
42
50
  .setAttribute('aria-expanded', 'false')
43
51
  .setAttribute('type', 'button')