{{-- Button Molecule - Luxury Edition (Atomic Composable v2.0) CTA button with ghost/outlined variants and pill shape Email-safe table-based structure with Outlook MSO conditionals Note: All design tokens auto-injected via View Composer Uses centralized variant and size definitions from config/emails.php Usage: @component('emails.molecules.button', [ 'href' => 'https://example.com', 'variant' => 'ghost-primary', // ghost-primary|ghost-secondary|ghost-success|ghost-danger|primary|secondary|success|danger 'size' => 'medium' // small|medium|large ]) Button Text @endcomponent --}} @php $variant = $variant ?? 'ghost-primary'; // Default to ghost (luxury style) $size = $size ?? 'medium'; // Get variant config from centralized design tokens $variantConfig = $buttonVariants[$variant] ?? $buttonVariants['ghost-primary']; $sizeConfig = $buttonSizes[$size] ?? $buttonSizes['medium']; // Resolve color references $bgColor = $variantConfig['bg']; $textColorKey = $variantConfig['text']; $borderColorKey = $variantConfig['border']; // Handle transparent background $bg = $bgColor === 'transparent' ? 'transparent' : ($colors[$bgColor] ?? '#be8c3c'); $text = $colors[$textColorKey] ?? '#ffffff'; // Handle border if ($borderColorKey === 'none') { $border = 'none'; } else { $borderColor = $colors[$borderColorKey] ?? '#be8c3c'; $border = $borders['width-medium'] . ' solid ' . $borderColor; } // Get size values $padding = $sizeConfig['padding']; $fontSizeKey = $sizeConfig['font-size']; $fontSize = $typography['sizes'][$fontSizeKey] ?? '15px'; // Check if ghost variant for MSO conditionals $isGhost = str_starts_with($variant, 'ghost-'); @endphp
| @if($isGhost) {{-- Ghost button: Outlook doesn't support transparent bg well, show border only --}} {{ $slot }} @else {{-- Solid button: Traditional MSO approach --}} {{ $slot }} @endif |