DashboardMetricCard.vue 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <template>
  2. <q-card :class="['metric-card', `metric-card--${variant}`]" flat>
  3. <span class="metric-label">
  4. {{ label }}
  5. </span>
  6. <strong class="metric-value">
  7. {{ value }}
  8. </strong>
  9. <span class="metric-caption">
  10. {{ caption }}
  11. </span>
  12. </q-card>
  13. </template>
  14. <script setup>
  15. defineProps({
  16. caption: { type: String, default: "" },
  17. label: { type: String, required: true },
  18. value: { type: String, required: true },
  19. variant: { type: String, default: "primary" },
  20. });
  21. </script>
  22. <style scoped lang="scss">
  23. .metric-card {
  24. display: flex;
  25. flex-direction: column;
  26. justify-content: space-between;
  27. gap: 6px;
  28. min-height: 106px;
  29. padding: 16px;
  30. border: 1px solid #d9e3e7;
  31. border-radius: 12px;
  32. background: #f0f3f5;
  33. vertical-align: middle;
  34. }
  35. .metric-card--primary {
  36. border-top: 3px solid #b7f35a;
  37. }
  38. .metric-card--secondary {
  39. border-top: 3px solid #84A8A6;
  40. }
  41. .metric-label {
  42. font-size: 19px;
  43. font-weight: 400;
  44. color: #4D4E4E;
  45. }
  46. .metric-value {
  47. font-size: 24px;
  48. line-height: 1.15;
  49. color: #111212;
  50. }
  51. .metric-caption {
  52. font-size: 14px;
  53. color: #4D4E4E;
  54. }
  55. </style>