{#
/**
 * @file
 * Vartheme BS5 Starter Kit implementation for the heading component.
 *
 * Available properties:
 * - html_tag : The HTML tag to use for the header.
 *             Defaults to h1 (h1|h2|h3|h4|h5|h6)
 * - display: When you need a heading to stand out, consider using a display
              heading—a larger, slightly more opinionated heading style.
 * - url: Simple URL link for heading.
 * - heading_utility_classes: An array of utility classes that can be used to add extra
 *                    Bootstrap utility classes or custom classes to this component.
 *
 * Available attributes:
 * - attributes: Attributes array.
 *
 * Available slots:
 * - content: Content text for the heading.
 *
 */
#}

{% set html_tag = html_tag ?? 'h1' %}
{% set display = [display] ?? [] %}
{% set heading_utility_classes = heading_utility_classes ? heading_utility_classes : [] %}

{% set classes = []|merge(display)|merge(heading_utility_classes) %}

{% if not attributes %}
  {% set attributes = create_attribute() %}
{% endif %}
{%  set attributes = attributes.addClass(classes) %}

{% apply spaceless %}
  <{{ html_tag }}{{ attributes }}>
  {% if url is not empty and url != "" %}
    {% include 'vartheme_bs5:link' with {
      url: url,
      content: content,
    } %}
  {% else %}
    {{ content }}
  {% endif %}
  </{{ html_tag }}>
{% endapply %}
