76 lines
1.2 KiB
Vue
76 lines
1.2 KiB
Vue
|
|
<script setup lang="ts">
|
||
|
|
defineProps<{
|
||
|
|
eyebrow: string;
|
||
|
|
value: string | number;
|
||
|
|
label: string;
|
||
|
|
tone?: "neutral" | "brand" | "success" | "warn" | "danger" | "info";
|
||
|
|
}>();
|
||
|
|
</script>
|
||
|
|
|
||
|
|
<template>
|
||
|
|
<article class="metric-card" :class="tone ?? 'neutral'">
|
||
|
|
<p class="eyebrow">{{ eyebrow }}</p>
|
||
|
|
<strong class="value">{{ value }}</strong>
|
||
|
|
<p class="label">{{ label }}</p>
|
||
|
|
</article>
|
||
|
|
</template>
|
||
|
|
|
||
|
|
<style scoped>
|
||
|
|
.metric-card {
|
||
|
|
padding: 20px;
|
||
|
|
border-radius: 12px;
|
||
|
|
border: 1px solid #e6edf5;
|
||
|
|
background: #ffffff;
|
||
|
|
display: flex;
|
||
|
|
flex-direction: column;
|
||
|
|
}
|
||
|
|
|
||
|
|
.metric-card.brand {
|
||
|
|
border-top: 3px solid #1677ff;
|
||
|
|
}
|
||
|
|
|
||
|
|
.metric-card.success {
|
||
|
|
border-top: 3px solid #52c41a;
|
||
|
|
}
|
||
|
|
|
||
|
|
.metric-card.warn {
|
||
|
|
border-top: 3px solid #faad14;
|
||
|
|
}
|
||
|
|
|
||
|
|
.metric-card.danger {
|
||
|
|
border-top: 3px solid #ff4d4f;
|
||
|
|
}
|
||
|
|
|
||
|
|
.metric-card.info {
|
||
|
|
border-top: 3px solid #13c2c2;
|
||
|
|
}
|
||
|
|
|
||
|
|
.eyebrow,
|
||
|
|
.label {
|
||
|
|
margin: 0;
|
||
|
|
}
|
||
|
|
|
||
|
|
.eyebrow {
|
||
|
|
color: #8c8c8c;
|
||
|
|
font-size: 11px;
|
||
|
|
letter-spacing: 0.1em;
|
||
|
|
text-transform: uppercase;
|
||
|
|
}
|
||
|
|
|
||
|
|
.value {
|
||
|
|
display: block;
|
||
|
|
margin-top: 12px;
|
||
|
|
font-size: 28px;
|
||
|
|
font-weight: 600;
|
||
|
|
color: #1a1a1a;
|
||
|
|
line-height: 1;
|
||
|
|
}
|
||
|
|
|
||
|
|
.label {
|
||
|
|
margin-top: 8px;
|
||
|
|
color: #8c8c8c;
|
||
|
|
font-size: 12px;
|
||
|
|
line-height: 1.5;
|
||
|
|
}
|
||
|
|
</style>
|