{# # ============================================================================ # MOLECULE: SECTION DIVIDER # ============================================================================ # # Separateur de section avec icone, titre, sous-titre et ligne decorative. # Remplace section-header pour les pages riches comme le dashboard. # # ============================================================================ # COMPOSITION (Atomes utilises) # ============================================================================ # # - _atoms/icon/icon.html.twig # # ============================================================================ # PARAMETRES # ============================================================================ # # | Parametre | Type | Defaut | Description | # |---------------|---------|------------|---------------------------------------| # | title | string | (requis) | Titre de la section | # | subtitle | string | null | Sous-titre (ex: "6 outils - 508k") | # | icon | string | null | Nom de l'icone | # | iconColor | string | 'primary' | Couleur de l'icone/fond | # | class | string | '' | Classes additionnelles | # # ============================================================================ # EXEMPLES D'UTILISATION # ============================================================================ # # Simple: # {% include '_molecules/section-divider/section-divider.html.twig' with { # title: 'Vos outils', # icon: 'widget-add', # iconColor: 'primary' # } only %} # # Avec sous-titre et slot droit: # {% embed '_molecules/section-divider/section-divider.html.twig' with { # title: 'Vos badges', # subtitle: '6 debloques sur 9', # icon: 'medal-star', # iconColor: 'warning' # } %} # {% block right %} # # {% endblock %} # {% endembed %} # # ============================================================================ #} {# ============================================================================ CONFIGURATION DES VALEURS PAR DEFAUT ============================================================================ #} {% set title = title ?? 'Section' %} {% set subtitle = subtitle ?? null %} {% set icon = icon ?? null %} {% set iconColor = iconColor ?? 'primary' %} {% set class = class ?? '' %} {% set bgMap = { 'primary': 'rgba(12,129,228,0.10)', 'cohorts': 'rgba(139,92,246,0.10)', 'success': 'rgba(48,147,68,0.10)', 'error': 'rgba(209,0,0,0.10)', 'warning': 'rgba(245,158,11,0.10)', 'info': 'rgba(14,165,233,0.10)', 'gray': 'rgba(107,114,128,0.10)', } %} {% set iconBg = bgMap[iconColor] ?? 'rgba(12,129,228,0.10)' %} {# ============================================================================ RENDU HTML ============================================================================ #}
{# Icone dans un conteneur carre avec glow subtil #} {% if icon %}
{% include '_atoms/icon/icon.html.twig' with { name: icon, size: 'lg', color: iconColor } only %}
{% endif %} {# Titre et sous-titre #}

{{ title|raw }}

{% if subtitle %}

{{ subtitle }}

{% endif %}
{# Ligne decorative #}
{# Slot pour contenu a droite (bouton, etc.) #} {% block right %}{% endblock %}