diff --git a/ui/README.md b/ui/README.md index d608b10..02f6020 100644 --- a/ui/README.md +++ b/ui/README.md @@ -8,45 +8,98 @@ This template should help get you started developing with Vue 3 in Vite. The tem Learn more about IDE Support for Vue in the [Vue Docs Scaling up Guide](https://vuejs.org/guide/scaling-up/tooling.html#ide-support). -## UI Structure -The UI is organized into several modules, each handling a specific domain of the application. Common UI elements, like tables, have been standardized for a consistent look and feel. +## Standardized Card Components -## UI Modules +This section documents the standardized card components used throughout the UI for modules like Asistencias, Empleados, Planillas, and Tareas. These components have been refactored for a consistent structure, styling approach, and user experience. -The application currently includes the following primary UI modules: +### Overview -* **Asistencias (Attendance):** Manages attendance records. -* **Empleados (Employees):** Manages employee information. -* **Planillas (Payrolls/Sheets):** Manages payrolls or general data sheets. -* **Tareas (Tasks):** Manages tasks and assignments. +Card components provide a summarized display of an item (e.g., an employee, a task) and offer quick actions. The standardization ensures that users encounter a familiar layout and interaction pattern across different modules. -Each module typically provides views for listing, creating, and editing items within its domain. +### Common HTML Structure -## Standardized Table Components +All standardized card components share a common HTML structure: -To ensure consistency across the application, table components used for displaying lists of data (e.g., `tablaAsistencias.vue`, `tablaEmpleados.vue`) have been standardized. +- **Root Element:** `
` + - This is the main container for the card. + - Styling is primarily applied using Tailwind CSS utility classes. Common classes include `bg-white shadow-md rounded-lg p-4 md:p-6 m-2 border border-gray-200 hover:shadow-lg transition-shadow duration-300 ease-in-out flex flex-col`. +- **Card Header:** `
` + - Typically contains the title or ID of the item and a status badge. + - Styled with Tailwind: `flex justify-between items-center mb-3 md:mb-4 pb-2 md:pb-3 border-b border-gray-100`. + - The title element (e.g., `

`) uses module-specific accent colors. +- **Card Body:** `
` + - Displays the main content fields of the item. + - Styled with Tailwind: `text-sm text-gray-700 space-y-2`. +- **Card Actions:** `
` + - Contains action buttons like "Editar" and "Eliminar". + - Styled with Tailwind: `mt-auto pt-3 md:pt-4 flex justify-end space-x-2 md:space-x-3`. -**Key Features & Standards:** +### Styling with Tailwind CSS -* **Styling:** Tables are styled using **Tailwind CSS**. This utility-first CSS framework allows for flexible and consistent styling. -* **Structure:** - * **Container:** Tables are wrapped in a `div` with classes `p-4 sm:p-6 bg-white shadow-md rounded-lg overflow-x-auto` for padding, background, shadow, rounded corners, and horizontal scrolling on smaller screens. - * **Table:** The `` element uses `min-w-full divide-y divide-gray-200`. - * **Header (``):** Styled with `bg-gray-50`. Header cells (``):** Uses `bg-white divide-y divide-gray-200`. Data rows (``) have a hover effect (`hover:bg-gray-100`). Data cells (`
`) use `px-4 py-3 sm:px-6 sm:py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider`. - * **Body (`
`) use `px-4 py-3 sm:px-6 sm:py-4 whitespace-nowrap text-sm text-gray-700`. - * **No Data Message:** A standardized message "No hay [items] para mostrar." is displayed if the table is empty, styled with `px-6 py-10 text-center text-gray-500 text-lg`. -* **Action Buttons:** - * Common actions like "Edit" and "Delete" are standardized. - * Buttons use SVG icons (Heroicons outline style) and consistent Tailwind CSS classes for styling and hover/focus states (e.g., `text-blue-600 hover:text-blue-800` for edit, `text-red-600 hover:text-red-800` for delete). - * Actions are typically grouped in a `div` with `flex items-center space-x-2`. -* **Status Indicators:** - * Status fields (e.g., "Estado") are visually represented using badges with consistent styling (`px-2.5 py-0.5 rounded-full text-xs font-semibold` along with color classes like `bg-green-100 text-green-800`). -* **Utility Functions:** - * Common data formatting (dates, currency, text truncation) and status styling logic is centralized in `ui/src/utils/formatters.js`. Components import and use these functions to maintain consistency and reduce code duplication. -* **Theming:** - * While the overall table structure is standardized, module-specific accent colors (defined as CSS variables like `var(--accent-color-module)`) are used in the parent views (e.g., `AsistenciasIndex.vue`) for elements like page titles and "Create New" buttons. This allows some thematic distinction per module. -* **Creating New Tables:** - * When adding new tables to the UI, they should adhere to these established standards to maintain a cohesive user experience. Refer to existing components like `tablaAsistencias.vue` or `tablaPlanillas.vue` as a template. +The visual appearance of the cards (layout, spacing, typography, borders, shadows) is managed by [Tailwind CSS](https://tailwindcss.com/). +- Utility classes are applied directly in the component templates (`