<commit_before>{% if enable_json_schema_validation %}
  {{ validate_data_schema(bolt.data.components['@bolt-components-background'].schema, _self) | raw }}
{% endif %}

{% set prefix = "c-bolt-" %}
{% set componentName = "background" %}
{% set baseClass = prefix ~ componentName %}

{% set attributes = create_attribute(attributes|default({})) %}
{% set overlayAttributes = create_attribute({}) %}
{% set shapeAttributes = create_attribute({}) %}

{% set overlayStates = ["enabled", "disabled"] %}

{% set opacities = ["light", "medium", "heavy"] %}

{% set shapeGroups = ["A", "B"] %}

{% set shapeAlignments = ["left", "right"] %}

{% set fills = {
  "color": "color",
  "gradient": "gradient"
} %}

{% if focalPoint and focalPoint.horizontal == "left" %}
  {% set fills = fills|merge({"gradient": "gradient-reversed"}) %}
{% endif %}



{% set overlay = overlay in overlayStates ? overlay : "enabled" %}

{% set classes = [
  baseClass
] %}

{% set overlayClasses = [
  baseClass ~ "__overlay",
  opacity in opacities ? baseClass ~ "__overlay--" ~ opacity ~ "-opacity" : baseClass ~ "__overlay--medium-opacity",
  fill in fills|keys ? baseClass ~ "__overlay--" ~ fills[fill] ~ "-fill" : baseClass ~ "__overlay--color-fill"
] %}

{% set shapeGroup =  shapeGroup in shapeGroups ? shapeGroup : 'none' %}
{% set shapeClasses = [
  baseClass ~ "__shapes",
  shapeAlignment in shapeAlignments ? baseClass ~ "__shapes--" ~ shapeAlignment : baseClass ~ "__shapes--right"
] %}



<bolt-background bolt-component>
  <div {{ attributes.addClass(classes) }}>
    <div class="{{ "#{baseClass}__item" }}">
      {% if contentItems %}
        {% for item in contentItems %}

          {% set itemAttributes = item.pattern ~ "Attributes" %}
          {% include pattern_template(item.pattern) with item | merge({
            (itemAttributes): {
              class: ["c-bolt-background__#{item.pattern}"]
            },
            ratio: false,
            lazyload: item.lazyload ? item.lazyload : true
          }) only %}
        {% endfor %}
      {% endif %}

      {% if overlay == "enabled" %}
        <div {{ overlayAttributes.addClass(overlayClasses) }} ></div>
      {% endif %}

      {% if shapeGroup != 'none' %}
        <div {{ shapeAttributes.addClass(shapeClasses) }}>
          {% include "@bolt/background-shapes.twig" with { "shapeGroup": shapeGroup } only %}
        </div>

      {% endif %}<commit_msg>refactor: update background component to support existing "zoom" animation styles already in place<commit_after>{% if enable_json_schema_validation %}
  {{ validate_data_schema(bolt.data.components['@bolt-components-background'].schema, _self) | raw }}
{% endif %}

{% set prefix = "c-bolt-" %}
{% set componentName = "background" %}
{% set baseClass = prefix ~ componentName %}

{% set attributes = create_attribute(attributes|default({})) %}
{% set overlayAttributes = create_attribute({}) %}
{% set shapeAttributes = create_attribute({}) %}

{% set overlayStates = ["enabled", "disabled"] %}

{% set opacities = ["light", "medium", "heavy"] %}

{% set shapeGroups = ["A", "B"] %}

{% set shapeAlignments = ["left", "right"] %}

{% set fills = {
  "color": "color",
  "gradient": "gradient"
} %}

{% if focalPoint and focalPoint.horizontal == "left" %}
  {% set fills = fills|merge({"gradient": "gradient-reversed"}) %}
{% endif %}



{% set overlay = overlay in overlayStates ? overlay : "enabled" %}

{% set classes = [
  baseClass,
  
] %}

{% set overlayClasses = [
  baseClass ~ "__overlay",
  opacity in opacities ? baseClass ~ "__overlay--" ~ opacity ~ "-opacity" : baseClass ~ "__overlay--medium-opacity",
  fill in fills|keys ? baseClass ~ "__overlay--" ~ fills[fill] ~ "-fill" : baseClass ~ "__overlay--color-fill",
] %}

{% set shapeGroup =  shapeGroup in shapeGroups ? shapeGroup : 'none' %}
{% set shapeClasses = [
  baseClass ~ "__shapes",
  shapeAlignment in shapeAlignments ? baseClass ~ "__shapes--" ~ shapeAlignment : baseClass ~ "__shapes--right"
] %}

<bolt-background bolt-component>
  <div {{ attributes.addClass(classes) }}>
    <div class="{{ "#{baseClass}__item" }} {{ zoom ? "#{baseClass}__item--zoom-in-out": '' }}">
      {% if contentItems %}
        {% for item in contentItems %}

          {% set itemAttributes = item.pattern ~ "Attributes" %}
          {% include pattern_template(item.pattern) with item | merge({
            (itemAttributes): {
              class: ["c-bolt-background__#{item.pattern}"]
            },
            ratio: false,
            lazyload: item.lazyload ? item.lazyload : true
          }) only %}
        {% endfor %}
      {% endif %}

      {% if overlay == "enabled" %}
        <div {{ overlayAttributes.addClass(overlayClasses) }} ></div>
      {% endif %}

      {% if shapeGroup != 'none' %}
        <div {{ shapeAttributes.addClass(shapeClasses) }}>
          {% include "@bolt/background-shapes.twig" with { "shapeGroup": shapeGroup } only %}
        </div>

      {% endif %}
{'fraction_non_alphanumeric': 0.1777150916784203, 'fraction_numerical': 0.0, 'mean_word_length': 3.2941176470588234, 'pattern_counts': {'":': 9, '<': 17, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3628828', 'n_tokens_mistral': 1625, 'n_tokens_neox': 1434, 'n_words': 342}