{# # ============================================================================ # MOLECULE: PLATFORM SWITCH # ============================================================================ # # Bouton de navigation entre plateformes (Bubul ↔ SAM). # Deux états : expanded (icône + label + chevron) et collapsed (icône seule). # # ============================================================================ # COMPOSITION (Atomes utilisés) # ============================================================================ # # - _atoms/icon/icon.html.twig # # ============================================================================ # PARAMÈTRES # ============================================================================ # # | Paramètre | Type | Défaut | Description | # |-------------|--------|---------|--------------------------------------| # | href | string | '#' | URL de destination | # | label | string | '' | Label principal | # | icon | string | null | Nom de l'icône | # | colorScheme | string | 'blue' | 'blue' (Bubul) ou 'violet' (SAM) | # | locked | bool | false | Désactivé (non cliquable) | # # ============================================================================ #} {% set href = href ?? '#' %} {% set label = label ?? '' %} {% set icon = icon ?? null %} {% set logo = logo ?? null %} {% set logoTint = logoTint ?? null %} {% set colorScheme = colorScheme ?? 'blue' %} {% set style = style ?? 'gradient' %} {% set locked = locked ?? false %} {% if colorScheme == 'violet' %} {% set gradientClass = 'bg-linear-to-r from-gradient-cohorts-start via-gradient-cohorts-middle to-gradient-cohorts-end' %} {% set lightClass = 'bg-cohorts/8 border border-cohorts/30 hover:bg-cohorts/14 hover:border-cohorts/45' %} {% set textClass = 'text-cohorts-dark' %} {% set shadowStyle = '0 4px 20px rgba(139,92,246,0.4)' %} {% set shadowStyleSm = '0 4px 12px rgba(139,92,246,0.4)' %} {% else %} {% set gradientClass = 'bg-linear-to-r from-gradient-start via-gradient-middle to-gradient-end' %} {% set lightClass = 'bg-primary/8 border border-primary/30 hover:bg-primary/14 hover:border-primary/45' %} {% set textClass = 'text-primary-dark' %} {% set shadowStyle = '0 4px 20px rgba(12,129,228,0.4)' %} {% set shadowStyleSm = '0 4px 12px rgba(12,129,228,0.4)' %} {% endif %} {% set containerClass = style == 'light' ? lightClass : gradientClass %} {# Expanded #} {% if logo %} {% include '_atoms/logo/logo.html.twig' with { variant: logo, size: 'xs', tint: logoTint } %} {% else %} {% include '_atoms/icon/icon.html.twig' with { name: icon, size: 'lg', color: style == 'light' ? (colorScheme == 'violet' ? 'cohorts' : 'primary') : 'white' } %} {% endif %} {{ label }} {% include '_atoms/icon/icon.html.twig' with { name: locked ? 'lock' : 'chevron-right', size: 'xs', color: style == 'light' ? (colorScheme == 'violet' ? 'cohorts' : 'primary') : 'white' } %} {# Collapsed : carré icône seul #}