-
Notifications
You must be signed in to change notification settings - Fork 298
Expand file tree
/
Copy pathNotification.scss
More file actions
171 lines (151 loc) Β· 4.48 KB
/
Notification.scss
File metadata and controls
171 lines (151 loc) Β· 4.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
.str-chat__notification {
display: flex;
align-items: center;
gap: var(--spacing-xs);
min-height: 48px;
max-width: 100%;
padding: var(--spacing-xs);
position: relative;
pointer-events: visible;
background: var(--str-chat__notification-background, var(--background-core-inverse));
border-radius: var(--str-chat__notification-border-radius, var(--radius-3xl));
box-shadow:
0 0 0 1px rgba(0, 0, 0, 0.05),
0 4px 8px 0 rgba(0, 0, 0, 0.14),
0 12px 24px 0 rgba(0, 0, 0, 0.1);
color: var(--str-chat__notification-color, var(--text-on-inverse));
.str-chat__notification-content {
align-items: flex-start;
display: flex;
flex: 1 1 auto;
gap: var(--spacing-xs);
padding-inline: var(--spacing-xxs) var(--spacing-xs);
.str-chat__notification-icon {
display: flex;
align-self: center;
height: 100%;
svg {
block-size: var(--icon-size-sm);
inline-size: var(--icon-size-sm);
}
}
.str-chat__notification-message {
flex: 1 1 auto;
padding-block: var(--spacing-xxxs);
font: var(--str-chat__font-caption-default);
text-align: center;
white-space: nowrap;
}
}
.str-chat__notification-actions {
display: flex;
flex-basis: 100%;
align-items: center;
justify-content: flex-end;
gap: var(--spacing-xxs);
}
.str-chat__notification-close-button {
align-self: center;
padding: var(--spacing-xxs);
svg {
height: var(--icon-size-sm);
width: var(--icon-size-sm);
}
}
}
.str-chat__notification--is-entering {
// Keep entry slow enough to hide the slot swap when the current notification is dismissed.
// Duration/easing live here; directional distance is controlled by NotificationList.tsx.
animation: str-chat__notification-list-enter 760ms cubic-bezier(0.16, 1, 0.3, 1);
will-change: opacity, transform;
}
.str-chat__notification--is-exiting {
animation-duration: 340ms;
animation-fill-mode: forwards;
animation-timing-function: cubic-bezier(0.3, 0, 0.2, 1);
will-change: opacity, transform;
}
.str-chat__notification--is-exiting.str-chat__notification--enter-from-bottom {
animation-name: str-chat__notification-list-exit-to-bottom;
}
.str-chat__notification--is-exiting.str-chat__notification--enter-from-left {
animation-name: str-chat__notification-list-exit-to-left;
}
.str-chat__notification--is-exiting.str-chat__notification--enter-from-right {
animation-name: str-chat__notification-list-exit-to-right;
}
.str-chat__notification--is-exiting.str-chat__notification--enter-from-top {
animation-name: str-chat__notification-list-exit-to-top;
}
//// Severity overrides: allow themes to keep colored variants; defaults match Figma (inverse).
//.str-chat__notification--success {
// background: var(--str-chat-success-background, var(--background-core-inverse));
// color: var(--str-chat-success-color, var(--text-on-inverse));
//}
//
//.str-chat__notification--error {
// background: var(--str-chat-error-background, var(--background-core-inverse));
// color: var(--str-chat-error-color, var(--text-on-inverse));
//}
//
//.str-chat__notification--warning {
// background: var(--str-chat-warning-background, var(--background-core-inverse));
// color: var(--str-chat-warning-color, var(--text-on-inverse));
//}
//
//.str-chat__notification--info {
// background: var(--str-chat-info-background, var(--background-core-inverse));
// color: var(--str-chat-info-color, var(--text-on-inverse));
//}
// Loading state: spin the refresh icon
.str-chat__notification--loading .str-chat__notification-icon {
animation: str-chat__notification-spin 0.8s linear infinite;
}
@keyframes str-chat__notification-spin {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}
@keyframes str-chat__notification-list-exit-to-bottom {
from {
opacity: 1;
transform: translate(0, 0);
}
to {
opacity: 0;
transform: translate(0, 35%) scale(0.98);
}
}
@keyframes str-chat__notification-list-exit-to-left {
from {
opacity: 1;
transform: translate(0, 0);
}
to {
opacity: 0;
transform: translate(-35%, 0) scale(0.98);
}
}
@keyframes str-chat__notification-list-exit-to-right {
from {
opacity: 1;
transform: translate(0, 0);
}
to {
opacity: 0;
transform: translate(35%, 0) scale(0.98);
}
}
@keyframes str-chat__notification-list-exit-to-top {
from {
opacity: 1;
transform: translate(0, 0);
}
to {
opacity: 0;
transform: translate(0, -35%) scale(0.98);
}
}