# Shared UI Components ## Blade Components (Reusable) ### 1. `x-action-message` **Path:** `resources/views/components/action-message.blade.php` Displays a temporary status message that auto-hides after 2 seconds using Alpine.js. **Props:** - `on`: Event name to listen for (Livewire event) **Features:** - Transition animation with fade-out - Auto-hide timeout (2000ms) - Default text: "Saved." ```blade @props([ 'on', ])
merge(['class' => 'text-sm']) }} > {{ $slot->isEmpty() ? __('Saved.') : $slot }}
``` --- ### 2. `x-app-logo` **Path:** `resources/views/components/app-logo.blade.php` Main app branding component. Renders as `flux:brand` (header) or `flux:sidebar.brand` (sidebar variant). **Props:** - `sidebar` (bool): If true, renders sidebar variant - Inherits Flux component attributes **Features:** - Dynamic logo rendering based on context (header vs sidebar) - Uses `x-app-logo-icon` for icon - Passes through attributes to Flux components ```blade @props([ 'sidebar' => false, ]) @if($sidebar) @else @endif ``` --- ### 3. `x-app-logo-icon` **Path:** `resources/views/components/app-logo-icon.blade.php` SVG icon for the application logo. Geometric design with fills. **Features:** - Scalable SVG - Uses `currentColor` for dynamic styling - Can be sized with Tailwind classes ```blade ``` --- ### 4. `x-auth-header` **Path:** `resources/views/components/auth-header.blade.php` Centered header for authentication pages with title and description. **Props:** - `title`: Main heading text - `description`: Subheading/description text **Features:** - Centered layout - Uses Flux typography components ```blade @props([ 'title', 'description', ])
{{ $title }} {{ $description }}
``` --- ### 5. `x-auth-session-status` **Path:** `resources/views/components/auth-session-status.blade.php` Displays session status messages (typically success messages after redirect). **Props:** - `status`: Status message text (if present) - Passes through attributes **Features:** - Conditional rendering (only shows if status exists) - Green success styling ```blade @props([ 'status', ]) @if ($status)
merge(['class' => 'font-medium text-sm text-green-600']) }}> {{ $status }}
@endif ``` --- ### 6. `x-desktop-user-menu` **Path:** `resources/views/components/desktop-user-menu.blade.php` User profile dropdown menu with settings and logout options. Uses Flux components. **Features:** - Sidebar profile with dropdown - Shows user avatar, name, and email - Menu items: Settings (cog icon), Logout (arrow icon) - Logout form with CSRF protection - Data test attributes for testing ```blade
{{ auth()->user()->name }} {{ auth()->user()->email }}
{{ __('Settings') }}
@csrf {{ __('Log out') }}
``` --- ### 7. `x-placeholder-pattern` **Path:** `resources/views/components/placeholder-pattern.blade.php` SVG placeholder pattern for skeleton/loading states. Diagonal line pattern. **Props:** - `id`: Unique pattern ID (auto-generated) **Features:** - Reusable SVG pattern definition - Can be styled with Tailwind stroke classes - Used in dashboard placeholder cards ```blade @props([ 'id' => uniqid(), ]) ``` --- ## Flux UI Components Used Flux v2 components extensively used throughout the application: - **Layout:** `flux:header`, `flux:sidebar`, `flux:main`, `flux:spacer` - **Navigation:** `flux:navbar`, `flux:navbar.item`, `flux:sidebar.nav`, `flux:sidebar.item`, `flux:sidebar.group` - **Forms:** `flux:input`, `flux:select`, `flux:checkbox`, `flux:button` - **Typography:** `flux:heading`, `flux:subheading`, `flux:text` - **Dropdowns/Menus:** `flux:dropdown`, `flux:menu`, `flux:menu.item`, `flux:menu.separator` - **UI Elements:** `flux:badge`, `flux:avatar`, `flux:brand`, `flux:profile` - **Other:** `flux:tooltip`, `flux:separator`, `flux:link` --- ## Flux Custom Icons Located in `resources/views/flux/icon/`: - `layout-grid.blade.php` - `folder-git-2.blade.php` - `chevrons-up-down.blade.php` - `book-open-text.blade.php` These extend Flux's default icon library. --- ## Alpine.js Data Objects ### `stationMap` **Path:** `resources/js/maps/station-map.js` Leaflet map integration for displaying fuel stations: - Initializes map centered on UK - Plots colored circle markers for stations - Color coding: green (current), slate (recent), amber (stale), red (outdated) - Popup display with station details - Responsive bounds fitting - Watches for data changes via Alpine