{#
/**
 * @file
 * Template for the Close button component.
 *
 * Vartheme BS5 Starter Kit implementation for the generic close button for dismissing content like modals and alerts.
 *
 * Available properties:
 * - size: (btn-sm|btn-lg) Bootstrap button size class.
 * - disabled: (true|false) Disabled button.
 * - close_button_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: HTML attributes for the close button element.
 *
 * Available slots:
 * - N/A
 *
 */
#}
{% set size = size ? [size] : [] %}
{% set disabled_classes = disabled ? ['disabled'] : [] %}
{% set close_button_utility_classes = close_button_utility_classes ? close_button_utility_classes : [] %}

{% set classes = [
  'btn',
  'btn-close',
]|merge(size)|merge(disabled_classes)|merge(close_button_utility_classes) %}

{# Include text for screen readers, using aria-label #}
{% set attributes = attributes.setAttribute('aria-label', 'Close'|t ) %}

{% if disabled %}
  {% set attributes = attributes.setAttribute('disabled', true ) %}
{% endif %}

<button type="button" {{ attributes.addClass(classes) }} {{ disabled }}"></button>
