{#
/**
 * @file
 * Template for a Bootstrap 5 Wrapper component.
 *
 * Available variables:
 * - attributes: HTML attributes for the wrapper element.
 * - html_tag: HTML element tag (div, section, article, etc.). Defaults to div.
 * - container_type: Optional Bootstrap container class (container, container-fluid).
 * - width_class: Bootstrap width utility class.
 * - height_class: Bootstrap height utility class.
 * - flex_enabled: (boolean) Enable flex utility classes.
 * - flex_direction: Flex direction class (flex-row, flex-column).
 * - flex_gap: Bootstrap gap class for flex container.
 * - flex_width: Bootstrap width class for flex container.
 * - justify_content: Bootstrap justify-content class.
 * - align_items: Bootstrap align-items class.
 * - margin_*/padding_* props: Bootstrap spacing classes.
 * - custom_class: Additional CSS classes.
 *
 * Available slots:
 * - content: The wrapper content.
 *
 * @ingroup themeable
 */
#}

{% set html_tag = html_tag|default('div') %}
{% set width_class = width_class|default('w-100') %}
{% set height_class = height_class|default('none') %}
{% set container_class = container_type and container_type != 'none' ? container_type : '' %}

{% set classes = [
  container_class,
  custom_class|default(''),
  width_class and width_class != 'none' ? width_class : '',
  height_class and height_class != 'none' ? height_class : '',
  margin_for_all,
  margin_top,
  margin_bottom,
  margin_start,
  margin_end,
  margin_x,
  margin_y,
  padding_all,
  padding_top,
  padding_bottom,
  padding_start,
  padding_end,
  padding_x,
  padding_y,
]|filter(v => v) %}

{% if flex_enabled %}
  {% set flex_classes = [
    'd-flex',
    flex_direction|default('flex-row'),
    flex_gap and flex_gap != 'none' ? flex_gap : '',
    flex_width and flex_width != 'none' ? flex_width : '',
    justify_content and justify_content != 'none' ? justify_content : '',
    align_items and align_items != 'none' ? align_items : '',
  ]|filter(v => v) %}
  {% set classes = classes|merge(flex_classes) %}
{% endif %}

<{{ html_tag }}{{ attributes.addClass(classes) }}>
  {% block content %}{% endblock %}
</{{ html_tag }}>
