{# LIBRARIES #}
{{ attach_library('ui_patterns/libraries.bs_spinners') }}

{# VARIABLES #}
{% set spinner_type = spinner_type|default('border') %}
{% set status = status|default('primary') %}
{% set loading = loading|default('Loading...') %}
{% set show_text = show_text|default(false) %}
{% set size = size|default('nm') %}

{# TEMPLATE #}
<div class="spinner-{{ spinner_type }} spinner-{{ spinner_type }}-{{ size }} text-{{ status }}" role="status">
  {% if not show_text %}
    <span class="sr-only">{{ loading }}</span>
  {% endif %}
</div>
{% if show_text %}
  <span class="loading-text">{{ loading }}</span>
{% endif %}
