feat: add NotificationStack component and notify API for toast notifications
This commit is contained in:
1 parent
d005ee6f51
commit
fc0e376df8
6 files changed
+441
-9
No files matched your search
@@ -717,6 +717,86 @@
|
||||
color: var(--sc-fg);
|
||||
}
|
||||
|
||||
.sc-notification-stack {
|
||||
position: fixed;
|
||||
z-index: 200;
|
||||
top: 1rem;
|
||||
right: 1rem;
|
||||
display: grid;
|
||||
gap: 0.625rem;
|
||||
width: min(100% - 2rem, 24rem);
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.sc-notification {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
gap: 0.625rem;
|
||||
padding: 0.875rem 1rem;
|
||||
color: var(--sc-fg);
|
||||
background: var(--sc-surface-raised);
|
||||
border: 1px solid var(--sc-border);
|
||||
border-radius: var(--sc-radius-md);
|
||||
box-shadow: var(--sc-shadow-lg);
|
||||
pointer-events: auto;
|
||||
}
|
||||
|
||||
.sc-notification-icon {
|
||||
flex: 0 0 auto;
|
||||
margin-top: 0.125rem;
|
||||
color: var(--sc-muted-fg);
|
||||
}
|
||||
|
||||
.sc-notification[data-variant="success"] .sc-notification-icon {
|
||||
color: var(--sc-success);
|
||||
}
|
||||
|
||||
.sc-notification[data-variant="error"] .sc-notification-icon {
|
||||
color: var(--sc-danger);
|
||||
}
|
||||
|
||||
.sc-notification[data-variant="warning"] .sc-notification-icon {
|
||||
color: var(--sc-warning);
|
||||
}
|
||||
|
||||
.sc-notification[data-variant="info"] .sc-notification-icon {
|
||||
color: var(--sc-primary);
|
||||
}
|
||||
|
||||
.sc-notification-message {
|
||||
flex: 1 1 auto;
|
||||
margin: 0;
|
||||
font-size: 0.875rem;
|
||||
line-height: 1.45;
|
||||
}
|
||||
|
||||
.sc-notification-close {
|
||||
display: grid;
|
||||
flex: 0 0 auto;
|
||||
width: 1.5rem;
|
||||
height: 1.5rem;
|
||||
place-items: center;
|
||||
color: var(--sc-muted-fg);
|
||||
background: transparent;
|
||||
border: 0;
|
||||
border-radius: var(--sc-radius-sm);
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.sc-notification-close:hover {
|
||||
color: var(--sc-fg);
|
||||
background: var(--sc-surface-hover);
|
||||
}
|
||||
|
||||
@media (max-width: 30rem) {
|
||||
.sc-notification-stack {
|
||||
top: 0.75rem;
|
||||
right: 0.75rem;
|
||||
left: 0.75rem;
|
||||
width: auto;
|
||||
}
|
||||
}
|
||||
|
||||
.sc-dialog-backdrop {
|
||||
position: fixed;
|
||||
z-index: 100;
|
||||
|
||||
Reference in new issue
Block a user