@openeuropa/bcl-theme-default 0.28.0 → 0.28.1

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": "0.28.0",
5
+ "version": "0.28.1",
6
6
  "description": "OE - BCL theme default",
7
7
  "scripts": {
8
8
  "align-templates": "lerna --scope \"@openeuropa/bcl-twig-templates\" run prepublish",
@@ -21,9 +21,9 @@
21
21
  "@ecl/resources-ec-logo": "3.4.2",
22
22
  "@ecl/resources-eu-logo": "3.4.2",
23
23
  "@ecl/resources-flag-icons": "3.4.2",
24
- "@openeuropa/bcl-bootstrap": "^0.28.0",
25
- "@openeuropa/bcl-builder": "^0.28.0",
26
- "@openeuropa/bcl-twig-templates": "^0.28.0",
24
+ "@openeuropa/bcl-bootstrap": "^0.28.1",
25
+ "@openeuropa/bcl-builder": "^0.28.1",
26
+ "@openeuropa/bcl-twig-templates": "^0.28.1",
27
27
  "copyfiles": "2.4.1",
28
28
  "cross-env": "7.0.3",
29
29
  "flag-icons": "6.6.6",
@@ -48,5 +48,5 @@
48
48
  "design-system",
49
49
  "twig"
50
50
  ],
51
- "gitHead": "9ceb916258c8c7331f37bbb7c4380a2121440e12"
51
+ "gitHead": "3b0d2f4a85c727f38ae4e3403110c98302d09117"
52
52
  }
@@ -0,0 +1,66 @@
1
+ {% apply spaceless %}
2
+
3
+ {#
4
+ Parameters:
5
+ - path (string) (default: '')
6
+ - label (string) (default: '')
7
+ - disabled (boolean) (default: false)
8
+ - active (boolean) (default: false)
9
+ - aria_label (string) (default: '')
10
+ - icon (Icon component) (default: {})
11
+ - attributes (drupal attrs)
12
+ #}
13
+
14
+ {% set _path = path|default('') %}
15
+ {% set _label = label|default('') %}
16
+ {% set _disabled = disabled|default(false) %}
17
+ {% set _active = active|default(false) %}
18
+ {% set _aria_label = aria_label|default('') %}
19
+ {% set _icon = icon|default({}) %}
20
+ {% set _classes = ['page-link'] %}
21
+
22
+ {% if attributes is empty %}
23
+ {% set attributes = create_attribute() %}
24
+ {% endif %}
25
+
26
+ {% if _disabled %}
27
+ {% set attributes = attributes.setAttribute('tabindex', '-1')
28
+ .setAttribute('aria-disabled', true)
29
+ %}
30
+ {% endif %}
31
+
32
+ {% if _aria_label is not empty %}
33
+ {% set attributes = attributes.setAttribute('aria-label', _aria_label ) %}
34
+ {% endif %}
35
+
36
+ {% if _path is not empty %}
37
+ {% set attributes = attributes.setAttribute('href', _path ) %}
38
+ {% endif %}
39
+
40
+ {% if _active %}
41
+ {% set attributes = attributes.setAttribute('aria-current', 'page' ) %}
42
+ {% endif %}
43
+
44
+ {% set attributes = attributes.addClass(_classes)%}
45
+
46
+ {%- if _path is not empty -%}
47
+ <a
48
+ {{ attributes }}
49
+ >
50
+ {%- else -%}
51
+ <div
52
+ {{ attributes }}
53
+ >
54
+ {%- endif -%}
55
+ {%- if _icon is not empty -%}
56
+ {%- include '@oe-bcl/bcl-icon/icon.html.twig' with _icon only -%}
57
+ {%- else -%}
58
+ {{- _label -}}
59
+ {%- endif -%}
60
+ {%- if _path is not empty -%}
61
+ </a>
62
+ {%- else -%}
63
+ </div>
64
+ {%- endif -%}
65
+
66
+ {% endapply %}
@@ -84,7 +84,7 @@
84
84
  {% set attributes = attributes.setAttribute('role', 'navigation') %}
85
85
 
86
86
  {% if _variant == 'glossary' %}
87
- {% set attributes = attributes.setAttribute('class', 'bcl-glossary') %}
87
+ {% set attributes = attributes.addClass(['bcl-glossary']) %}
88
88
  {% endif %}
89
89
 
90
90
  {% if _aria_label is not empty %}