@samline/notify 1.0.2 → 2.0.1

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.
Files changed (85) hide show
  1. package/{LICENSE → LICENSE.md} +2 -2
  2. package/README.md +27 -163
  3. package/dist/_runtime.d.mts +87 -0
  4. package/dist/_runtime.d.ts +87 -0
  5. package/dist/_runtime.js +97 -0
  6. package/dist/_runtime.mjs +83 -0
  7. package/dist/browser/assets-client-B-VVPPYQ.js +114 -0
  8. package/dist/browser/assets-client-CUzxHubR.mjs +108 -0
  9. package/dist/browser/index-client-BBOQyMFk.mjs +173 -0
  10. package/dist/browser/index-client-Czb7hTpD.js +181 -0
  11. package/dist/browser/index.cjs +24716 -0
  12. package/dist/browser/index.d.mts +134 -0
  13. package/dist/browser/index.d.ts +134 -0
  14. package/dist/browser/index.js +24718 -0
  15. package/dist/browser/index.mjs +24707 -0
  16. package/dist/browser/render-client-CjcQoukB.js +981 -0
  17. package/dist/browser/render-client-bGRSTd-L.mjs +974 -0
  18. package/dist/core/index.d.mts +68 -0
  19. package/dist/core/index.d.ts +68 -0
  20. package/dist/core/index.js +1 -0
  21. package/dist/core/index.mjs +1 -0
  22. package/dist/index.d.mts +131 -0
  23. package/dist/index.d.ts +131 -0
  24. package/dist/index.js +24700 -0
  25. package/dist/index.mjs +24693 -0
  26. package/dist/react/index.d.mts +158 -0
  27. package/dist/react/index.d.ts +158 -0
  28. package/dist/react/index.js +1116 -0
  29. package/dist/react/index.mjs +1107 -0
  30. package/dist/styles.css +589 -422
  31. package/dist/svelte/assets-client-B-VVPPYQ.js +114 -0
  32. package/dist/svelte/assets-client-CUzxHubR.mjs +108 -0
  33. package/dist/svelte/index-client-DbXbWMIe.js +177 -0
  34. package/dist/svelte/index-client-Dj_WfPK9.mjs +170 -0
  35. package/dist/svelte/index.d.mts +14 -0
  36. package/dist/svelte/index.d.ts +14 -0
  37. package/dist/svelte/index.js +24722 -0
  38. package/dist/svelte/index.mjs +24713 -0
  39. package/dist/svelte/render-client-CjcQoukB.js +981 -0
  40. package/dist/svelte/render-client-bGRSTd-L.mjs +974 -0
  41. package/dist/vue/assets-client-B-VVPPYQ.js +114 -0
  42. package/dist/vue/assets-client-CUzxHubR.mjs +108 -0
  43. package/dist/vue/index-client-DbXbWMIe.js +177 -0
  44. package/dist/vue/index-client-Dj_WfPK9.mjs +170 -0
  45. package/dist/vue/index.d.mts +50 -0
  46. package/dist/vue/index.d.ts +50 -0
  47. package/dist/vue/index.js +24777 -0
  48. package/dist/vue/index.mjs +24770 -0
  49. package/dist/vue/render-client-CjcQoukB.js +981 -0
  50. package/dist/vue/render-client-bGRSTd-L.mjs +974 -0
  51. package/package.json +141 -95
  52. package/dist/browser-notify.js +0 -68
  53. package/dist/cc-2Yt7NqMX.mjs +0 -21
  54. package/dist/cc-B6peeNak.mjs +0 -33
  55. package/dist/cc-BWuAzFJ6.js +0 -12
  56. package/dist/cc-CaBHsjUt.js +0 -34
  57. package/dist/cc-DGff5sSY.js +0 -21
  58. package/dist/cc-he3fHS3P.mjs +0 -12
  59. package/dist/notify.d.mts +0 -48
  60. package/dist/notify.d.mts.map +0 -1
  61. package/dist/notify.d.ts +0 -48
  62. package/dist/notify.d.ts.map +0 -1
  63. package/dist/notify.js +0 -206
  64. package/dist/notify.mjs +0 -202
  65. package/dist/react-notify-12s--2JK5UjB.mjs +0 -1244
  66. package/dist/react-notify-12s-Kv2M6zlv.js +0 -1247
  67. package/dist/react.d.mts +0 -70
  68. package/dist/react.d.mts.map +0 -1
  69. package/dist/react.d.ts +0 -70
  70. package/dist/react.d.ts.map +0 -1
  71. package/dist/react.js +0 -19
  72. package/dist/react.mjs +0 -10
  73. package/dist/render-notify-toasts.js +0 -213
  74. package/dist/svelte.d.mts +0 -49
  75. package/dist/svelte.d.mts.map +0 -1
  76. package/dist/svelte.d.ts +0 -49
  77. package/dist/svelte.d.ts.map +0 -1
  78. package/dist/svelte.js +0 -284
  79. package/dist/svelte.mjs +0 -280
  80. package/dist/vue.d.mts +0 -107
  81. package/dist/vue.d.mts.map +0 -1
  82. package/dist/vue.d.ts +0 -107
  83. package/dist/vue.d.ts.map +0 -1
  84. package/dist/vue.js +0 -2215
  85. package/dist/vue.mjs +0 -2211
package/dist/styles.css CHANGED
@@ -1,558 +1,725 @@
1
- /* -------------------------------- Variables ------------------------------- */
2
-
3
- :root {
4
- --notify-spring-easing: linear(
5
- 0,
6
- 0.002 0.6%,
7
- 0.007 1.2%,
8
- 0.015 1.8%,
9
- 0.026 2.4%,
10
- 0.041 3.1%,
11
- 0.06 3.8%,
12
- 0.108 5.3%,
13
- 0.157 6.6%,
14
- 0.214 8%,
15
- 0.467 13.7%,
16
- 0.577 16.3%,
17
- 0.631 17.7%,
18
- 0.682 19.1%,
19
- 0.73 20.5%,
20
- 0.771 21.8%,
21
- 0.808 23.1%,
22
- 0.844 24.5%,
23
- 0.874 25.8%,
24
- 0.903 27.2%,
25
- 0.928 28.6%,
26
- 0.952 30.1%,
27
- 0.972 31.6%,
28
- 0.988 33.1%,
29
- 1.01 35.7%,
30
- 1.025 38.5%,
31
- 1.034 41.6%,
32
- 1.038 45%,
33
- 1.035 50.1%,
34
- 1.012 64.2%,
35
- 1.003 73%,
36
- 0.999 83.7%,
37
- 1
38
- );
39
-
40
- --notify-duration: 600ms;
41
- --notify-height: 40px;
42
- --notify-width: 350px;
43
-
44
- --notify-state-success: oklch(0.723 0.219 142.136);
45
- --notify-state-loading: oklch(0.556 0 0);
46
- --notify-state-error: oklch(0.637 0.237 25.331);
47
- --notify-state-warning: oklch(0.795 0.184 86.047);
48
- --notify-state-info: oklch(0.685 0.169 237.323);
49
- --notify-state-action: oklch(0.623 0.214 259.815);
50
- }
51
-
52
- /* ---------------------------------- Toast --------------------------------- */
53
-
54
- [data-notify-toast] {
55
- position: relative;
56
- cursor: pointer;
57
- pointer-events: auto;
58
- touch-action: none;
59
- border: 0;
60
- background: transparent;
61
- padding: 0;
62
- width: var(--notify-width);
63
- height: var(--_h, var(--notify-height));
64
- opacity: 0;
65
- transform: translateZ(0) scale(0.95);
66
- transform-origin: center;
67
- contain: layout style;
68
- overflow: visible;
69
- }
70
-
71
- [data-notify-toast][data-state="loading"] {
72
- cursor: default;
73
- }
74
-
75
- [data-notify-toast][data-ready="true"] {
76
- opacity: 1;
77
- transform: translateZ(0) scale(1);
78
- transition:
79
- transform calc(var(--notify-duration) * 0.66) var(--notify-spring-easing),
80
- opacity calc(var(--notify-duration) * 0.66) var(--notify-spring-easing),
81
- margin-bottom calc(var(--notify-duration) * 0.66) var(--notify-spring-easing),
82
- margin-top calc(var(--notify-duration) * 0.66) var(--notify-spring-easing),
83
- height var(--notify-duration) var(--notify-spring-easing);
84
- }
85
-
86
- /* Entry animation direction */
87
- [data-notify-viewport][data-position^="top"]
88
- [data-notify-toast]:not([data-ready="true"]) {
89
- transform: translateY(-6px) scale(0.95);
90
- }
91
-
92
- [data-notify-viewport][data-position^="bottom"]
93
- [data-notify-toast]:not([data-ready="true"]) {
94
- transform: translateY(6px) scale(0.95);
95
- }
96
-
97
- /* Exit */
98
- [data-notify-toast][data-ready="true"][data-exiting="true"] {
99
- opacity: 0;
100
- pointer-events: none;
101
- }
102
-
103
- [data-notify-viewport][data-position^="top"]
104
- [data-notify-toast][data-ready="true"][data-exiting="true"] {
105
- transform: translateY(-6px) scale(0.95);
106
- }
1
+ html[dir='ltr'],
2
+ [data-notify-toaster][dir='ltr'] {
3
+ --toast-icon-margin-start: -3px;
4
+ --toast-icon-margin-end: 4px;
5
+ --toast-svg-margin-start: -1px;
6
+ --toast-svg-margin-end: 0px;
7
+ --toast-button-margin-start: auto;
8
+ --toast-button-margin-end: 0;
9
+ --toast-close-button-start: 0;
10
+ --toast-close-button-end: unset;
11
+ --toast-close-button-transform: translate(-35%, -35%);
12
+ }
13
+
14
+ html[dir='rtl'],
15
+ [data-notify-toaster][dir='rtl'] {
16
+ --toast-icon-margin-start: 4px;
17
+ --toast-icon-margin-end: -3px;
18
+ --toast-svg-margin-start: 0px;
19
+ --toast-svg-margin-end: -1px;
20
+ --toast-button-margin-start: 0;
21
+ --toast-button-margin-end: auto;
22
+ --toast-close-button-start: unset;
23
+ --toast-close-button-end: 0;
24
+ --toast-close-button-transform: translate(35%, -35%);
25
+ }
26
+
27
+ [data-notify-toaster] {
28
+ position: fixed;
29
+ width: var(--width);
30
+ font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial,
31
+ Noto Sans, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji;
32
+ --gray1: hsl(0, 0%, 99%);
33
+ --gray2: hsl(0, 0%, 97.3%);
34
+ --gray3: hsl(0, 0%, 95.1%);
35
+ --gray4: hsl(0, 0%, 93%);
36
+ --gray5: hsl(0, 0%, 90.9%);
37
+ --gray6: hsl(0, 0%, 88.7%);
38
+ --gray7: hsl(0, 0%, 85.8%);
39
+ --gray8: hsl(0, 0%, 78%);
40
+ --gray9: hsl(0, 0%, 56.1%);
41
+ --gray10: hsl(0, 0%, 52.3%);
42
+ --gray11: hsl(0, 0%, 43.5%);
43
+ --gray12: hsl(0, 0%, 9%);
44
+ --border-radius: 8px;
45
+ box-sizing: border-box;
46
+ padding: 0;
47
+ margin: 0;
48
+ list-style: none;
49
+ outline: none;
50
+ z-index: 999999999;
51
+ transition: transform 400ms ease;
52
+ }
53
+
54
+ @media (hover: none) and (pointer: coarse) {
55
+ [data-notify-toaster][data-lifted='true'] {
56
+ transform: none;
57
+ }
58
+ }
59
+
60
+ [data-notify-toaster][data-x-position='right'] {
61
+ right: var(--offset-right);
62
+ }
63
+
64
+ [data-notify-toaster][data-x-position='left'] {
65
+ left: var(--offset-left);
66
+ }
67
+
68
+ [data-notify-toaster][data-x-position='center'] {
69
+ left: 50%;
70
+ transform: translateX(-50%);
71
+ }
72
+
73
+ [data-notify-toaster][data-y-position='top'] {
74
+ top: var(--offset-top);
75
+ }
107
76
 
108
- [data-notify-viewport][data-position^="bottom"]
109
- [data-notify-toast][data-ready="true"][data-exiting="true"] {
110
- transform: translateY(6px) scale(0.95);
77
+ [data-notify-toaster][data-y-position='bottom'] {
78
+ bottom: var(--offset-bottom);
111
79
  }
112
80
 
113
- /* ------------------------------- SVG Canvas ------------------------------- */
81
+ [data-notify-toast] {
82
+ --y: translateY(100%);
83
+ --lift-amount: calc(var(--lift) * var(--gap));
84
+ z-index: var(--z-index);
85
+ position: absolute;
86
+ opacity: 0;
87
+ transform: var(--y);
88
+ touch-action: none;
89
+ transition: transform 400ms, opacity 400ms, height 400ms, box-shadow 200ms;
90
+ box-sizing: border-box;
91
+ outline: none;
92
+ overflow-wrap: anywhere;
93
+ }
94
+
95
+ [data-notify-toast][data-styled='true'] {
96
+ padding: 16px;
97
+ background: var(--normal-bg);
98
+ border: 1px solid var(--normal-border);
99
+ color: var(--normal-text);
100
+ border-radius: var(--border-radius);
101
+ box-shadow: 0px 4px 12px rgba(0, 0, 0, 0.1);
102
+ width: var(--width);
103
+ font-size: 13px;
104
+ display: flex;
105
+ align-items: center;
106
+ gap: 6px;
107
+ }
114
108
 
115
- [data-notify-canvas] {
116
- position: absolute;
117
- left: 0;
118
- right: 0;
119
- pointer-events: none;
120
- transform: translateZ(0);
121
- contain: layout style;
122
- overflow: visible;
109
+ [data-notify-toast]:focus-visible {
110
+ box-shadow: 0px 4px 12px rgba(0, 0, 0, 0.1), 0 0 0 2px rgba(0, 0, 0, 0.2);
123
111
  }
124
112
 
125
- [data-sileo-canvas][data-edge="top"] {
126
- bottom: 0;
127
- transform: scaleY(-1) translateZ(0);
113
+ [data-notify-toast][data-y-position='top'] {
114
+ top: 0;
115
+ --y: translateY(-100%);
116
+ --lift: 1;
117
+ --lift-amount: calc(1 * var(--gap));
128
118
  }
129
119
 
130
- [data-sileo-canvas][data-edge="bottom"] {
131
- top: 0;
120
+ [data-notify-toast][data-y-position='bottom'] {
121
+ bottom: 0;
122
+ --y: translateY(100%);
123
+ --lift: -1;
124
+ --lift-amount: calc(var(--lift) * var(--gap));
132
125
  }
133
126
 
134
- [data-notify-svg] {
135
- overflow: visible;
127
+ [data-notify-toast][data-styled='true'] [data-description] {
128
+ font-weight: 400;
129
+ line-height: 1.4;
130
+ color: #3f3f3f;
136
131
  }
137
132
 
138
- /* --------------------------------- Shapes --------------------------------- */
133
+ [data-rich-colors='true'][data-notify-toast][data-styled='true'] [data-description] {
134
+ color: inherit;
135
+ }
139
136
 
140
- /* --------------------------------- Header --------------------------------- */
137
+ [data-notify-toaster][data-notify-theme='dark'] [data-description] {
138
+ color: hsl(0, 0%, 91%);
139
+ }
140
+
141
+ [data-notify-toast][data-styled='true'] [data-title] {
142
+ font-weight: 500;
143
+ line-height: 1.5;
144
+ color: inherit;
145
+ }
141
146
 
142
- [data-notify-header] {
143
- position: absolute;
144
- z-index: 20;
145
- display: flex;
146
- align-items: center;
147
- padding: 0.5rem;
148
- height: var(--sileo-height);
149
- overflow: hidden;
150
- left: var(--_px, 0px);
151
- transform: var(--_ht);
152
- max-width: var(--_pw);
147
+ [data-notify-toast][data-styled='true'] [data-icon] {
148
+ display: flex;
149
+ height: 16px;
150
+ width: 16px;
151
+ position: relative;
152
+ justify-content: flex-start;
153
+ align-items: center;
154
+ flex-shrink: 0;
155
+ margin-left: var(--toast-icon-margin-start);
156
+ margin-right: var(--toast-icon-margin-end);
153
157
  }
154
158
 
155
- [data-notify-toast][data-ready="true"] [data-notify-header] {
156
- transition:
157
- transform var(--sileo-duration) var(--sileo-spring-easing),
158
- left var(--sileo-duration) var(--sileo-spring-easing),
159
- max-width var(--sileo-duration) var(--sileo-spring-easing);
159
+ [data-notify-toast][data-promise='true'] [data-icon] > svg {
160
+ opacity: 0;
161
+ transform: scale(0.8);
162
+ transform-origin: center;
163
+ animation: notify-fade-in 300ms ease forwards;
160
164
  }
161
165
 
162
- [data-notify-header][data-edge="top"] {
163
- bottom: 0;
166
+ [data-notify-toast][data-styled='true'] [data-icon] > * {
167
+ flex-shrink: 0;
164
168
  }
165
169
 
166
- [data-notify-header][data-edge="bottom"] {
167
- top: 0;
170
+ [data-notify-toast][data-styled='true'] [data-icon] svg {
171
+ margin-left: var(--toast-svg-margin-start);
172
+ margin-right: var(--toast-svg-margin-end);
168
173
  }
169
174
 
170
- /* Header inner morphing */
171
- [data-notify-header-stack] {
172
- position: relative;
173
- display: inline-flex;
174
- align-items: center;
175
- height: 100%;
175
+ [data-notify-toast][data-styled='true'] [data-content] {
176
+ display: flex;
177
+ flex-direction: column;
178
+ gap: 2px;
176
179
  }
177
180
 
178
- [data-notify-header-inner] {
179
- display: flex;
180
- align-items: center;
181
- gap: 0.5rem;
182
- white-space: nowrap;
183
- opacity: 1;
184
- filter: blur(0px);
185
- transform: translateZ(0);
181
+ [data-notify-toast][data-styled='true'] [data-button] {
182
+ border-radius: 4px;
183
+ padding-left: 8px;
184
+ padding-right: 8px;
185
+ height: 24px;
186
+ font-size: 12px;
187
+ color: var(--normal-bg);
188
+ background: var(--normal-text);
189
+ margin-left: var(--toast-button-margin-start);
190
+ margin-right: var(--toast-button-margin-end);
191
+ border: none;
192
+ font-weight: 500;
193
+ cursor: pointer;
194
+ outline: none;
195
+ display: flex;
196
+ align-items: center;
197
+ flex-shrink: 0;
198
+ transition: opacity 400ms, box-shadow 200ms;
186
199
  }
187
200
 
188
- [data-notify-header-inner][data-layer="current"] {
189
- position: relative;
190
- z-index: 1;
191
- animation: sileo-header-enter var(--sileo-duration) var(--sileo-spring-easing)
192
- both;
201
+ [data-notify-toast][data-styled='true'] [data-button]:focus-visible {
202
+ box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.4);
193
203
  }
194
204
 
195
- [data-notify-header-inner][data-layer="current"]:not(:only-child),
196
- [data-notify-header-inner][data-exiting="true"] {
197
- will-change: opacity, filter;
205
+ [data-notify-toast][data-styled='true'] [data-button]:first-of-type {
206
+ margin-left: var(--toast-button-margin-start);
207
+ margin-right: var(--toast-button-margin-end);
198
208
  }
199
209
 
200
- [data-notify-header-inner][data-layer="prev"] {
201
- position: absolute;
202
- left: 0;
203
- top: 0;
204
- z-index: 0;
205
- pointer-events: none;
210
+ [data-notify-toast][data-styled='true'] [data-cancel] {
211
+ color: var(--normal-text);
212
+ background: rgba(0, 0, 0, 0.08);
206
213
  }
207
214
 
208
- [data-notify-header-inner][data-exiting="true"] {
209
- animation: notify-header-exit calc(var(--notify-duration) * 0.7) ease forwards;
215
+ [data-notify-toaster][data-notify-theme='dark'] [data-notify-toast][data-styled='true'] [data-cancel] {
216
+ background: rgba(255, 255, 255, 0.3);
210
217
  }
211
218
 
212
- /* ---------------------------------- Badge --------------------------------- */
219
+ [data-notify-toast][data-styled='true'] [data-close-button] {
220
+ position: absolute;
221
+ left: var(--toast-close-button-start);
222
+ right: var(--toast-close-button-end);
223
+ top: 0;
224
+ height: 20px;
225
+ width: 20px;
226
+ display: flex;
227
+ justify-content: center;
228
+ align-items: center;
229
+ padding: 0;
230
+ color: var(--normal-text);
231
+ background: var(--normal-bg);
232
+ border: 1px solid var(--normal-border);
233
+ transform: var(--toast-close-button-transform);
234
+ border-radius: 50%;
235
+ cursor: pointer;
236
+ z-index: 1;
237
+ transition: opacity 100ms, background 200ms, border-color 200ms;
238
+ }
213
239
 
214
- [data-notify-badge] {
215
- display: flex;
216
- height: 24px;
217
- width: 24px;
218
- flex-shrink: 0;
219
- align-items: center;
220
- justify-content: center;
221
- padding: 2px;
222
- box-sizing: border-box;
223
- border-radius: 9999px;
224
- color: var(--sileo-tone, currentColor);
225
- background-color: var(--sileo-tone-bg, transparent);
240
+ [data-notify-toast][data-styled='true'] [data-close-button]:focus-visible {
241
+ box-shadow: 0px 4px 12px rgba(0, 0, 0, 0.1), 0 0 0 2px rgba(0, 0, 0, 0.2);
226
242
  }
227
243
 
228
- /* ---------------------------------- Title --------------------------------- */
244
+ [data-notify-toast][data-styled='true'] [data-disabled='true'] {
245
+ cursor: not-allowed;
246
+ }
229
247
 
230
- [data-notify-title] {
231
- font-size: 0.825rem;
232
- line-height: 1rem;
233
- font-weight: 500;
234
- text-transform: capitalize;
235
- color: var(--sileo-tone, currentColor);
248
+ [data-notify-toast][data-styled='true']:hover [data-close-button]:hover {
249
+ background: var(--gray2);
250
+ border-color: var(--gray5);
236
251
  }
237
252
 
238
- /* ------------------------------ State Colors ------------------------------ */
253
+ [data-notify-toast][data-swiping='true']::before {
254
+ content: '';
255
+ position: absolute;
256
+ left: -100%;
257
+ right: -100%;
258
+ height: 100%;
259
+ z-index: -1;
260
+ }
239
261
 
240
- :is([data-notify-badge], [data-notify-title], [data-notify-button])[data-state] {
241
- --_c: var(--notify-state-success);
262
+ [data-notify-toast][data-y-position='top'][data-swiping='true']::before {
263
+ bottom: 50%;
264
+ transform: scaleY(3) translateY(50%);
242
265
  }
243
266
 
244
- :is(
245
- [data-notify-badge],
246
- [data-notify-title],
247
- [data-notify-button]
248
- )[data-state="loading"] {
249
- --_c: var(--notify-state-loading);
267
+ [data-notify-toast][data-y-position='bottom'][data-swiping='true']::before {
268
+ top: 50%;
269
+ transform: scaleY(3) translateY(-50%);
250
270
  }
251
271
 
252
- :is(
253
- [data-notify-badge],
254
- [data-notify-title],
255
- [data-notify-button]
256
- )[data-state="error"] {
257
- --_c: var(--notify-state-error);
272
+ [data-notify-toast][data-swiping='false'][data-removed='true']::before {
273
+ content: '';
274
+ position: absolute;
275
+ inset: 0;
276
+ transform: scaleY(2);
258
277
  }
259
278
 
260
- :is(
261
- [data-notify-badge],
262
- [data-notify-title],
263
- [data-notify-button]
264
- )[data-state="warning"] {
265
- --_c: var(--notify-state-warning);
279
+ [data-notify-toast][data-expanded='true']::after {
280
+ content: '';
281
+ position: absolute;
282
+ left: 0;
283
+ height: calc(var(--gap) + 1px);
284
+ bottom: 100%;
285
+ width: 100%;
266
286
  }
267
287
 
268
- :is(
269
- [data-notify-badge],
270
- [data-notify-title],
271
- [data-notify-button]
272
- )[data-state="info"] {
273
- --_c: var(--notify-state-info);
288
+ [data-notify-toast][data-mounted='true'] {
289
+ --y: translateY(0);
290
+ opacity: 1;
274
291
  }
275
292
 
276
- :is(
277
- [data-notify-badge],
278
- [data-notify-title],
279
- [data-notify-button]
280
- )[data-state="action"] {
281
- --_c: var(--notify-state-action);
293
+ [data-notify-toast][data-expanded='false'][data-front='false'] {
294
+ --scale: var(--toasts-before) * 0.05 + 1;
295
+ --y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));
296
+ height: var(--front-toast-height);
282
297
  }
283
298
 
284
- :is([data-notify-badge], [data-notify-title])[data-state] {
285
- --notify-tone: var(--_c);
286
- --notify-tone-bg: color-mix(in oklch, var(--_c) 20%, transparent);
299
+ [data-notify-toast] > * {
300
+ transition: opacity 400ms;
287
301
  }
288
302
 
289
- /* --------------------------------- Content -------------------------------- */
303
+ [data-notify-toast][data-x-position='right'] {
304
+ right: 0;
305
+ }
290
306
 
291
- [data-notify-content] {
292
- position: absolute;
293
- left: 0;
294
- z-index: 10;
295
- width: 100%;
296
- pointer-events: none;
297
- opacity: var(--_co, 0);
307
+ [data-notify-toast][data-x-position='left'] {
308
+ left: 0;
298
309
  }
299
310
 
300
- [data-notify-content]:not([data-visible="true"]) {
301
- content-visibility: hidden;
311
+ [data-notify-toast][data-expanded='false'][data-front='false'][data-styled='true'] > * {
312
+ opacity: 0;
302
313
  }
303
314
 
304
- [data-notify-toast][data-ready="true"] [data-notify-content] {
305
- transition: opacity calc(var(--notify-duration) * 0.08) ease
306
- calc(var(--notify-duration) * 0.04);
315
+ [data-notify-toast][data-visible='false'] {
316
+ opacity: 0;
317
+ pointer-events: none;
307
318
  }
308
319
 
309
- [data-notify-content][data-edge="top"] {
310
- top: 0;
320
+ [data-notify-toast][data-mounted='true'][data-expanded='true'] {
321
+ --y: translateY(calc(var(--lift) * var(--offset)));
322
+ height: var(--initial-height);
311
323
  }
312
324
 
313
- [data-notify-content][data-edge="bottom"] {
314
- top: var(--sileo-height);
325
+ [data-notify-toast][data-removed='true'][data-front='true'][data-swipe-out='false'] {
326
+ --y: translateY(calc(var(--lift) * -100%));
327
+ opacity: 0;
315
328
  }
316
329
 
317
- [data-notify-content][data-visible="true"] {
318
- pointer-events: auto;
330
+ [data-notify-toast][data-removed='true'][data-front='false'][data-swipe-out='false'][data-expanded='true'] {
331
+ --y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));
332
+ opacity: 0;
319
333
  }
320
334
 
321
- [data-notify-toast][data-ready="true"]
322
- [data-notify-content][data-visible="true"] {
323
- transition: opacity calc(var(--notify-duration) * 0.6) ease
324
- calc(var(--notify-duration) * 0.3);
335
+ [data-notify-toast][data-removed='true'][data-front='false'][data-swipe-out='false'][data-expanded='false'] {
336
+ --y: translateY(40%);
337
+ opacity: 0;
338
+ transition: transform 500ms, opacity 200ms;
325
339
  }
326
340
 
327
- [data-notify-description] {
328
- width: 100%;
329
- text-align: left;
330
- padding: 1rem;
331
- font-size: 0.875rem;
332
- line-height: 1.25rem;
333
- contain: layout style paint;
334
- content-visibility: auto;
341
+ [data-notify-toast][data-removed='true'][data-front='false']::before {
342
+ height: calc(var(--initial-height) + 20%);
335
343
  }
336
344
 
337
- /* --------------------------------- Button --------------------------------- */
345
+ [data-notify-toast][data-swiping='true'] {
346
+ transform: var(--y) translateY(var(--swipe-amount-y, 0px)) translateX(var(--swipe-amount-x, 0px));
347
+ transition: none;
348
+ }
338
349
 
339
- [data-notify-button] {
340
- display: flex;
341
- align-items: center;
342
- justify-content: center;
343
- height: 1.75rem;
344
- padding: 0 0.625rem;
345
- margin-top: 0.75rem;
346
- border-radius: 9999px;
347
- border: 0;
348
- font-size: 0.75rem;
349
- font-weight: 500;
350
- cursor: pointer;
351
- color: var(--sileo-btn-color, currentColor);
352
- background-color: var(--sileo-btn-bg, transparent);
353
- transition: background-color 150ms ease;
350
+ [data-notify-toast][data-swiped='true'] {
351
+ -webkit-user-select: none; /* Safari 3+ */
352
+ user-select: none;
354
353
  }
355
354
 
356
- [data-notify-button]:hover {
357
- background-color: var(--sileo-btn-bg-hover, transparent);
355
+ [data-notify-toast][data-swipe-out='true'][data-y-position='bottom'],
356
+ [data-notify-toast][data-swipe-out='true'][data-y-position='top'] {
357
+ animation-duration: 200ms;
358
+ animation-timing-function: ease-out;
359
+ animation-fill-mode: forwards;
358
360
  }
359
361
 
360
- [data-notify-button][data-state] {
361
- --notify-btn-color: var(--_c);
362
- --notify-btn-bg: color-mix(in oklch, var(--_c) 15%, transparent);
363
- --notify-btn-bg-hover: color-mix(in oklch, var(--_c) 25%, transparent);
362
+ [data-notify-toast][data-swipe-out='true'][data-swipe-direction='left'] {
363
+ animation-name: swipe-out-left;
364
364
  }
365
365
 
366
- /* -------------------------------- Animations ------------------------------ */
366
+ [data-notify-toast][data-swipe-out='true'][data-swipe-direction='right'] {
367
+ animation-name: swipe-out-right;
368
+ }
367
369
 
368
- [data-notify-icon="spin"] {
369
- animation: notify-spin 1s linear infinite;
370
+ [data-notify-toast][data-swipe-out='true'][data-swipe-direction='up'] {
371
+ animation-name: swipe-out-up;
370
372
  }
371
373
 
372
- @keyframes notify-spin {
373
- to {
374
- transform: rotate(360deg);
375
- }
374
+ [data-notify-toast][data-swipe-out='true'][data-swipe-direction='down'] {
375
+ animation-name: swipe-out-down;
376
+ }
377
+
378
+ @keyframes swipe-out-left {
379
+ from {
380
+ transform: var(--y) translateX(var(--swipe-amount-x));
381
+ opacity: 1;
382
+ }
383
+
384
+ to {
385
+ transform: var(--y) translateX(calc(var(--swipe-amount-x) - 100%));
386
+ opacity: 0;
387
+ }
388
+ }
389
+
390
+ @keyframes swipe-out-right {
391
+ from {
392
+ transform: var(--y) translateX(var(--swipe-amount-x));
393
+ opacity: 1;
394
+ }
395
+
396
+ to {
397
+ transform: var(--y) translateX(calc(var(--swipe-amount-x) + 100%));
398
+ opacity: 0;
399
+ }
400
+ }
401
+
402
+ @keyframes swipe-out-up {
403
+ from {
404
+ transform: var(--y) translateY(var(--swipe-amount-y));
405
+ opacity: 1;
406
+ }
407
+
408
+ to {
409
+ transform: var(--y) translateY(calc(var(--swipe-amount-y) - 100%));
410
+ opacity: 0;
411
+ }
412
+ }
413
+
414
+ @keyframes swipe-out-down {
415
+ from {
416
+ transform: var(--y) translateY(var(--swipe-amount-y));
417
+ opacity: 1;
418
+ }
419
+
420
+ to {
421
+ transform: var(--y) translateY(calc(var(--swipe-amount-y) + 100%));
422
+ opacity: 0;
423
+ }
424
+ }
425
+
426
+ @media (max-width: 600px) {
427
+ [data-notify-toaster] {
428
+ position: fixed;
429
+ right: var(--mobile-offset-right);
430
+ left: var(--mobile-offset-left);
431
+ width: 100%;
432
+ }
433
+
434
+ [data-notify-toaster][dir='rtl'] {
435
+ left: calc(var(--mobile-offset-left) * -1);
436
+ }
437
+
438
+ [data-notify-toaster] [data-notify-toast] {
439
+ left: 0;
440
+ right: 0;
441
+ width: calc(100% - var(--mobile-offset-left) * 2);
442
+ }
443
+
444
+ [data-notify-toaster][data-x-position='left'] {
445
+ left: var(--mobile-offset-left);
446
+ }
447
+
448
+ [data-notify-toaster][data-y-position='bottom'] {
449
+ bottom: var(--mobile-offset-bottom);
450
+ }
451
+
452
+ [data-notify-toaster][data-y-position='top'] {
453
+ top: var(--mobile-offset-top);
454
+ }
455
+
456
+ [data-notify-toaster][data-x-position='center'] {
457
+ left: var(--mobile-offset-left);
458
+ right: var(--mobile-offset-right);
459
+ transform: none;
460
+ }
461
+ }
462
+
463
+ [data-notify-toaster][data-notify-theme='light'] {
464
+ --normal-bg: #fff;
465
+ --normal-border: var(--gray4);
466
+ --normal-text: var(--gray12);
467
+
468
+ --success-bg: hsl(143, 85%, 96%);
469
+ --success-border: hsl(145, 92%, 87%);
470
+ --success-text: hsl(140, 100%, 27%);
471
+
472
+ --info-bg: hsl(208, 100%, 97%);
473
+ --info-border: hsl(221, 91%, 93%);
474
+ --info-text: hsl(210, 92%, 45%);
475
+
476
+ --warning-bg: hsl(49, 100%, 97%);
477
+ --warning-border: hsl(49, 91%, 84%);
478
+ --warning-text: hsl(31, 92%, 45%);
479
+
480
+ --error-bg: hsl(359, 100%, 97%);
481
+ --error-border: hsl(359, 100%, 94%);
482
+ --error-text: hsl(360, 100%, 45%);
483
+ }
484
+
485
+ [data-notify-toaster][data-notify-theme='light'] [data-notify-toast][data-invert='true'] {
486
+ --normal-bg: #000;
487
+ --normal-border: hsl(0, 0%, 20%);
488
+ --normal-text: var(--gray1);
376
489
  }
377
490
 
378
- @keyframes notify-header-enter {
379
- from {
380
- opacity: 0;
381
- filter: blur(6px);
382
- }
383
- to {
384
- opacity: 1;
385
- filter: blur(0px);
386
- }
491
+ [data-notify-toaster][data-notify-theme='dark'] [data-notify-toast][data-invert='true'] {
492
+ --normal-bg: #fff;
493
+ --normal-border: var(--gray3);
494
+ --normal-text: var(--gray12);
387
495
  }
388
496
 
389
- @keyframes notify-header-exit {
390
- from {
391
- opacity: 1;
392
- filter: blur(0px);
393
- }
394
- to {
395
- opacity: 0;
396
- filter: blur(6px);
397
- }
497
+ [data-notify-toaster][data-notify-theme='dark'] {
498
+ --normal-bg: #000;
499
+ --normal-bg-hover: hsl(0, 0%, 12%);
500
+ --normal-border: hsl(0, 0%, 20%);
501
+ --normal-border-hover: hsl(0, 0%, 25%);
502
+ --normal-text: var(--gray1);
503
+
504
+ --success-bg: hsl(150, 100%, 6%);
505
+ --success-border: hsl(147, 100%, 12%);
506
+ --success-text: hsl(150, 86%, 65%);
507
+
508
+ --info-bg: hsl(215, 100%, 6%);
509
+ --info-border: hsl(223, 43%, 17%);
510
+ --info-text: hsl(216, 87%, 65%);
511
+
512
+ --warning-bg: hsl(64, 100%, 6%);
513
+ --warning-border: hsl(60, 100%, 9%);
514
+ --warning-text: hsl(46, 87%, 65%);
515
+
516
+ --error-bg: hsl(358, 76%, 10%);
517
+ --error-border: hsl(357, 89%, 16%);
518
+ --error-text: hsl(358, 100%, 81%);
519
+ }
520
+
521
+ [data-notify-toaster][data-notify-theme='dark'] [data-notify-toast] [data-close-button] {
522
+ background: var(--normal-bg);
523
+ border-color: var(--normal-border);
524
+ color: var(--normal-text);
525
+ }
526
+
527
+ [data-notify-toaster][data-notify-theme='dark'] [data-notify-toast] [data-close-button]:hover {
528
+ background: var(--normal-bg-hover);
529
+ border-color: var(--normal-border-hover);
398
530
  }
399
531
 
400
- /* -------------------------------- Viewports ------------------------------- */
532
+ [data-rich-colors='true'][data-notify-toast][data-type='success'] {
533
+ background: var(--success-bg);
534
+ border-color: var(--success-border);
535
+ color: var(--success-text);
536
+ }
401
537
 
402
- [data-notify-viewport] {
403
- position: fixed;
404
- z-index: 50;
405
- display: flex;
406
- gap: 0.75rem;
407
- padding: 0.75rem;
408
- pointer-events: none;
409
- max-width: calc(100vw - 1.5rem);
410
- contain: layout style;
538
+ [data-rich-colors='true'][data-notify-toast][data-type='success'] [data-close-button] {
539
+ background: var(--success-bg);
540
+ border-color: var(--success-border);
541
+ color: var(--success-text);
411
542
  }
412
543
 
413
- [data-notify-viewport][data-position^="top"]
414
- [data-notify-toast]:not([data-ready="true"]) {
415
- margin-bottom: calc(-1 * (var(--notify-height) + 0.75rem));
544
+ [data-rich-colors='true'][data-notify-toast][data-type='info'] {
545
+ background: var(--info-bg);
546
+ border-color: var(--info-border);
547
+ color: var(--info-text);
416
548
  }
417
549
 
418
- [data-notify-viewport][data-position^="bottom"]
419
- [data-notify-toast]:not([data-ready="true"]) {
420
- margin-top: calc(-1 * (var(--notify-height) + 0.75rem));
550
+ [data-rich-colors='true'][data-notify-toast][data-type='info'] [data-close-button] {
551
+ background: var(--info-bg);
552
+ border-color: var(--info-border);
553
+ color: var(--info-text);
421
554
  }
422
555
 
423
- /* Vertical edge */
424
- [data-notify-viewport][data-position^="top"] {
425
- top: 0;
426
- flex-direction: column-reverse;
556
+ [data-rich-colors='true'][data-notify-toast][data-type='warning'] {
557
+ background: var(--warning-bg);
558
+ border-color: var(--warning-border);
559
+ color: var(--warning-text);
427
560
  }
428
561
 
429
- [data-notify-viewport][data-position^="bottom"] {
430
- bottom: 0;
431
- flex-direction: column;
562
+ [data-rich-colors='true'][data-notify-toast][data-type='warning'] [data-close-button] {
563
+ background: var(--warning-bg);
564
+ border-color: var(--warning-border);
565
+ color: var(--warning-text);
432
566
  }
433
567
 
434
- /* Horizontal alignment */
435
- [data-notify-viewport][data-position$="left"] {
436
- left: 0;
437
- align-items: flex-start;
568
+ [data-rich-colors='true'][data-notify-toast][data-type='error'] {
569
+ background: var(--error-bg);
570
+ border-color: var(--error-border);
571
+ color: var(--error-text);
438
572
  }
439
573
 
440
- [data-notify-viewport][data-position$="right"] {
441
- right: 0;
442
- align-items: flex-end;
574
+ [data-rich-colors='true'][data-notify-toast][data-type='error'] [data-close-button] {
575
+ background: var(--error-bg);
576
+ border-color: var(--error-border);
577
+ color: var(--error-text);
443
578
  }
444
579
 
445
- [data-notify-viewport][data-position$="center"] {
446
- left: 50%;
447
- transform: translateX(-50%);
448
- align-items: center;
580
+ .notify-loading-wrapper {
581
+ --size: 16px;
582
+ height: var(--size);
583
+ width: var(--size);
584
+ position: absolute;
585
+ inset: 0;
586
+ z-index: 10;
449
587
  }
450
588
 
451
- @media (prefers-reduced-motion: no-preference) {
452
- [data-notify-toast][data-ready="true"]:hover,
453
- [data-notify-toast][data-ready="true"][data-exiting="true"] {
454
- will-change: transform, opacity, height;
455
- }
589
+ .notify-loading-wrapper[data-visible='false'] {
590
+ transform-origin: center;
591
+ animation: notify-fade-out 0.2s ease forwards;
456
592
  }
457
593
 
458
- @media (prefers-reduced-motion: reduce) {
459
- [data-notify-viewport],
460
- [data-notify-viewport] *,
461
- [data-notify-viewport] *::before,
462
- [data-notify-viewport] *::after {
463
- animation-duration: 0.01ms;
464
- animation-iteration-count: 1;
465
- transition-duration: 0.01ms;
466
- }
594
+ .notify-spinner {
595
+ position: relative;
596
+ top: 50%;
597
+ left: 50%;
598
+ height: var(--size);
599
+ width: var(--size);
467
600
  }
468
601
 
469
- /* --------------------------------- Themes -------------------------------- */
602
+ .notify-loading-bar {
603
+ animation: notify-spin 1.2s linear infinite;
604
+ background: var(--gray11);
605
+ border-radius: 6px;
606
+ height: 8%;
607
+ left: -10%;
608
+ position: absolute;
609
+ top: -3.9%;
610
+ width: 24%;
611
+ }
470
612
 
471
- [data-notify-viewport][data-theme="dark"] [data-notify-description] {
472
- color: rgba(0, 0, 0, 0.5);
613
+ .notify-loading-bar:nth-child(1) {
614
+ animation-delay: -1.2s;
615
+ transform: rotate(0.0001deg) translate(146%);
473
616
  }
474
617
 
475
- [data-notify-viewport][data-theme="light"] [data-notify-description] {
476
- color: rgba(255, 255, 255, 0.5);
618
+ .notify-loading-bar:nth-child(2) {
619
+ animation-delay: -1.1s;
620
+ transform: rotate(30deg) translate(146%);
477
621
  }
478
622
 
479
- /* -------- Browser / CDN card renderer (render-notify-toasts.js) ---------- */
480
- /*
481
- * When a [data-notify-card] is present (VanillaJS renderer), we override the
482
- * SVG-based layout from the React component and use a plain HTML card instead.
483
- */
623
+ .notify-loading-bar:nth-child(3) {
624
+ animation-delay: -1s;
625
+ transform: rotate(60deg) translate(146%);
626
+ }
484
627
 
485
- [data-notify-toast]:has([data-notify-card]) {
486
- width: auto;
487
- height: auto;
488
- background: transparent;
628
+ .notify-loading-bar:nth-child(4) {
629
+ animation-delay: -0.9s;
630
+ transform: rotate(90deg) translate(146%);
489
631
  }
490
632
 
491
- [data-notify-card] {
492
- background: #ffffff;
493
- border-radius: 20px;
494
- box-shadow:
495
- 0 4px 24px rgba(0, 0, 0, 0.1),
496
- 0 1px 4px rgba(0, 0, 0, 0.06);
497
- width: var(--notify-width);
498
- overflow: hidden;
633
+ .notify-loading-bar:nth-child(5) {
634
+ animation-delay: -0.8s;
635
+ transform: rotate(120deg) translate(146%);
499
636
  }
500
637
 
501
- /* Header row: icon badge + title */
502
- [data-notify-card] [data-notify-header] {
503
- position: relative;
504
- display: flex;
505
- align-items: center;
506
- gap: 0.5rem;
507
- padding: 0.5rem 0.75rem;
508
- height: auto;
509
- left: auto;
510
- max-width: none;
511
- transform: none;
512
- overflow: visible;
638
+ .notify-loading-bar:nth-child(6) {
639
+ animation-delay: -0.7s;
640
+ transform: rotate(150deg) translate(146%);
513
641
  }
514
642
 
515
- /* Content area: description + optional button */
516
- [data-notify-card] [data-notify-content] {
517
- position: relative;
518
- opacity: 1;
519
- pointer-events: auto;
520
- content-visibility: visible;
521
- border-top: 1px solid rgba(0, 0, 0, 0.06);
643
+ .notify-loading-bar:nth-child(7) {
644
+ animation-delay: -0.6s;
645
+ transform: rotate(180deg) translate(146%);
522
646
  }
523
647
 
524
- /* State colors for the badge icon and title inside the card */
525
- [data-notify-card]
526
- :is([data-notify-badge], [data-notify-title])[data-state] {
527
- color: var(--notify-state-success);
648
+ .notify-loading-bar:nth-child(8) {
649
+ animation-delay: -0.5s;
650
+ transform: rotate(210deg) translate(146%);
528
651
  }
529
652
 
530
- [data-notify-card]
531
- :is([data-notify-badge], [data-notify-title])[data-state="error"] {
532
- color: var(--notify-state-error);
653
+ .notify-loading-bar:nth-child(9) {
654
+ animation-delay: -0.4s;
655
+ transform: rotate(240deg) translate(146%);
533
656
  }
534
657
 
535
- [data-notify-card]
536
- :is([data-notify-badge], [data-notify-title])[data-state="warning"] {
537
- color: var(--notify-state-warning);
658
+ .notify-loading-bar:nth-child(10) {
659
+ animation-delay: -0.3s;
660
+ transform: rotate(270deg) translate(146%);
538
661
  }
539
662
 
540
- [data-notify-card]
541
- :is([data-notify-badge], [data-notify-title])[data-state="info"] {
542
- color: var(--notify-state-info);
663
+ .notify-loading-bar:nth-child(11) {
664
+ animation-delay: -0.2s;
665
+ transform: rotate(300deg) translate(146%);
543
666
  }
544
667
 
545
- [data-notify-card]
546
- :is([data-notify-badge], [data-notify-title])[data-state="loading"] {
547
- color: var(--notify-state-loading);
668
+ .notify-loading-bar:nth-child(12) {
669
+ animation-delay: -0.1s;
670
+ transform: rotate(330deg) translate(146%);
548
671
  }
549
672
 
550
- [data-notify-card]
551
- :is([data-notify-badge], [data-notify-title])[data-state="action"] {
552
- color: var(--notify-state-action);
673
+ @keyframes notify-fade-in {
674
+ 0% {
675
+ opacity: 0;
676
+ transform: scale(0.8);
677
+ }
678
+ 100% {
679
+ opacity: 1;
680
+ transform: scale(1);
681
+ }
553
682
  }
554
683
 
555
- /* Description text */
556
- [data-notify-card] [data-notify-description] {
557
- color: rgba(0, 0, 0, 0.6);
684
+ @keyframes notify-fade-out {
685
+ 0% {
686
+ opacity: 1;
687
+ transform: scale(1);
688
+ }
689
+ 100% {
690
+ opacity: 0;
691
+ transform: scale(0.8);
692
+ }
693
+ }
694
+
695
+ @keyframes notify-spin {
696
+ 0% {
697
+ opacity: 1;
698
+ }
699
+ 100% {
700
+ opacity: 0.15;
701
+ }
702
+ }
703
+
704
+ @media (prefers-reduced-motion) {
705
+ [data-notify-toast],
706
+ [data-notify-toast] > *,
707
+ .notify-loading-bar {
708
+ transition: none !important;
709
+ animation: none !important;
710
+ }
711
+ }
712
+
713
+ .notify-loader {
714
+ position: absolute;
715
+ top: 50%;
716
+ left: 50%;
717
+ transform: translate(-50%, -50%);
718
+ transform-origin: center;
719
+ transition: opacity 200ms, transform 200ms;
720
+ }
721
+
722
+ .notify-loader[data-visible='false'] {
723
+ opacity: 0;
724
+ transform: scale(0.8) translate(-50%, -50%);
558
725
  }