@openeuropa/bcl-heading 0.22.0 → 0.25.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.
@@ -3,7 +3,7 @@
3
3
  exports[`OE - Heading renders correctly 1`] = `
4
4
  <jest>
5
5
  <h2
6
- class="fw-bold mb-4 bcl-heading"
6
+ class="mb-4 bcl-heading"
7
7
  >
8
8
  A title created by the bcl heading template
9
9
  </h2>
@@ -13,10 +13,11 @@ exports[`OE - Heading renders correctly 1`] = `
13
13
  exports[`OE - Heading renders correctly with a link 1`] = `
14
14
  <jest>
15
15
  <h2
16
- class="fw-bold mb-4 bcl-heading"
16
+ class="mb-4 bcl-heading"
17
17
  >
18
18
  <a
19
- href="/example"
19
+ class="standalone"
20
+ href="/example.html"
20
21
  >
21
22
  A title created by the bcl heading template
22
23
  </a>
@@ -27,10 +28,11 @@ exports[`OE - Heading renders correctly with a link 1`] = `
27
28
  exports[`OE - Heading renders correctly with a link and a title 1`] = `
28
29
  <jest>
29
30
  <h2
30
- class="fw-bold mb-4 bcl-heading"
31
+ class="mb-4 bcl-heading"
31
32
  >
32
33
  <a
33
- href="/example"
34
+ class="standalone"
35
+ href="/example.html"
34
36
  >
35
37
  A title created by the bcl heading template
36
38
  </a>
@@ -41,7 +43,7 @@ exports[`OE - Heading renders correctly with a link and a title 1`] = `
41
43
  exports[`OE - Heading renders correctly with custom tag 1`] = `
42
44
  <jest>
43
45
  <h3
44
- class="fw-bold mb-4 bcl-heading"
46
+ class="mb-4 bcl-heading"
45
47
  >
46
48
  A title created by the bcl heading template
47
49
  </h3>
package/heading.html.twig CHANGED
@@ -3,40 +3,38 @@
3
3
  {# Parameters:
4
4
  - title (string) (default: '')
5
5
  - title_tag (string) (default: 'h2')
6
- - path (string) (default: '')
7
- - link: (object) (default: {})
6
+ - title_link: (link object) (default: {})
8
7
  - attributes (drupal attrs)
9
8
  #}
10
9
 
11
10
  {% set _title = title|default('') %}
12
- {% set _path = path|default('') %}
13
11
  {% set _title_tag = title_tag|default('h2') %}
14
- {% set _link = link|default({}) %}
12
+ {% set _title_link = title_link|default({}) %}
15
13
 
16
14
  {% if attributes is empty %}
17
15
  {% set attributes = create_attribute() %}
18
16
  {% endif %}
19
17
 
20
18
  {% if attributes.class is empty %}
21
- {% set attributes = attributes.addClass(['fw-bold', 'mb-4']) %}
19
+ {% set attributes = attributes.addClass(['mb-4']) %}
22
20
  {% endif %}
23
21
 
24
22
  {% set attributes = attributes.addClass(['bcl-heading']) %}
25
23
 
26
- {% if _link is not empty and _title is not empty and _link.label is empty %}
27
- {% set _link = _link|merge({ label: _title }) %}
24
+ {% if _title_link is not empty and _title is not empty and _title_link.label is empty %}
25
+ {% set _title_link = _title_link|merge({ label: _title }) %}
28
26
  {% endif %}
29
27
 
30
- {% if _title is not empty or _link is not empty %}
28
+ {% if _title is not empty or _title_link is not empty %}
31
29
  <{{ _title_tag }}
32
30
  {{- attributes -}}
33
31
  >
34
- {%- if _link is not empty -%}
35
- {% include '@oe-bcl/bcl-link/link.html.twig' with _link only %}
32
+ {%- if _title_link is not empty -%}
33
+ {% include '@oe-bcl/bcl-link/link.html.twig' with _title_link|merge({ standalone: true }) only %}
36
34
  {%- else -%}
37
35
  {{- _title -}}
38
36
  {%- endif %}
39
37
  </{{ _title_tag }}>
40
38
  {% endif -%}
41
39
 
42
- {% endspaceless %}
40
+ {% endspaceless %}
package/heading.test.js CHANGED
@@ -1,4 +1,5 @@
1
- import { merge, renderTwigFileAsNode } from "@openeuropa/bcl-test-utils";
1
+ import { renderTwigFileAsNode } from "@openeuropa/bcl-test-utils";
2
+
2
3
  const template = "@oe-bcl/bcl-heading/heading.html.twig";
3
4
  const render = (params) => renderTwigFileAsNode(template, params);
4
5
 
@@ -27,8 +28,8 @@ describe("OE - Heading", () => {
27
28
 
28
29
  return expect(
29
30
  render({
30
- link: {
31
- path: "/example",
31
+ title_link: {
32
+ path: "/example.html",
32
33
  label: "A title created by the bcl heading template",
33
34
  },
34
35
  })
@@ -41,8 +42,8 @@ describe("OE - Heading", () => {
41
42
  return expect(
42
43
  render({
43
44
  title: "A title created by the bcl heading template",
44
- link: {
45
- path: "/example",
45
+ title_link: {
46
+ path: "/example.html",
46
47
  },
47
48
  })
48
49
  ).resolves.toMatchSnapshot();
package/package.json CHANGED
@@ -2,12 +2,12 @@
2
2
  "name": "@openeuropa/bcl-heading",
3
3
  "author": "European Commission",
4
4
  "license": "EUPL-1.2",
5
- "version": "0.22.0",
5
+ "version": "0.25.0",
6
6
  "publishConfig": {
7
7
  "access": "public"
8
8
  },
9
9
  "dependencies": {
10
- "@openeuropa/bcl-link": "^0.22.0"
10
+ "@openeuropa/bcl-link": "^0.25.0"
11
11
  },
12
12
  "description": "OE - BCL heading",
13
13
  "repository": {
@@ -24,5 +24,5 @@
24
24
  "design-system",
25
25
  "twig"
26
26
  ],
27
- "gitHead": "57304ad94ae3c234f2f2b904208ce540a7a53f23"
27
+ "gitHead": "f50c7dfeab8695bbb5c18d5f7d5304509512268a"
28
28
  }