Skip to content

Commit 4c961eb

Browse files
committed
docs: add detailed stories for StatCard component
1 parent 206a4e9 commit 4c961eb

File tree

2 files changed

+528
-3
lines changed

2 files changed

+528
-3
lines changed
Lines changed: 136 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
1+
@use "../theme";
2+
3+
.grid {
4+
display: grid;
5+
grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
6+
gap: theme.spacing(4);
7+
align-items: start;
8+
}
9+
10+
.dashboard {
11+
display: flex;
12+
flex-direction: column;
13+
gap: theme.spacing(6);
14+
}
15+
16+
.mainStats {
17+
display: grid;
18+
grid-template-columns: 2fr 1fr;
19+
gap: theme.spacing(4);
20+
}
21+
22+
.secondaryStats {
23+
display: grid;
24+
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
25+
gap: theme.spacing(4);
26+
}
27+
28+
.greenIcon {
29+
color: theme.color("states", "success", "normal");
30+
}
31+
32+
.blueIcon {
33+
color: theme.color("states", "info", "normal");
34+
}
35+
36+
.redIcon {
37+
color: theme.color("states", "error", "normal");
38+
}
39+
40+
.yellowIcon {
41+
color: theme.color("states", "warning", "normal");
42+
}
43+
44+
.miniChart {
45+
padding-top: theme.spacing(2);
46+
font-size: theme.font-size("sm");
47+
color: theme.color("muted");
48+
}
49+
50+
.trendIndicator {
51+
display: flex;
52+
align-items: center;
53+
gap: theme.spacing(2);
54+
padding-top: theme.spacing(2);
55+
font-size: theme.font-size("sm");
56+
color: theme.color("paragraph");
57+
}
58+
59+
.networkBreakdown {
60+
display: flex;
61+
gap: theme.spacing(4);
62+
padding-top: theme.spacing(2);
63+
font-size: theme.font-size("sm");
64+
color: theme.color("muted");
65+
}
66+
67+
.progressContainer {
68+
padding-top: theme.spacing(3);
69+
}
70+
71+
.progressBar {
72+
width: 100%;
73+
height: 8px;
74+
background-color: theme.color("background", "secondary");
75+
border-radius: theme.border-radius("full");
76+
overflow: hidden;
77+
}
78+
79+
.progressFill {
80+
height: 100%;
81+
background-color: theme.color("states", "success", "normal");
82+
border-radius: theme.border-radius("full");
83+
transition: width 0.3s ease;
84+
85+
&[data-progress="98.5"] {
86+
width: 98.5%;
87+
}
88+
}
89+
90+
.progressLabels {
91+
display: flex;
92+
justify-content: space-between;
93+
margin-top: theme.spacing(1);
94+
font-size: theme.font-size("xs");
95+
color: theme.color("muted");
96+
}
97+
98+
.skeleton {
99+
background: linear-gradient(
100+
90deg,
101+
theme.color("background", "secondary") 25%,
102+
theme.color("border") 50%,
103+
theme.color("background", "secondary") 75%
104+
);
105+
background-size: 200% 100%;
106+
animation: loading 1.5s infinite;
107+
border-radius: theme.border-radius("sm");
108+
padding: theme.spacing(1) theme.spacing(2);
109+
}
110+
111+
@keyframes loading {
112+
0% {
113+
background-position: 200% 0;
114+
}
115+
100% {
116+
background-position: -200% 0;
117+
}
118+
}
119+
120+
.spinner {
121+
width: 16px;
122+
height: 16px;
123+
border: 2px solid theme.color("border");
124+
border-top: 2px solid theme.color("highlight");
125+
border-radius: 50%;
126+
animation: spin 1s linear infinite;
127+
}
128+
129+
@keyframes spin {
130+
0% {
131+
transform: rotate(0deg);
132+
}
133+
100% {
134+
transform: rotate(360deg);
135+
}
136+
}

0 commit comments

Comments
 (0)