@@ -7,9 +7,12 @@ const { formatDuration, formatFileSize } = useFormats();
77
88type Props = {
99 cost: ProfilerCost ;
10+ size: ' sm' | ' md' | ' lg' ;
1011};
1112
12- const props = defineProps <Props >();
13+ const props = withDefaults (defineProps <Props >(), {
14+ size: ' md' ,
15+ })
1316
1417const statItems = computed (() => [
1518 {
@@ -41,7 +44,7 @@ const statItems = computed(() => [
4144 </script >
4245
4346<template >
44- <section class =" stat-board" >
47+ <section class =" stat-board" :class = " [`size-${size}`] " >
4548 <div v-for =" item in statItems" :key =" item.title" class =" stat-board__item" >
4649 <h4 class =" stat-board__item-name" >
4750 {{ item.title }}
@@ -65,25 +68,59 @@ const statItems = computed(() => [
6568 @apply flex flex-col sm :flex- row justify- between items- start;
6669 @apply divide-y sm :divide- y- 0 sm:divide- x divide- gray- 300 dark :divide- gray- 500;
6770 @apply bg-gray-200 dark :bg- gray- 800;
68- @apply p-0 sm :p- 4 lg:p- 6;
6971}
7072
7173.stat-board__item {
7274 @apply flex flex-row justify-between sm :flex- col sm:justify- start flex- auto;
7375 @apply w-full sm :w- auto;
74- @apply py-2 px-2 sm :py- 5 sm:px- 5;
7576}
7677
7778.stat-board__item-name {
78- @apply text-gray-600 dark :text- gray- 300 font- bold text- 2xs uppercase truncate;
79- @apply mb-0 sm :mb- 1;
79+ @apply text-gray-600 dark :text- gray- 300 font- bold uppercase truncate;
8080}
8181
82- .stat-board__item-name-detail {
83- @apply text-2xs truncate ml- 1;
82+ .stat-board__item-name-detail ,
83+ .stat-board__item-value {
84+ @apply truncate ;
8485}
8586
86- .stat-board__item-value {
87- @apply text-2xs sm :text- xs md:text- base truncate;
87+ .stat-board.size-md {
88+ @apply p-0 sm :p- 4 lg:p- 6;
89+
90+ .stat-board__item-name-detail {
91+ @apply text-2xs ml- 1;
92+ }
93+
94+ .stat-board__item {
95+ @apply py-2 px-2 sm :py- 5 sm:px- 5;
96+ }
97+
98+ .stat-board__item-name {
99+ @apply mb-0 sm :mb- 1 text- 2xs;
100+ }
101+
102+ .stat-board__item-value {
103+ @apply text-2xs sm :text- xs md:text- base;
104+ }
105+ }
106+
107+ .stat-board.size-sm {
108+ @apply p-0 border-t border-t-gray-300 dark :border- t- gray- 500;
109+
110+ .stat-board__item-name-detail {
111+ @apply text- 2xs ;
112+ }
113+
114+ .stat-board__item {
115+ @apply px-4 py- 2;
116+ }
117+
118+ .stat-board__item-name {
119+ @apply text- 2xs ;
120+ }
121+
122+ .stat-board__item-value {
123+ @apply text-xs ;
124+ }
88125}
89126 </style >
0 commit comments