{# Card Macros =========== Reusable card components including stats cards, info cards, and action cards. Usage: {% from 'shared/macros/cards.html' import stat_card, info_card, card %} {{ stat_card('users', 'Total Users', 'stats.total', 'blue') }} {{ info_card('User Details', 'View and edit user information') }} #} {# Stat Card ========= A statistics card with icon and value. Parameters: - icon: Icon name - label: Card label/title - value: Alpine.js expression for the value - color: 'orange' | 'green' | 'blue' | 'purple' | 'red' | 'yellow' (default: 'orange') - format: Optional format function to apply to value #} {% macro stat_card(icon, label, value, color='orange', format=none) %} {% set colors = { 'orange': 'text-orange-500 bg-orange-100 dark:text-orange-100 dark:bg-orange-500', 'green': 'text-green-500 bg-green-100 dark:text-green-100 dark:bg-green-500', 'blue': 'text-blue-500 bg-blue-100 dark:text-blue-100 dark:bg-blue-500', 'purple': 'text-purple-500 bg-purple-100 dark:text-purple-100 dark:bg-purple-500', 'red': 'text-red-500 bg-red-100 dark:text-red-100 dark:bg-red-500', 'yellow': 'text-yellow-500 bg-yellow-100 dark:text-yellow-100 dark:bg-yellow-500', 'teal': 'text-teal-500 bg-teal-100 dark:text-teal-100 dark:bg-teal-500' } %}
{{ label }}
0
{{ label }}
0
{{ compare_label }}
{{ subtitle }}
{% endif %}{{ subtitle }}
{% endif %}{{ subtitle }}
{% endif %}{{ description }}