{#
/**
 * @file
 * Template for Alert component.
 *
 * Available config:
 * - type: primary | secondary | success | danger | warning | info | light | dark
 * - heading: string,
 * - dimissible: true | false
 * - alert_utility_classes: An array of utility classes.
 */
#}
{% set dismissible = dismissible ?? true %}
{% set classes = [
  'alert',
  type ? 'alert-' ~ type,
  dismissible ? 'alert--dismissible',
]|merge(alert_utility_classes ? alert_utility_classes : []) %}

<div aria-live="{{ aria_live ? aria_live : 'assertive' }}" class="{{ classes|join(' ') }}" role="alert">

    <div class="alert__body">
      {% if heading %}
        <h4 class="alert__heading">{{ heading }}</h4>
      {% endif %}

      {% block content %}
        {{- content -}}
      {% endblock %}
    </div>

  {% if dismissible %}
    <button type="button" class="alert__close" aria-label="Close">
      <span aria-hidden="true"></span>
    </button>
  {% endif %}
</div>
{% if libraries %}
  {% for library in libraries %}
    {{ attach_library(library) }}
  {% endfor %}
{% endif %}
