{#
@file
 * Vartheme BS5 Starter Kit implementation for the Heading Block component.
 *
 * Bootstrap Documentation
 * https://getbootstrap.com/docs/5.3/content/typography/#headings
 *
 * Full List Utility Classes
 * https://github.com/twbs/bootstrap/blob/v5.2.3/dist/css/bootstrap.css#L110
 *
 * Available Properties:
 * - heading_tag: Heading HTML tag (h1, h2, h3, h4, h5, h6)
 * - heading_text: The content of the heading.
 * - block_heading_utility_classes: This property contains an array of utility classes that can
 *                    be used to add extra Bootstrap utility classes or custom
 *                    classes to this component.
 */
#}

{% set heading_tag = ((heading_tag == '') or (heading_tag == '_none')) ? 'div' : heading_tag %}
{% set block_heading_utility_classes = block_heading_utility_classes ? block_heading_utility_classes : [] %}

{%
  set classes = [
    'block',
    'heading-block',
  ]|merge(block_heading_utility_classes)
%}

<div{{ attributes.addClass(classes) }}>
  {{ title_prefix }}
  {% if heading_text|render|striptags|trim %}
  {% include 'vartheme_bs5:heading' with {
      html_tag: heading_tag,
      content: heading_text
    } only %}
  {% endif %}
  {{ title_suffix }}
</div>
