feat(web): unify Semi UI workspace states

This commit is contained in:
lingniu
2026-07-18 00:59:11 +08:00
parent 159c80b0ae
commit 1cd92715a5
13 changed files with 639 additions and 46 deletions

View File

@@ -2358,3 +2358,286 @@
font-size: 10px;
}
}
/* Unified Semi UI state language: page, panel and inline recovery surfaces. */
.v2-state-surface {
box-sizing: border-box;
width: 100%;
min-width: 0;
color: #607086;
}
.v2-state-surface.is-page {
display: grid;
min-height: 100%;
align-content: center;
justify-items: center;
gap: 24px;
background:
radial-gradient(circle at 50% 35%, rgba(18, 104, 243, .06), transparent 32%),
var(--v2-bg);
padding: clamp(24px, 5vw, 54px);
}
.v2-state-surface.is-panel {
position: relative;
inset: auto;
display: grid;
min-height: 164px;
align-content: center;
justify-items: center;
gap: 18px;
border: 0;
background: linear-gradient(180deg, rgba(249, 251, 254, .72), rgba(255, 255, 255, .98));
padding: 22px;
}
.v2-state-surface.is-inline {
display: flex;
min-height: 52px;
align-items: center;
border: 1px solid #dfe7f1;
border-radius: 10px;
background: rgba(255, 255, 255, .96);
padding: 9px 12px;
}
.v2-state-surface.is-error.is-inline {
border-color: #f3c7c4;
background: #fff8f7;
color: #b42318;
}
.v2-state-message {
display: flex;
min-width: 0;
align-items: center;
justify-content: center;
gap: 12px;
}
.v2-state-icon {
display: grid;
width: 38px;
height: 38px;
flex: 0 0 auto;
place-items: center;
border-radius: 11px;
background: #edf4ff;
color: var(--v2-blue);
}
.v2-state-surface.is-error .v2-state-icon {
background: #fff0ef;
color: #d92d20;
}
.v2-state-copy {
display: grid;
min-width: 0;
gap: 4px;
}
.v2-state-copy > .semi-typography {
display: block;
margin: 0;
}
.v2-state-copy > .semi-typography-primary {
color: #293a50;
font-size: 13px;
font-weight: 700;
}
.v2-state-copy > .semi-typography-tertiary,
.v2-state-copy > .semi-typography-danger {
overflow: hidden;
color: #7e8c9f;
font-size: 10px;
line-height: 1.55;
text-overflow: ellipsis;
}
.v2-state-copy > .semi-typography-danger {
color: #a63a32;
}
.v2-state-action {
display: flex;
flex: 0 0 auto;
margin-left: 10px;
}
.v2-state-action > .semi-button {
min-height: 34px;
border-radius: 8px;
font-weight: 650;
}
.v2-state-skeleton {
display: grid;
width: min(780px, 100%);
grid-template-columns: repeat(3, minmax(0, 1fr));
gap: 10px;
}
.v2-state-skeleton > i {
min-height: 58px;
border: 1px solid #eaf0f6;
border-radius: 10px;
background: linear-gradient(100deg, #f3f6fa 24%, #eaf1f8 38%, #f3f6fa 54%);
background-size: 300% 100%;
animation: v2-skeleton 1.4s ease infinite;
}
.v2-state-surface.is-page .v2-state-skeleton {
width: min(960px, 100%);
}
.v2-state-surface.is-page .v2-state-skeleton > i {
min-height: 92px;
}
.v2-state-surface.is-page .v2-state-skeleton > i:last-child {
min-height: 240px;
grid-column: 1 / -1;
}
.v2-state-surface.is-panel.is-compact {
position: sticky;
z-index: 3;
top: 0;
display: flex;
width: 100%;
min-height: 42px;
justify-content: center;
border-bottom: 1px solid #dfe8f2;
background: rgba(248, 251, 255, .94);
padding: 5px 12px;
backdrop-filter: blur(8px);
}
.v2-state-surface.is-panel.is-compact .v2-state-icon {
width: 28px;
height: 28px;
border-radius: 8px;
}
.v2-state-surface.is-panel.is-compact .v2-state-copy {
display: flex;
align-items: baseline;
gap: 7px;
}
.v2-state-surface.is-panel.is-compact .v2-state-skeleton {
display: none;
}
.v2-state-empty.semi-empty {
box-sizing: border-box;
width: 100%;
min-height: 140px;
justify-content: center;
padding: 20px;
}
.v2-state-empty .semi-empty-image {
height: 54px;
margin-bottom: 10px;
opacity: .8;
}
.v2-state-empty .semi-empty-title {
color: #33465d;
font-size: 13px;
font-weight: 700;
}
.v2-state-empty .semi-empty-description {
max-width: 440px;
margin-top: 6px;
color: #8491a3;
font-size: 10px;
line-height: 1.6;
}
.v2-state-empty .semi-empty-content {
margin-top: 14px;
}
.v2-state-surface.is-inline .v2-state-empty.semi-empty {
min-height: 50px;
align-items: flex-start;
padding: 4px 0;
}
.v2-state-surface.is-inline .v2-state-empty .semi-empty-image,
.v2-state-surface.is-inline .v2-state-empty .semi-empty-description {
display: none;
}
@media (max-width: 680px) {
.v2-state-surface.is-page {
gap: 18px;
padding: 18px 12px 88px;
}
.v2-state-surface.is-panel {
min-height: 142px;
padding: 18px 12px;
}
.v2-state-message {
max-width: 100%;
gap: 9px;
}
.v2-state-icon {
width: 34px;
height: 34px;
border-radius: 9px;
}
.v2-state-copy > .semi-typography-primary {
font-size: 12px;
}
.v2-state-copy > .semi-typography-tertiary,
.v2-state-copy > .semi-typography-danger {
font-size: 9px;
}
.v2-state-skeleton {
grid-template-columns: repeat(2, minmax(0, 1fr));
}
.v2-state-skeleton > i:last-child {
grid-column: 1 / -1;
}
.v2-state-surface.is-page .v2-state-skeleton > i {
min-height: 72px;
}
.v2-state-surface.is-page .v2-state-skeleton > i:last-child {
min-height: 190px;
}
.v2-state-surface.is-inline {
align-items: stretch;
padding: 9px;
}
.v2-state-surface.is-inline .v2-state-message {
width: 100%;
align-items: flex-start;
}
.v2-state-surface.is-inline .v2-state-action {
margin-left: auto;
}
.v2-state-surface.is-panel.is-compact .v2-state-copy > .semi-typography-tertiary {
display: none;
}
}