Major Changes: - Migrate components from Options API to Composition API with <script setup> - Add centralized service layer (serviceService, deliveryService, adminService) - Implement new reusable components (EnhancedButton, EnhancedModal, StatCard, etc.) - Add theme store for consistent theming across application - Improve ServiceCalendar with federal holidays and better styling - Refactor customer profile and tank estimation components - Update all delivery and payment pages to use centralized services - Add utility functions for formatting and validation - Update Dockerfiles for better environment configuration - Enhance Tailwind config with custom design tokens UI Improvements: - Modern, premium design with glassmorphism effects - Improved form layouts with FloatingInput components - Better loading states and empty states - Enhanced modals and tables with consistent styling - Responsive design improvements across all pages Technical Improvements: - Strict TypeScript types throughout - Better error handling and validation - Removed deprecated api.js in favor of TypeScript services - Improved code organization and maintainability
5.8 KiB
5.8 KiB
Component Library Documentation
Overview
This document provides usage examples for all the enhanced UI components created for the EAMCO frontend.
Components
1. StatCard
Animated statistics card with trend indicators.
Props:
label(string, required) - Card labelvalue(number | string, required) - Value to displaycolor(string) - Color variant (primary, secondary, accent, info, success, warning, error)trend(string) - Trend texttrendDirection(string) - up, down, or neutralanimate(boolean) - Enable number counting animationwrapperClass(string) - Additional CSS classes
Usage:
<StatCard
label="Total Deliveries"
:value="deliveryCount"
color="primary"
trend="+12% from yesterday"
trendDirection="up"
:animate="true"
>
<template #icon>
<TruckIcon />
</template>
</StatCard>
2. FloatingInput
Modern input with floating label animation.
Props:
id(string, required) - Input IDlabel(string, required) - Label textmodelValue(string | number, required) - v-model valuetype(string) - Input type (default: 'text')error(string) - Error messagehint(string) - Hint textdisabled(boolean) - Disabled staterequired(boolean) - Required field
Usage:
<FloatingInput
id="customer-name"
label="Customer Name"
v-model="customerName"
:error="errors.name"
hint="Enter full legal name"
required
/>
3. EnhancedTable
Feature-rich table with sticky headers and zebra striping.
Props:
columns(Column[], required) - Column definitionsdata(any[], required) - Table datatitle(string) - Table titledescription(string) - Table descriptionstickyHeader(boolean) - Enable sticky headerzebra(boolean) - Enable zebra stripingrowKey(string) - Unique row key (default: 'id')
Usage:
<EnhancedTable
:columns="columns"
:data="customers"
title="Customer List"
description="All active customers"
sticky-header
zebra
@row-click="handleRowClick"
>
<template #cell-status="{ value }">
<EnhancedBadge :variant="getStatusColor(value)">
{{ value }}
</EnhancedBadge>
</template>
</EnhancedTable>
4. EnhancedButton
Button with loading states, success animations, and ripple effects.
Props:
variant(string) - primary, secondary, accent, success, warning, error, ghost, outlinesize(string) - xs, sm, md, lgtype(string) - button, submit, resetdisabled(boolean) - Disabled stateloading(boolean) - Loading statesuccess(boolean) - Success stateicon(Component) - Icon componentfullWidth(boolean) - Full width button
Usage:
<EnhancedButton
variant="primary"
size="md"
:loading="isSubmitting"
:success="submitSuccess"
@click="handleSubmit"
>
Save Changes
</EnhancedButton>
5. EnhancedBadge
Badge component with variants, pulse animations, and icons.
Props:
variant(string) - primary, secondary, accent, info, success, warning, error, ghostsize(string) - xs, sm, md, lgoutline(boolean) - Outline styledot(boolean) - Show status dotpulse(boolean) - Pulse animationicon(Component) - Icon component
Usage:
<EnhancedBadge variant="success" dot pulse>
Active
</EnhancedBadge>
<EnhancedBadge variant="warning" outline>
Pending
</EnhancedBadge>
6. EnhancedModal
Modal dialog with backdrop blur and smooth animations.
Props:
modelValue(boolean, required) - v-model for open/close statetitle(string) - Modal titledescription(string) - Modal descriptionsize(string) - sm, md, lg, xl, fullhideHeader(boolean) - Hide headerhideClose(boolean) - Hide close buttoncloseOnOverlay(boolean) - Close on overlay clicknoPadding(boolean) - Remove body padding
Usage:
<EnhancedModal
v-model="showModal"
title="Edit Customer"
description="Update customer information"
size="lg"
>
<CustomerForm :customer="selectedCustomer" />
<template #footer>
<EnhancedButton variant="ghost" @click="showModal = false">
Cancel
</EnhancedButton>
<EnhancedButton variant="primary" @click="saveCustomer">
Save
</EnhancedButton>
</template>
</EnhancedModal>
7. PageTransition
Wrapper component for page transitions.
Props:
name(string) - fade, slide-left, slide-right, slide-up, slide-down, scale, rotate
Usage:
<PageTransition name="fade">
<router-view />
</PageTransition>
8. LoadingCard
Skeleton loader for cards.
Usage:
<LoadingCard v-if="loading" />
<StatCard v-else :value="data" />
9. EmptyState
Empty state component with icon and action button.
Props:
title(string, required) - Title textdescription(string, required) - Description textactionLabel(string) - Action button label
Usage:
<EmptyState
title="No deliveries found"
description="There are no deliveries scheduled for today."
actionLabel="Create Delivery"
@action="createDelivery"
>
<template #icon>
<TruckIcon />
</template>
</EmptyState>
Design Tokens
Shadow Utilities
.shadow-soft- Subtle elevation.shadow-medium- Standard elevation.shadow-strong- Strong elevation
Hover Effects
.hover-lift- Lift on hover with shadow
Animations
animate-fade-in- Fade in animationanimate-slide-up- Slide up animationanimate-slide-down- Slide down animationanimate-scale-in- Scale in animation
Best Practices
- Consistency: Use the same component variants throughout the app
- Accessibility: Always provide labels and ARIA attributes
- Performance: Use loading states to indicate async operations
- Feedback: Show success/error states after user actions
- Responsiveness: Test components on all screen sizes