UI Components
Core UI components for building consistent interfaces throughout the GIMA application.Card Components
A set of composable card components for displaying content in structured containers.Description
The Card component system provides a flexible way to create content containers with consistent styling and structure. All components accept standard React props fordiv elements.
Components
Card
Base card container with rounded corners, border, and shadow.Additional CSS classes to apply
All standard div element props
- Rounded corners (
rounded-xl) - White background with border
- Shadow and padding
- Flexbox column layout
CardHeader
Header section with grid layout for title and optional action button.Additional CSS classes to apply
- Grid layout with auto-placement
- Container queries support
- Automatic action button positioning
CardTitle
Title text with semibold font weight.Additional CSS classes to apply
CardDescription
Muted description text below title.Additional CSS classes to apply
CardAction
Action button container positioned in header.Additional CSS classes to apply
CardContent
Main content area with horizontal padding.Additional CSS classes to apply
CardFooter
Footer section with optional top border.Additional CSS classes to apply
TypeScript Signature
Usage Example
Data Slots
Each component includes adata-slot attribute for targeted styling:
cardcard-headercard-titlecard-descriptioncard-actioncard-contentcard-footer
ChartPlaceholder
Animated chart visualization component with period selector.Description
A simple bar chart visualization component with animated bars that grow on mount. Includes a dropdown to select different time periods.Props
Chart title displayed in header
Default selected period in the dropdown
TypeScript Interface
Features
- Animated Bars: Bars animate from 0 to full height on mount
- Period Selector: Dropdown with predefined time periods
- Responsive: Adapts to container width
- Weekly Data: Shows 7 bars for days of the week
Usage Example
Period Options
Default dropdown includes:- Últimos 6 meses (default)
- Últimos 3 meses
- Último mes
- Última semana
Animation
Bars use CSS transitions:DeleteAlerta
Confirmation modal for destructive actions.Description
A modal dialog that prompts the user to confirm deletion actions. Features a warning icon, customizable text, and cancel/confirm buttons.Props
Controls whether the modal is visible
Callback function when user cancels or clicks outside
Callback function when user confirms deletion
Modal title text
Description text explaining the action
TypeScript Interface
Features
- Backdrop: Semi-transparent backdrop with blur effect
- Click Outside: Clicking backdrop closes modal
- Warning Icon: Red alert triangle icon
- Close Button: X button in top-right corner
- Action Buttons: Cancel and confirm buttons
Usage Example
Styling
- Modal: White rounded card with shadow
- Backdrop: Black with 40% opacity and blur
- Confirm Button: Red with hover effect and shadow
- Cancel Button: White with gray border
- Z-index:
z-60to appear above other content
SidebarContext
Context provider and hook for sidebar state management.Description
Provides global sidebar state management using React Context. Must be used as a wrapper for components that need to control or read sidebar state.SidebarProvider
Child components that will have access to sidebar context
useSidebar Hook
Returns sidebar state and control functions.Return Type
TypeScript Interfaces
Usage Example
Error Handling
TheuseSidebar hook throws an error if used outside of SidebarProvider:
Default State
Sidebar is closed by default (isOpen: false).
TablaDeCategorias
A specialized table component for displaying and managing asset categories.Description
TheTablaDeCategorias component renders a styled table displaying all asset categories with their details. It automatically fetches category data and renders rows for each category.
Props
This component has no props - it fetches data internally from@/data/categories.
Usage
Data Source
The component imports categories from the data file:Table Structure
The table displays the following columns:- ID Categoría - Category identifier (e.g., CAT-001)
- Nombre - Category name (e.g., COMPUTO, INFRAESTRUCTURA)
- Descripción - Category description
- Total Activos - Number of assets in the category
- Acciones - Action buttons (edit/delete)
Styling
- Container: White background with rounded corners (
rounded-3xl), border, and shadow - Table: Full width with left-aligned text
- Header:
- Background:
bg-background - Text: Uppercase, bold, small (
text-xs), gray color - Tracking: Wide letter spacing (
tracking-wider) - Rounded corners on first and last header cells
- Background:
- Body: Divided rows with light gray dividers (
divide-gray-50)
Implementation Details
FilaDeCategorias Component
The component imports
FilaDeCategorias from ./filaDeCategorias, but this file doesn’t exist as a separate component in the source code. This appears to be a missing implementation. The row rendering logic should be implemented directly in TablaDeCategorias or the missing component should be created.Related Components
- Category Data: See Category Type for the data structure
- DeleteAlerta: Used for confirming category deletion
- Configuration: Used in Categories Configuration page
Source File
src/components/configuracion/TablaDeCategorias.tsx