{# Parameters:
  - name (string) (default: '')
  - path (string) (default: '')
  - size (string) (default: 's')
    - options ['2xs', 'xs', 's', 'm', 'l', 'xl', '2xl', 'fluid']
  - transformation (string) (default: '')
    - options ['rotate-90', 'rotate-180', 'rotate-270', 'flip-horizontal', 'flip-vertical']
  - attributes (drupal attrs)
#}

{%- set _name = name|default('') %}
{% set _path = path|default('') %}
{% set _size = size|default('s') %}
{% set _transformation = transformation|default('') %}

{%- set _classes = ['bi', 'icon--' ~ _size] %}

{%- if _transformation is not empty %}
  {%- set _classes = _classes|merge(['icon--' ~ _transformation]) %}
{% endif %}

{%- if attributes is empty %}
  {%- set attributes = create_attribute() %}
{% endif %}

{%- set attributes = attributes.addClass(_classes) -%}

<svg
  {{ attributes }}
>{# -#}
  <use xlink:href="{{ _path ~ "#" ~ _name }}"/>{# -#}
</svg>
{#--#}
