@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.
@@ -1,165 +1,734 @@
1
1
  /*
2
- * Ember - the default toast theme.
2
+ * The toast stylesheet.
3
3
  *
4
- * Every colour, every distance and every curve is in this file. `<Toaster />` renders the
5
- * structure and the state; nothing below is something the package decided for you, so
6
- * editing this file is the supported way to make it yours.
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
- :root {
13
- --enigma-toast-width: 22rem;
14
- --enigma-toast-gap: 0.625rem;
15
- --enigma-toast-edge: 1.25rem;
16
- --enigma-toast-radius: 0.75rem;
17
- --enigma-toast-exit: 200ms;
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
- --enigma-toast-bg: #101010;
20
- --enigma-toast-border: #2a2a2a;
21
- --enigma-toast-text: #f5f5f5;
22
- --enigma-toast-muted: #a3a3a3;
23
- --enigma-toast-shadow: 0 8px 30px rgb(0 0 0 / 45%);
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
- --enigma-toast-info: #60a5fa;
26
- --enigma-toast-success: #4ade80;
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 (prefers-color-scheme: light) {
33
- :root {
34
- --enigma-toast-bg: #ffffff;
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-enigma-toaster] {
43
- position: fixed;
44
- z-index: 9999;
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
- flex-direction: column;
47
- gap: var(--enigma-toast-gap);
48
- width: min(var(--enigma-toast-width), calc(100vw - var(--enigma-toast-edge) * 2));
49
- /* The region is a layout box, not a wall: clicks pass through the gaps between toasts. */
50
- pointer-events: none;
51
- margin: 0;
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-enigma-toaster][data-position^="top"] { top: var(--enigma-toast-edge); flex-direction: column-reverse; }
56
- [data-enigma-toaster][data-position^="bottom"] { bottom: var(--enigma-toast-edge); }
57
- [data-enigma-toaster][data-position$="-left"] { left: var(--enigma-toast-edge); }
58
- [data-enigma-toaster][data-position$="-right"] { right: var(--enigma-toast-edge); }
59
- [data-enigma-toaster][data-position$="-center"] { left: 50%; transform: translateX(-50%); }
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-enigma-toast] {
62
- pointer-events: auto;
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
- display: grid;
65
- grid-template-columns: 1fr auto;
158
+ justify-content: flex-start;
66
159
  align-items: center;
67
- gap: 0.25rem 0.75rem;
68
- padding: 0.875rem 1rem;
69
- color: var(--enigma-toast-text);
70
- background: var(--enigma-toast-bg);
71
- border: 1px solid var(--enigma-toast-border);
72
- border-radius: var(--enigma-toast-radius);
73
- box-shadow: var(--enigma-toast-shadow);
74
- /* The swipe offset the component publishes. Zero unless a finger is on it. */
75
- translate: var(--enigma-toast-swipe, 0) 0;
76
- transition: translate 180ms cubic-bezier(0.22, 1, 0.36, 1), opacity 180ms ease-out;
77
- touch-action: pan-y;
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-enigma-toaster][data-position$="-center"] [data-enigma-toast] { translate: 0 var(--enigma-toast-swipe, 0); }
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
- /* While a finger is down the toast tracks it exactly: a transition here would lag behind
84
- the pointer, which reads as a broken gesture rather than a smooth one. */
85
- [data-enigma-toast][data-swiping] { transition: none; cursor: grabbing; user-select: none; }
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-enigma-toast]:focus-visible { box-shadow: var(--enigma-toast-shadow), 0 0 0 2px var(--enigma-toast-info); }
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
- /* A left border is the tone. It reads at a glance and survives any background. */
90
- [data-enigma-toast]::before {
91
- content: "";
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
- inset: 0 auto 0 0;
94
- width: 3px;
95
- border-radius: var(--enigma-toast-radius) 0 0 var(--enigma-toast-radius);
96
- background: var(--enigma-toast-tone, transparent);
97
- }
98
-
99
- [data-enigma-toast][data-tone="info"] { --enigma-toast-tone: var(--enigma-toast-info); }
100
- [data-enigma-toast][data-tone="success"] { --enigma-toast-tone: var(--enigma-toast-success); }
101
- [data-enigma-toast][data-tone="warning"] { --enigma-toast-tone: var(--enigma-toast-warning); }
102
- [data-enigma-toast][data-tone="error"] { --enigma-toast-tone: var(--enigma-toast-error); }
103
- [data-enigma-toast][data-tone="loading"] { --enigma-toast-tone: var(--enigma-toast-loading); }
104
-
105
- [data-enigma-toast-title] { grid-column: 1; margin: 0; font-size: 0.875rem; font-weight: 600; line-height: 1.35; }
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
- [data-enigma-toast-close] {
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
- top: 0.375rem;
125
- right: 0.5rem;
126
- padding: 0 0.25rem;
127
- font-size: 0.875rem;
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-enigma-toast]:hover [data-enigma-toast-close],
140
- [data-enigma-toast-close]:focus-visible { opacity: 1; }
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
- /* Enter from the edge it is pinned to, leave the same way. */
143
- @keyframes enigma-toast-in-right { from { opacity: 0; translate: 100% 0; } to { opacity: 1; translate: 0 0; } }
144
- @keyframes enigma-toast-in-left { from { opacity: 0; translate: -100% 0; } to { opacity: 1; translate: 0 0; } }
145
- @keyframes enigma-toast-in-top { from { opacity: 0; translate: 0 -100%; } to { opacity: 1; translate: 0 0; } }
146
- @keyframes enigma-toast-in-bottom { from { opacity: 0; translate: 0 100%; } to { opacity: 1; translate: 0 0; } }
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
- [data-position$="-right"] [data-enigma-toast][data-state="open"] { animation: enigma-toast-in-right 260ms cubic-bezier(0.22, 1, 0.36, 1); }
150
- [data-position$="-left"] [data-enigma-toast][data-state="open"] { animation: enigma-toast-in-left 260ms cubic-bezier(0.22, 1, 0.36, 1); }
151
- [data-position="top-center"] [data-enigma-toast][data-state="open"] { animation: enigma-toast-in-top 260ms cubic-bezier(0.22, 1, 0.36, 1); }
152
- [data-position="bottom-center"] [data-enigma-toast][data-state="open"] { animation: enigma-toast-in-bottom 260ms cubic-bezier(0.22, 1, 0.36, 1); }
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
- /* Matches the component's exitDuration: the node is held for exactly this long, so a
155
- longer animation would be cut off mid-way. */
156
- [data-enigma-toast][data-state="leaving"] {
157
- animation: enigma-toast-out var(--enigma-toast-exit) ease-in forwards;
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
- @media (prefers-reduced-motion: reduce) {
162
- /* The movement goes, the state change stays: a toast still appears and still leaves. */
163
- [data-enigma-toast] { animation: none !important; transition: opacity 120ms ease-out; }
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
+ }