@enigmax/primitives 0.20.0 → 0.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunk-WPTBURIC.js +1627 -0
- package/dist/{index-dTdAbOWl.d.ts → index-BHpOZncw.d.ts} +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/next/index.d.ts +5 -5
- package/dist/next/index.js +1 -1
- package/dist/react/button.d.ts +2 -2
- package/dist/react/index.d.ts +4 -4
- package/dist/react/index.js +1 -1
- package/dist/react/input.d.ts +2 -2
- package/dist/react/palette.d.ts +1 -1
- package/dist/react/search.d.ts +1 -1
- package/dist/react/slot.d.ts +2 -2
- package/dist/react/toast.d.ts +168 -34
- package/dist/react/toast.js +2 -2
- package/dist/react-router/index.d.ts +5 -5
- package/dist/react-router/index.js +1 -1
- package/dist/search/index.d.ts +2 -2
- package/dist/{search-DXxY8SEH.d.ts → search-BD9-5O5U.d.ts} +7 -2
- package/package.json +1 -1
- package/recipes/toast/styles.css +697 -128
- package/registry.json +79 -26
- package/src/core/search.ts +6 -1
- package/src/react/index.ts +2 -1
- package/src/react/toast/NOTICE +20 -0
- package/src/react/toast/assets.tsx +85 -0
- package/src/react/toast/cn.ts +10 -0
- package/src/react/toast/hooks.ts +13 -0
- package/src/react/toast/index.tsx +736 -0
- package/src/react/toast/state.ts +207 -0
- package/src/react/toast/styles.ts +738 -0
- package/src/react/toast/types.ts +193 -0
- package/src/react/toaster.tsx +97 -209
- package/dist/chunk-ZCUFYBPB.js +0 -154
package/recipes/toast/styles.css
CHANGED
|
@@ -1,165 +1,734 @@
|
|
|
1
1
|
/*
|
|
2
|
-
*
|
|
2
|
+
* The toast stylesheet.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* The custom properties at the top are the whole API. Override them on `:root` and you have
|
|
9
|
-
* a different theme without touching a selector.
|
|
4
|
+
* GENERATED from src/react/toast/styles.ts by scripts/sync-recipes.mjs - edit that file, not
|
|
5
|
+
* this one. It exists as a stylesheet as well as a string because <Toaster /> injects it,
|
|
6
|
+
* and this is the same sheet for anyone who would rather import it, copy it with
|
|
7
|
+
* `enigma add toast --copy`, or fork it outright.
|
|
10
8
|
*/
|
|
9
|
+
:where(html[dir="ltr"]),
|
|
10
|
+
:where([data-toastcmp-toaster][dir="ltr"]) {
|
|
11
|
+
--toast-icon-margin-start: -3px;
|
|
12
|
+
--toast-icon-margin-end: 4px;
|
|
13
|
+
--toast-svg-margin-start: -1px;
|
|
14
|
+
--toast-svg-margin-end: 0px;
|
|
15
|
+
--toast-button-margin-start: auto;
|
|
16
|
+
--toast-button-margin-end: 0;
|
|
17
|
+
--toast-close-button-start: 0;
|
|
18
|
+
--toast-close-button-end: unset;
|
|
19
|
+
--toast-close-button-transform: translate(-35%, -35%);
|
|
20
|
+
}
|
|
11
21
|
|
|
12
|
-
:
|
|
13
|
-
|
|
14
|
-
--
|
|
15
|
-
--
|
|
16
|
-
--
|
|
17
|
-
--
|
|
22
|
+
:where(html[dir="rtl"]),
|
|
23
|
+
:where([data-toastcmp-toaster][dir="rtl"]) {
|
|
24
|
+
--toast-icon-margin-start: 4px;
|
|
25
|
+
--toast-icon-margin-end: -3px;
|
|
26
|
+
--toast-svg-margin-start: 0px;
|
|
27
|
+
--toast-svg-margin-end: -1px;
|
|
28
|
+
--toast-button-margin-start: 0;
|
|
29
|
+
--toast-button-margin-end: auto;
|
|
30
|
+
--toast-close-button-start: unset;
|
|
31
|
+
--toast-close-button-end: 0;
|
|
32
|
+
--toast-close-button-transform: translate(35%, -35%);
|
|
33
|
+
}
|
|
18
34
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
35
|
+
:where([data-toastcmp-toaster]) {
|
|
36
|
+
position: fixed;
|
|
37
|
+
width: var(--width);
|
|
38
|
+
font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial,
|
|
39
|
+
Noto Sans, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji;
|
|
40
|
+
--gray1: hsl(0, 0%, 99%);
|
|
41
|
+
--gray2: hsl(0, 0%, 97.3%);
|
|
42
|
+
--gray3: hsl(0, 0%, 95.1%);
|
|
43
|
+
--gray4: hsl(0, 0%, 93%);
|
|
44
|
+
--gray5: hsl(0, 0%, 90.9%);
|
|
45
|
+
--gray6: hsl(0, 0%, 88.7%);
|
|
46
|
+
--gray7: hsl(0, 0%, 85.8%);
|
|
47
|
+
--gray8: hsl(0, 0%, 78%);
|
|
48
|
+
--gray9: hsl(0, 0%, 56.1%);
|
|
49
|
+
--gray10: hsl(0, 0%, 52.3%);
|
|
50
|
+
--gray11: hsl(0, 0%, 43.5%);
|
|
51
|
+
--gray12: hsl(0, 0%, 9%);
|
|
52
|
+
--border-radius: 8px;
|
|
53
|
+
box-sizing: border-box;
|
|
54
|
+
padding: 0;
|
|
55
|
+
margin: 0;
|
|
56
|
+
list-style: none;
|
|
57
|
+
outline: none;
|
|
58
|
+
z-index: 999999999;
|
|
59
|
+
transition: transform 400ms ease;
|
|
60
|
+
}
|
|
24
61
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
--enigma-toast-warning: #fbbf24;
|
|
28
|
-
--enigma-toast-error: #f87171;
|
|
29
|
-
--enigma-toast-loading: var(--enigma-toast-muted);
|
|
62
|
+
:where([data-toastcmp-toaster][data-lifted="true"]) {
|
|
63
|
+
transform: translateY(-10px);
|
|
30
64
|
}
|
|
31
65
|
|
|
32
|
-
@media (
|
|
33
|
-
:
|
|
34
|
-
|
|
35
|
-
--enigma-toast-border: #e5e5e5;
|
|
36
|
-
--enigma-toast-text: #171717;
|
|
37
|
-
--enigma-toast-muted: #737373;
|
|
38
|
-
--enigma-toast-shadow: 0 8px 30px rgb(0 0 0 / 12%);
|
|
66
|
+
@media (hover: none) and (pointer: coarse) {
|
|
67
|
+
:where([data-toastcmp-toaster][data-lifted="true"]) {
|
|
68
|
+
transform: none;
|
|
39
69
|
}
|
|
40
70
|
}
|
|
41
71
|
|
|
42
|
-
[data-
|
|
43
|
-
|
|
44
|
-
|
|
72
|
+
:where([data-toastcmp-toaster][data-x-position="right"]) {
|
|
73
|
+
right: var(--offset-right);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
:where([data-toastcmp-toaster][data-x-position="left"]) {
|
|
77
|
+
left: var(--offset-left);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
:where([data-toastcmp-toaster][data-x-position="center"]) {
|
|
81
|
+
left: 50%;
|
|
82
|
+
transform: translateX(-50%);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
:where([data-toastcmp-toaster][data-y-position="top"]) {
|
|
86
|
+
top: var(--offset-top);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
:where([data-toastcmp-toaster][data-y-position="bottom"]) {
|
|
90
|
+
bottom: var(--offset-bottom);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
:where([data-toastcmp-toast]) {
|
|
94
|
+
--y: translateY(100%);
|
|
95
|
+
--lift-amount: calc(var(--lift) * var(--gap));
|
|
96
|
+
z-index: var(--z-index);
|
|
97
|
+
position: absolute;
|
|
98
|
+
opacity: 0;
|
|
99
|
+
transform: var(--y);
|
|
100
|
+
filter: blur(0);
|
|
101
|
+
/* https://stackoverflow.com/questions/48124372/pointermove-event-not-working-with-touch-why-not */
|
|
102
|
+
touch-action: none;
|
|
103
|
+
transition: transform 400ms, opacity 400ms, height 400ms, box-shadow 200ms;
|
|
104
|
+
box-sizing: border-box;
|
|
105
|
+
outline: none;
|
|
106
|
+
overflow-wrap: anywhere;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
:where([data-toastcmp-toast][data-styled="true"]) {
|
|
110
|
+
padding: 16px;
|
|
111
|
+
background: var(--normal-bg);
|
|
112
|
+
border: 1px solid var(--normal-border);
|
|
113
|
+
color: var(--normal-text);
|
|
114
|
+
border-radius: var(--border-radius);
|
|
115
|
+
box-shadow: 0px 4px 12px rgba(0, 0, 0, 0.1);
|
|
116
|
+
width: var(--width);
|
|
117
|
+
font-size: 13px;
|
|
45
118
|
display: flex;
|
|
46
|
-
|
|
47
|
-
gap:
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
padding: 0;
|
|
119
|
+
align-items: center;
|
|
120
|
+
gap: 6px;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
:where([data-toastcmp-toast]:focus-visible) {
|
|
124
|
+
box-shadow: 0px 4px 12px rgba(0, 0, 0, 0.1), 0 0 0 2px rgba(0, 0, 0, 0.2);
|
|
53
125
|
}
|
|
54
126
|
|
|
55
|
-
[data-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
127
|
+
:where([data-toastcmp-toast][data-y-position="top"]) {
|
|
128
|
+
top: 0;
|
|
129
|
+
--y: translateY(-100%);
|
|
130
|
+
--lift: 1;
|
|
131
|
+
--lift-amount: calc(1 * var(--gap));
|
|
132
|
+
}
|
|
60
133
|
|
|
61
|
-
[data-
|
|
62
|
-
|
|
134
|
+
:where([data-toastcmp-toast][data-y-position="bottom"]) {
|
|
135
|
+
bottom: 0;
|
|
136
|
+
--y: translateY(100%);
|
|
137
|
+
--lift: -1;
|
|
138
|
+
--lift-amount: calc(var(--lift) * var(--gap));
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
:where([data-toastcmp-toast]) :where([data-description]) {
|
|
142
|
+
font-weight: 400;
|
|
143
|
+
line-height: 1.4;
|
|
144
|
+
color: inherit;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
:where([data-toastcmp-toast]) :where([data-title]) {
|
|
148
|
+
font-weight: 500;
|
|
149
|
+
line-height: 1.5;
|
|
150
|
+
color: inherit;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
:where([data-toastcmp-toast]) :where([data-icon]) {
|
|
154
|
+
display: flex;
|
|
155
|
+
height: 16px;
|
|
156
|
+
width: 16px;
|
|
63
157
|
position: relative;
|
|
64
|
-
|
|
65
|
-
grid-template-columns: 1fr auto;
|
|
158
|
+
justify-content: flex-start;
|
|
66
159
|
align-items: center;
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
160
|
+
flex-shrink: 0;
|
|
161
|
+
margin-left: var(--toast-icon-margin-start);
|
|
162
|
+
margin-right: var(--toast-icon-margin-end);
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
:where([data-toastcmp-toast][data-promise="true"]) :where([data-icon])>svg {
|
|
166
|
+
opacity: 0;
|
|
167
|
+
transform: scale(0.8);
|
|
168
|
+
transform-origin: center;
|
|
169
|
+
animation: toastcmp-fade-in 300ms ease forwards;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
:where([data-toastcmp-toast]) :where([data-icon])>* {
|
|
173
|
+
flex-shrink: 0;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
:where([data-toastcmp-toast]) :where([data-icon]) svg {
|
|
177
|
+
margin-left: var(--toast-svg-margin-start);
|
|
178
|
+
margin-right: var(--toast-svg-margin-end);
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
:where([data-toastcmp-toast]) :where([data-content]) {
|
|
182
|
+
display: flex;
|
|
183
|
+
flex-direction: column;
|
|
184
|
+
gap: 2px;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
[data-toastcmp-toast][data-styled="true"] [data-button] {
|
|
188
|
+
border-radius: 4px;
|
|
189
|
+
padding-left: 8px;
|
|
190
|
+
padding-right: 8px;
|
|
191
|
+
height: 24px;
|
|
192
|
+
font-size: 12px;
|
|
193
|
+
color: var(--normal-bg);
|
|
194
|
+
background: var(--normal-text);
|
|
195
|
+
margin-left: var(--toast-button-margin-start);
|
|
196
|
+
margin-right: var(--toast-button-margin-end);
|
|
197
|
+
border: none;
|
|
198
|
+
cursor: pointer;
|
|
78
199
|
outline: none;
|
|
200
|
+
display: flex;
|
|
201
|
+
align-items: center;
|
|
202
|
+
flex-shrink: 0;
|
|
203
|
+
transition: opacity 400ms, box-shadow 200ms;
|
|
79
204
|
}
|
|
80
205
|
|
|
81
|
-
[data-
|
|
206
|
+
:where([data-toastcmp-toast]) :where([data-button]):focus-visible {
|
|
207
|
+
box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.4);
|
|
208
|
+
}
|
|
82
209
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
210
|
+
:where([data-toastcmp-toast]) :where([data-button]):first-of-type {
|
|
211
|
+
margin-left: var(--toast-button-margin-start);
|
|
212
|
+
margin-right: var(--toast-button-margin-end);
|
|
213
|
+
}
|
|
86
214
|
|
|
87
|
-
[data-
|
|
215
|
+
:where([data-toastcmp-toast]) :where([data-cancel]) {
|
|
216
|
+
color: var(--normal-text);
|
|
217
|
+
background: rgba(0, 0, 0, 0.08);
|
|
218
|
+
}
|
|
88
219
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
220
|
+
:where([data-toastcmp-toast][data-theme="dark"]) :where([data-cancel]) {
|
|
221
|
+
background: rgba(255, 255, 255, 0.3);
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
:where([data-toastcmp-toast]) :where([data-close-button]) {
|
|
92
225
|
position: absolute;
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
[data-enigma-toast-body] { grid-column: 1; margin: 0; font-size: 0.8125rem; color: var(--enigma-toast-muted); line-height: 1.45; }
|
|
107
|
-
|
|
108
|
-
[data-enigma-toast-action] {
|
|
109
|
-
grid-column: 2;
|
|
110
|
-
grid-row: 1 / -1;
|
|
111
|
-
padding: 0.3125rem 0.625rem;
|
|
112
|
-
font: inherit;
|
|
113
|
-
font-size: 0.75rem;
|
|
114
|
-
font-weight: 600;
|
|
115
|
-
color: var(--enigma-toast-bg);
|
|
116
|
-
background: var(--enigma-toast-text);
|
|
117
|
-
border: 0;
|
|
118
|
-
border-radius: 0.375rem;
|
|
226
|
+
left: var(--toast-close-button-start);
|
|
227
|
+
right: var(--toast-close-button-end);
|
|
228
|
+
top: 0;
|
|
229
|
+
height: 20px;
|
|
230
|
+
width: 20px;
|
|
231
|
+
display: flex;
|
|
232
|
+
justify-content: center;
|
|
233
|
+
align-items: center;
|
|
234
|
+
padding: 0;
|
|
235
|
+
color: var(--gray12);
|
|
236
|
+
border: 1px solid var(--gray4);
|
|
237
|
+
transform: var(--toast-close-button-transform);
|
|
238
|
+
border-radius: 50%;
|
|
119
239
|
cursor: pointer;
|
|
240
|
+
z-index: 1;
|
|
241
|
+
transition: opacity 100ms, background 200ms, border-color 200ms;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
[data-toastcmp-toast] [data-close-button] {
|
|
245
|
+
background: var(--gray1);
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
:where([data-toastcmp-toast]) :where([data-close-button]):focus-visible {
|
|
249
|
+
box-shadow: 0px 4px 12px rgba(0, 0, 0, 0.1), 0 0 0 2px rgba(0, 0, 0, 0.2);
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
:where([data-toastcmp-toast]) :where([data-disabled="true"]) {
|
|
253
|
+
cursor: not-allowed;
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
:where([data-toastcmp-toast]):hover :where([data-close-button]):hover {
|
|
257
|
+
background: var(--gray2);
|
|
258
|
+
border-color: var(--gray5);
|
|
120
259
|
}
|
|
121
260
|
|
|
122
|
-
|
|
261
|
+
/* Leave a ghost div to avoid setting hover to false when swiping out */
|
|
262
|
+
:where([data-toastcmp-toast][data-swiping="true"])::before {
|
|
263
|
+
content: "";
|
|
123
264
|
position: absolute;
|
|
124
|
-
|
|
125
|
-
right:
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
line-height: 1;
|
|
129
|
-
color: var(--enigma-toast-muted);
|
|
130
|
-
background: none;
|
|
131
|
-
border: 0;
|
|
132
|
-
cursor: pointer;
|
|
133
|
-
/* Shown on hover or focus, so it never covers the message while it is being read - but
|
|
134
|
-
always reachable by keyboard, which `display: none` would take away. */
|
|
135
|
-
opacity: 0;
|
|
136
|
-
transition: opacity 120ms ease-out;
|
|
265
|
+
left: -50%;
|
|
266
|
+
right: -50%;
|
|
267
|
+
height: 100%;
|
|
268
|
+
z-index: -1;
|
|
137
269
|
}
|
|
138
270
|
|
|
139
|
-
[data-
|
|
140
|
-
|
|
271
|
+
:where([data-toastcmp-toast][data-y-position="top"][data-swiping="true"])::before {
|
|
272
|
+
/* y 50% needed to distribute height additional height evenly */
|
|
273
|
+
bottom: 50%;
|
|
274
|
+
transform: scaleY(3) translateY(50%);
|
|
275
|
+
}
|
|
141
276
|
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
@keyframes enigma-toast-out { to { opacity: 0; scale: 0.94; } }
|
|
277
|
+
:where([data-toastcmp-toast][data-y-position="bottom"][data-swiping="true"])::before {
|
|
278
|
+
/* y -50% needed to distribute height additional height evenly */
|
|
279
|
+
top: 50%;
|
|
280
|
+
transform: scaleY(3) translateY(-50%);
|
|
281
|
+
}
|
|
148
282
|
|
|
149
|
-
|
|
150
|
-
[data-
|
|
151
|
-
|
|
152
|
-
|
|
283
|
+
/* Leave a ghost div to avoid setting hover to false when transitioning out */
|
|
284
|
+
:where([data-toastcmp-toast][data-swiping="false"][data-removed="true"])::before {
|
|
285
|
+
content: "";
|
|
286
|
+
position: absolute;
|
|
287
|
+
inset: 0;
|
|
288
|
+
transform: scaleY(2);
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
/* Needed to avoid setting hover to false when inbetween toasts */
|
|
292
|
+
:where([data-toastcmp-toast])::after {
|
|
293
|
+
content: "";
|
|
294
|
+
position: absolute;
|
|
295
|
+
left: 0;
|
|
296
|
+
height: calc(var(--gap) + 1px);
|
|
297
|
+
bottom: 100%;
|
|
298
|
+
width: 100%;
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
:where([data-toastcmp-toast][data-mounted="true"]) {
|
|
302
|
+
--y: translateY(0);
|
|
303
|
+
opacity: 1;
|
|
304
|
+
}
|
|
153
305
|
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
306
|
+
:where([data-toastcmp-toast][data-expanded="false"][data-front="false"]) {
|
|
307
|
+
--scale: var(--toasts-before) * 0.05 + 1;
|
|
308
|
+
--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));
|
|
309
|
+
height: var(--front-toast-height);
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
:where([data-toastcmp-toast])>* {
|
|
313
|
+
transition: opacity 400ms;
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
:where([data-toastcmp-toast][data-expanded="false"][data-front="false"][data-styled="true"])>* {
|
|
317
|
+
opacity: 0;
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
:where([data-toastcmp-toast][data-visible="false"]) {
|
|
321
|
+
opacity: 0;
|
|
158
322
|
pointer-events: none;
|
|
159
323
|
}
|
|
160
324
|
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
[data-enigma-toast][data-state="leaving"] { opacity: 0; }
|
|
325
|
+
:where([data-toastcmp-toast][data-mounted="true"][data-expanded="true"]) {
|
|
326
|
+
--y: translateY(calc(var(--lift) * var(--offset)));
|
|
327
|
+
height: var(--initial-height);
|
|
165
328
|
}
|
|
329
|
+
|
|
330
|
+
:where([data-toastcmp-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]) {
|
|
331
|
+
--y: translateY(calc(var(--lift) * -100%));
|
|
332
|
+
opacity: 0;
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
:where([data-toastcmp-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="true"]) {
|
|
336
|
+
--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));
|
|
337
|
+
opacity: 0;
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
:where([data-toastcmp-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="false"]) {
|
|
341
|
+
--y: translateY(40%);
|
|
342
|
+
opacity: 0;
|
|
343
|
+
transition: transform 500ms, opacity 200ms;
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
/* Bump up the height to make sure hover state doesn"t get set to false */
|
|
347
|
+
:where([data-toastcmp-toast][data-removed="true"][data-front="false"])::before {
|
|
348
|
+
height: calc(var(--initial-height) + 20%);
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
[data-toastcmp-toast][data-swiping="true"] {
|
|
352
|
+
transform: var(--y) translateY(var(--swipe-amount-y, 0px)) translateX(var(--swipe-amount-x, 0px));
|
|
353
|
+
transition: none;
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
[data-toastcmp-toast][data-swiped="true"] {
|
|
357
|
+
user-select: none;
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
[data-toastcmp-toast][data-swipe-out="true"][data-y-position="bottom"],
|
|
361
|
+
[data-toastcmp-toast][data-swipe-out="true"][data-y-position="top"] {
|
|
362
|
+
animation-duration: 200ms;
|
|
363
|
+
animation-timing-function: ease-out;
|
|
364
|
+
animation-fill-mode: forwards;
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
[data-toastcmp-toast][data-swipe-out="true"][data-swipe-direction="left"] {
|
|
368
|
+
animation-name: swipe-out-left;
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
[data-toastcmp-toast][data-swipe-out="true"][data-swipe-direction="right"] {
|
|
372
|
+
animation-name: swipe-out-right;
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
[data-toastcmp-toast][data-swipe-out="true"][data-swipe-direction="up"] {
|
|
376
|
+
animation-name: swipe-out-up;
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
[data-toastcmp-toast][data-swipe-out="true"][data-swipe-direction="down"] {
|
|
380
|
+
animation-name: swipe-out-down;
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
@keyframes swipe-out-left {
|
|
384
|
+
from {
|
|
385
|
+
transform: var(--y) translateX(var(--swipe-amount-x));
|
|
386
|
+
opacity: 1;
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
to {
|
|
390
|
+
transform: var(--y) translateX(calc(var(--swipe-amount-x) - 100%));
|
|
391
|
+
opacity: 0;
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
@keyframes swipe-out-right {
|
|
396
|
+
from {
|
|
397
|
+
transform: var(--y) translateX(var(--swipe-amount-x));
|
|
398
|
+
opacity: 1;
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
to {
|
|
402
|
+
transform: var(--y) translateX(calc(var(--swipe-amount-x) + 100%));
|
|
403
|
+
opacity: 0;
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
@keyframes swipe-out-up {
|
|
408
|
+
from {
|
|
409
|
+
transform: var(--y) translateY(var(--swipe-amount-y));
|
|
410
|
+
opacity: 1;
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
to {
|
|
414
|
+
transform: var(--y) translateY(calc(var(--swipe-amount-y) - 100%));
|
|
415
|
+
opacity: 0;
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
@keyframes swipe-out-down {
|
|
420
|
+
from {
|
|
421
|
+
transform: var(--y) translateY(var(--swipe-amount-y));
|
|
422
|
+
opacity: 1;
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
to {
|
|
426
|
+
transform: var(--y) translateY(calc(var(--swipe-amount-y) + 100%));
|
|
427
|
+
opacity: 0;
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
@media (max-width: 600px) {
|
|
432
|
+
[data-toastcmp-toaster] {
|
|
433
|
+
position: fixed;
|
|
434
|
+
right: var(--mobile-offset-right);
|
|
435
|
+
left: var(--mobile-offset-left);
|
|
436
|
+
width: 100%;
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
[data-toastcmp-toaster][dir="rtl"] {
|
|
440
|
+
left: calc(var(--mobile-offset-left) * -1);
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
[data-toastcmp-toaster] [data-toastcmp-toast] {
|
|
444
|
+
left: 0;
|
|
445
|
+
right: 0;
|
|
446
|
+
width: calc(100% - var(--mobile-offset-left) * 2);
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
[data-toastcmp-toaster][data-x-position="left"] {
|
|
450
|
+
left: var(--mobile-offset-left);
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
[data-toastcmp-toaster][data-y-position="bottom"] {
|
|
454
|
+
bottom: var(--mobile-offset-bottom);
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
[data-toastcmp-toaster][data-y-position="top"] {
|
|
458
|
+
top: var(--mobile-offset-top);
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
[data-toastcmp-toaster][data-x-position="center"] {
|
|
462
|
+
left: var(--mobile-offset-left);
|
|
463
|
+
right: var(--mobile-offset-right);
|
|
464
|
+
transform: none;
|
|
465
|
+
}
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
[data-toastcmp-toaster][data-theme="light"] {
|
|
469
|
+
--normal-bg: #fff;
|
|
470
|
+
--normal-border: var(--gray4);
|
|
471
|
+
--normal-text: var(--gray12);
|
|
472
|
+
|
|
473
|
+
--success-bg: hsl(143, 85%, 96%);
|
|
474
|
+
--success-border: hsl(145, 92%, 91%);
|
|
475
|
+
--success-text: hsl(140, 100%, 27%);
|
|
476
|
+
|
|
477
|
+
--info-bg: hsl(208, 100%, 97%);
|
|
478
|
+
--info-border: hsl(221, 91%, 91%);
|
|
479
|
+
--info-text: hsl(210, 92%, 45%);
|
|
480
|
+
|
|
481
|
+
--warning-bg: hsl(49, 100%, 97%);
|
|
482
|
+
--warning-border: hsl(49, 91%, 91%);
|
|
483
|
+
--warning-text: hsl(31, 92%, 45%);
|
|
484
|
+
|
|
485
|
+
--error-bg: hsl(359, 100%, 97%);
|
|
486
|
+
--error-border: hsl(359, 100%, 94%);
|
|
487
|
+
--error-text: hsl(360, 100%, 45%);
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
[data-toastcmp-toaster][data-theme="light"] [data-toastcmp-toast][data-invert="true"] {
|
|
491
|
+
--normal-bg: #000;
|
|
492
|
+
--normal-border: hsl(0, 0%, 20%);
|
|
493
|
+
--normal-text: var(--gray1);
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
[data-toastcmp-toaster][data-theme="dark"] [data-toastcmp-toast][data-invert="true"] {
|
|
497
|
+
--normal-bg: #fff;
|
|
498
|
+
--normal-border: var(--gray3);
|
|
499
|
+
--normal-text: var(--gray12);
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
[data-toastcmp-toaster][data-theme="dark"] {
|
|
503
|
+
--normal-bg: #000;
|
|
504
|
+
--normal-bg-hover: hsl(0, 0%, 12%);
|
|
505
|
+
--normal-border: hsl(0, 0%, 20%);
|
|
506
|
+
--normal-border-hover: hsl(0, 0%, 25%);
|
|
507
|
+
--normal-text: var(--gray1);
|
|
508
|
+
|
|
509
|
+
--success-bg: hsl(150, 100%, 6%);
|
|
510
|
+
--success-border: hsl(147, 100%, 12%);
|
|
511
|
+
--success-text: hsl(150, 86%, 65%);
|
|
512
|
+
|
|
513
|
+
--info-bg: hsl(215, 100%, 6%);
|
|
514
|
+
--info-border: hsl(223, 100%, 12%);
|
|
515
|
+
--info-text: hsl(216, 87%, 65%);
|
|
516
|
+
|
|
517
|
+
--warning-bg: hsl(64, 100%, 6%);
|
|
518
|
+
--warning-border: hsl(60, 100%, 12%);
|
|
519
|
+
--warning-text: hsl(46, 87%, 65%);
|
|
520
|
+
|
|
521
|
+
--error-bg: hsl(358, 76%, 10%);
|
|
522
|
+
--error-border: hsl(357, 89%, 16%);
|
|
523
|
+
--error-text: hsl(358, 100%, 81%);
|
|
524
|
+
}
|
|
525
|
+
|
|
526
|
+
[data-toastcmp-toaster][data-theme="dark"] [data-toastcmp-toast] [data-close-button] {
|
|
527
|
+
background: var(--normal-bg);
|
|
528
|
+
border-color: var(--normal-border);
|
|
529
|
+
color: var(--normal-text);
|
|
530
|
+
}
|
|
531
|
+
|
|
532
|
+
[data-toastcmp-toaster][data-theme="dark"] [data-toastcmp-toast] [data-close-button]:hover {
|
|
533
|
+
background: var(--normal-bg-hover);
|
|
534
|
+
border-color: var(--normal-border-hover);
|
|
535
|
+
}
|
|
536
|
+
|
|
537
|
+
[data-rich-colors="true"][data-toastcmp-toast][data-type="success"] {
|
|
538
|
+
background: var(--success-bg);
|
|
539
|
+
border-color: var(--success-border);
|
|
540
|
+
color: var(--success-text);
|
|
541
|
+
}
|
|
542
|
+
|
|
543
|
+
[data-rich-colors="true"][data-toastcmp-toast][data-type="success"] [data-close-button] {
|
|
544
|
+
background: var(--success-bg);
|
|
545
|
+
border-color: var(--success-border);
|
|
546
|
+
color: var(--success-text);
|
|
547
|
+
}
|
|
548
|
+
|
|
549
|
+
[data-rich-colors="true"][data-toastcmp-toast][data-type="info"] {
|
|
550
|
+
background: var(--info-bg);
|
|
551
|
+
border-color: var(--info-border);
|
|
552
|
+
color: var(--info-text);
|
|
553
|
+
}
|
|
554
|
+
|
|
555
|
+
[data-rich-colors="true"][data-toastcmp-toast][data-type="info"] [data-close-button] {
|
|
556
|
+
background: var(--info-bg);
|
|
557
|
+
border-color: var(--info-border);
|
|
558
|
+
color: var(--info-text);
|
|
559
|
+
}
|
|
560
|
+
|
|
561
|
+
[data-rich-colors="true"][data-toastcmp-toast][data-type="warning"] {
|
|
562
|
+
background: var(--warning-bg);
|
|
563
|
+
border-color: var(--warning-border);
|
|
564
|
+
color: var(--warning-text);
|
|
565
|
+
}
|
|
566
|
+
|
|
567
|
+
[data-rich-colors="true"][data-toastcmp-toast][data-type="warning"] [data-close-button] {
|
|
568
|
+
background: var(--warning-bg);
|
|
569
|
+
border-color: var(--warning-border);
|
|
570
|
+
color: var(--warning-text);
|
|
571
|
+
}
|
|
572
|
+
|
|
573
|
+
[data-rich-colors="true"][data-toastcmp-toast][data-type="error"] {
|
|
574
|
+
background: var(--error-bg);
|
|
575
|
+
border-color: var(--error-border);
|
|
576
|
+
color: var(--error-text);
|
|
577
|
+
}
|
|
578
|
+
|
|
579
|
+
[data-rich-colors="true"][data-toastcmp-toast][data-type="error"] [data-close-button] {
|
|
580
|
+
background: var(--error-bg);
|
|
581
|
+
border-color: var(--error-border);
|
|
582
|
+
color: var(--error-text);
|
|
583
|
+
}
|
|
584
|
+
|
|
585
|
+
.toastcmp-loading-wrapper {
|
|
586
|
+
--size: 16px;
|
|
587
|
+
height: var(--size);
|
|
588
|
+
width: var(--size);
|
|
589
|
+
position: absolute;
|
|
590
|
+
inset: 0;
|
|
591
|
+
z-index: 10;
|
|
592
|
+
}
|
|
593
|
+
|
|
594
|
+
.toastcmp-loading-wrapper[data-visible="false"] {
|
|
595
|
+
transform-origin: center;
|
|
596
|
+
animation: toastcmp-fade-out 0.2s ease forwards;
|
|
597
|
+
}
|
|
598
|
+
|
|
599
|
+
.toastcmp-spinner {
|
|
600
|
+
position: relative;
|
|
601
|
+
top: 50%;
|
|
602
|
+
left: 50%;
|
|
603
|
+
height: var(--size);
|
|
604
|
+
width: var(--size);
|
|
605
|
+
}
|
|
606
|
+
|
|
607
|
+
.toastcmp-loading-bar {
|
|
608
|
+
animation: toastcmp-spin 1.2s linear infinite;
|
|
609
|
+
background: var(--gray11);
|
|
610
|
+
border-radius: 6px;
|
|
611
|
+
height: 8%;
|
|
612
|
+
left: -10%;
|
|
613
|
+
position: absolute;
|
|
614
|
+
top: -3.9%;
|
|
615
|
+
width: 24%;
|
|
616
|
+
}
|
|
617
|
+
|
|
618
|
+
.toastcmp-loading-bar:nth-child(1) {
|
|
619
|
+
animation-delay: -1.2s;
|
|
620
|
+
transform: rotate(0.0001deg) translate(146%);
|
|
621
|
+
}
|
|
622
|
+
|
|
623
|
+
.toastcmp-loading-bar:nth-child(2) {
|
|
624
|
+
animation-delay: -1.1s;
|
|
625
|
+
transform: rotate(30deg) translate(146%);
|
|
626
|
+
}
|
|
627
|
+
|
|
628
|
+
.toastcmp-loading-bar:nth-child(3) {
|
|
629
|
+
animation-delay: -1s;
|
|
630
|
+
transform: rotate(60deg) translate(146%);
|
|
631
|
+
}
|
|
632
|
+
|
|
633
|
+
.toastcmp-loading-bar:nth-child(4) {
|
|
634
|
+
animation-delay: -0.9s;
|
|
635
|
+
transform: rotate(90deg) translate(146%);
|
|
636
|
+
}
|
|
637
|
+
|
|
638
|
+
.toastcmp-loading-bar:nth-child(5) {
|
|
639
|
+
animation-delay: -0.8s;
|
|
640
|
+
transform: rotate(120deg) translate(146%);
|
|
641
|
+
}
|
|
642
|
+
|
|
643
|
+
.toastcmp-loading-bar:nth-child(6) {
|
|
644
|
+
animation-delay: -0.7s;
|
|
645
|
+
transform: rotate(150deg) translate(146%);
|
|
646
|
+
}
|
|
647
|
+
|
|
648
|
+
.toastcmp-loading-bar:nth-child(7) {
|
|
649
|
+
animation-delay: -0.6s;
|
|
650
|
+
transform: rotate(180deg) translate(146%);
|
|
651
|
+
}
|
|
652
|
+
|
|
653
|
+
.toastcmp-loading-bar:nth-child(8) {
|
|
654
|
+
animation-delay: -0.5s;
|
|
655
|
+
transform: rotate(210deg) translate(146%);
|
|
656
|
+
}
|
|
657
|
+
|
|
658
|
+
.toastcmp-loading-bar:nth-child(9) {
|
|
659
|
+
animation-delay: -0.4s;
|
|
660
|
+
transform: rotate(240deg) translate(146%);
|
|
661
|
+
}
|
|
662
|
+
|
|
663
|
+
.toastcmp-loading-bar:nth-child(10) {
|
|
664
|
+
animation-delay: -0.3s;
|
|
665
|
+
transform: rotate(270deg) translate(146%);
|
|
666
|
+
}
|
|
667
|
+
|
|
668
|
+
.toastcmp-loading-bar:nth-child(11) {
|
|
669
|
+
animation-delay: -0.2s;
|
|
670
|
+
transform: rotate(300deg) translate(146%);
|
|
671
|
+
}
|
|
672
|
+
|
|
673
|
+
.toastcmp-loading-bar:nth-child(12) {
|
|
674
|
+
animation-delay: -0.1s;
|
|
675
|
+
transform: rotate(330deg) translate(146%);
|
|
676
|
+
}
|
|
677
|
+
|
|
678
|
+
@keyframes toastcmp-fade-in {
|
|
679
|
+
0% {
|
|
680
|
+
opacity: 0;
|
|
681
|
+
transform: scale(0.8);
|
|
682
|
+
}
|
|
683
|
+
|
|
684
|
+
100% {
|
|
685
|
+
opacity: 1;
|
|
686
|
+
transform: scale(1);
|
|
687
|
+
}
|
|
688
|
+
}
|
|
689
|
+
|
|
690
|
+
@keyframes toastcmp-fade-out {
|
|
691
|
+
0% {
|
|
692
|
+
opacity: 1;
|
|
693
|
+
transform: scale(1);
|
|
694
|
+
}
|
|
695
|
+
|
|
696
|
+
100% {
|
|
697
|
+
opacity: 0;
|
|
698
|
+
transform: scale(0.8);
|
|
699
|
+
}
|
|
700
|
+
}
|
|
701
|
+
|
|
702
|
+
@keyframes toastcmp-spin {
|
|
703
|
+
0% {
|
|
704
|
+
opacity: 1;
|
|
705
|
+
}
|
|
706
|
+
|
|
707
|
+
100% {
|
|
708
|
+
opacity: 0.15;
|
|
709
|
+
}
|
|
710
|
+
}
|
|
711
|
+
|
|
712
|
+
@media (prefers-reduced-motion) {
|
|
713
|
+
|
|
714
|
+
[data-toastcmp-toast],
|
|
715
|
+
[data-toastcmp-toast]>*,
|
|
716
|
+
.toastcmp-loading-bar {
|
|
717
|
+
transition: none !important;
|
|
718
|
+
animation: none !important;
|
|
719
|
+
}
|
|
720
|
+
}
|
|
721
|
+
|
|
722
|
+
.toastcmp-loader {
|
|
723
|
+
position: absolute;
|
|
724
|
+
top: 50%;
|
|
725
|
+
left: 50%;
|
|
726
|
+
transform: translate(-50%, -50%);
|
|
727
|
+
transform-origin: center;
|
|
728
|
+
transition: opacity 200ms, transform 200ms;
|
|
729
|
+
}
|
|
730
|
+
|
|
731
|
+
.toastcmp-loader[data-visible="false"] {
|
|
732
|
+
opacity: 0;
|
|
733
|
+
transform: scale(0.8) translate(-50%, -50%);
|
|
734
|
+
}
|