svelora 3.0.15 → 3.0.16
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/components/ConfirmDialog/ConfirmDialog.svelte +167 -0
- package/dist/components/ConfirmDialog/ConfirmDialog.svelte.d.ts +10 -0
- package/dist/components/ConfirmDialog/confirm.d.ts +9 -0
- package/dist/components/ConfirmDialog/confirm.js +24 -0
- package/dist/components/ConfirmDialog/confirm.types.d.ts +22 -0
- package/dist/components/ConfirmDialog/confirm.types.js +1 -0
- package/dist/components/ConfirmDialog/index.d.ts +4 -0
- package/dist/components/ConfirmDialog/index.js +2 -0
- package/dist/components/SortableList/SortableList.svelte +54 -0
- package/dist/components/SortableList/SortableList.svelte.d.ts +26 -0
- package/dist/components/SortableList/index.d.ts +2 -0
- package/dist/components/SortableList/index.js +1 -0
- package/dist/components/SortableList/sortable-list.types.d.ts +17 -0
- package/dist/components/SortableList/sortable-list.types.js +1 -0
- package/dist/components/Toast/Toaster.svelte +194 -137
- package/dist/components/Toast/index.d.ts +2 -0
- package/dist/components/Toast/index.js +1 -0
- package/dist/components/Toast/internal/AnimatedIcon.svelte +446 -0
- package/dist/components/Toast/internal/AnimatedIcon.svelte.d.ts +15 -0
- package/dist/components/Toast/internal/animated-icon.types.d.ts +1 -0
- package/dist/components/Toast/internal/animated-icon.types.js +1 -0
- package/dist/components/Toast/internal/french-toast/LICENSE.md +21 -0
- package/dist/components/Toast/internal/french-toast/components/CheckmarkIcon.svelte +64 -0
- package/dist/components/Toast/internal/french-toast/components/CheckmarkIcon.svelte.d.ts +8 -0
- package/dist/components/Toast/internal/french-toast/components/ErrorIcon.svelte +74 -0
- package/dist/components/Toast/internal/french-toast/components/ErrorIcon.svelte.d.ts +8 -0
- package/dist/components/Toast/internal/french-toast/components/LoaderIcon.svelte +28 -0
- package/dist/components/Toast/internal/french-toast/components/LoaderIcon.svelte.d.ts +8 -0
- package/dist/components/Toast/internal/french-toast/components/ToastBar.svelte +169 -0
- package/dist/components/Toast/internal/french-toast/components/ToastBar.svelte.d.ts +20 -0
- package/dist/components/Toast/internal/french-toast/components/ToastIcon.svelte +81 -0
- package/dist/components/Toast/internal/french-toast/components/ToastIcon.svelte.d.ts +7 -0
- package/dist/components/Toast/internal/french-toast/components/ToastMessage.svelte +13 -0
- package/dist/components/Toast/internal/french-toast/components/ToastMessage.svelte.d.ts +8 -0
- package/dist/components/Toast/internal/french-toast/components/ToastWrapper.svelte +57 -0
- package/dist/components/Toast/internal/french-toast/components/ToastWrapper.svelte.d.ts +12 -0
- package/dist/components/Toast/internal/french-toast/components/Toaster.svelte +73 -0
- package/dist/components/Toast/internal/french-toast/components/Toaster.svelte.d.ts +23 -0
- package/dist/components/Toast/internal/french-toast/core/store.svelte.d.ts +15 -0
- package/dist/components/Toast/internal/french-toast/core/store.svelte.js +92 -0
- package/dist/components/Toast/internal/french-toast/core/toast.d.ts +21 -0
- package/dist/components/Toast/internal/french-toast/core/toast.js +67 -0
- package/dist/components/Toast/internal/french-toast/core/types.d.ts +58 -0
- package/dist/components/Toast/internal/french-toast/core/types.js +4 -0
- package/dist/components/Toast/internal/french-toast/core/use-toaster.svelte.d.ts +16 -0
- package/dist/components/Toast/internal/french-toast/core/use-toaster.svelte.js +71 -0
- package/dist/components/Toast/internal/french-toast/core/utils.d.ts +6 -0
- package/dist/components/Toast/internal/french-toast/core/utils.js +25 -0
- package/dist/components/Toast/internal/french-toast/toast-context.d.ts +18 -0
- package/dist/components/Toast/internal/french-toast/toast-context.js +10 -0
- package/dist/components/Toast/internal/notify.d.ts +31 -0
- package/dist/components/Toast/internal/notify.js +100 -0
- package/dist/components/Toast/internal/toast-icons/ToastError.svelte +8 -0
- package/dist/components/Toast/internal/toast-icons/ToastError.svelte.d.ts +4 -0
- package/dist/components/Toast/internal/toast-icons/ToastInfo.svelte +8 -0
- package/dist/components/Toast/internal/toast-icons/ToastInfo.svelte.d.ts +4 -0
- package/dist/components/Toast/internal/toast-icons/ToastLoading.svelte +8 -0
- package/dist/components/Toast/internal/toast-icons/ToastLoading.svelte.d.ts +4 -0
- package/dist/components/Toast/internal/toast-icons/ToastProcessing.svelte +8 -0
- package/dist/components/Toast/internal/toast-icons/ToastProcessing.svelte.d.ts +4 -0
- package/dist/components/Toast/internal/toast-icons/ToastSuccess.svelte +8 -0
- package/dist/components/Toast/internal/toast-icons/ToastSuccess.svelte.d.ts +4 -0
- package/dist/components/Toast/internal/toast-icons/ToastWarning.svelte +8 -0
- package/dist/components/Toast/internal/toast-icons/ToastWarning.svelte.d.ts +4 -0
- package/dist/components/Toast/internal/toast-icons/index.d.ts +6 -0
- package/dist/components/Toast/internal/toast-icons/index.js +6 -0
- package/dist/components/Toast/internal/toast-icons/toast-icon.types.d.ts +4 -0
- package/dist/components/Toast/internal/toast-icons/toast-icon.types.js +1 -0
- package/dist/components/Toast/toast.d.ts +31 -16
- package/dist/components/Toast/toast.js +45 -20
- package/dist/components/Toast/toast.types.d.ts +20 -7
- package/dist/hooks/index.d.ts +2 -0
- package/dist/hooks/index.js +2 -0
- package/dist/hooks/internal/DragDropProviderScope.svelte +29 -0
- package/dist/hooks/internal/DragDropProviderScope.svelte.d.ts +7 -0
- package/dist/hooks/internal/SortableProvider.svelte +30 -0
- package/dist/hooks/internal/SortableProvider.svelte.d.ts +7 -0
- package/dist/hooks/internal/drag-drop-context.d.ts +12 -0
- package/dist/hooks/internal/drag-drop-context.js +1 -0
- package/dist/hooks/internal/sortable-context.d.ts +12 -0
- package/dist/hooks/internal/sortable-context.js +1 -0
- package/dist/hooks/useDragDrop/index.d.ts +1 -0
- package/dist/hooks/useDragDrop/index.js +1 -0
- package/dist/hooks/useDragDrop/useDragDrop.svelte.d.ts +40 -0
- package/dist/hooks/useDragDrop/useDragDrop.svelte.js +128 -0
- package/dist/hooks/useSortable/index.d.ts +2 -0
- package/dist/hooks/useSortable/index.js +2 -0
- package/dist/hooks/useSortable/sortable-utils.d.ts +1 -0
- package/dist/hooks/useSortable/sortable-utils.js +13 -0
- package/dist/hooks/useSortable/useSortable.svelte.d.ts +52 -0
- package/dist/hooks/useSortable/useSortable.svelte.js +120 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/mcp/svelora-docs.data.json +13 -5
- package/package.json +5 -3
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
export { default as Toaster } from './Toaster.svelte';
|
|
2
2
|
export type { ToastOptions } from './toast.js';
|
|
3
3
|
export { toast } from './toast.js';
|
|
4
|
+
export { notify } from './internal/notify.js';
|
|
5
|
+
export type { NotifyOptions, NotifyPromiseOptions } from './internal/notify.js';
|
|
4
6
|
export type { ToasterProps } from './toast.types.js';
|
|
@@ -0,0 +1,446 @@
|
|
|
1
|
+
<script lang="ts">import { elasticOut } from "svelte/easing";
|
|
2
|
+
import { scale } from "svelte/transition";
|
|
3
|
+
const LABELS = {
|
|
4
|
+
success: "Success icon",
|
|
5
|
+
error: "Error icon",
|
|
6
|
+
warning: "Warning icon",
|
|
7
|
+
info: "Info icon",
|
|
8
|
+
question: "Question icon",
|
|
9
|
+
loading: "Loading icon",
|
|
10
|
+
processing: "Processing icon"
|
|
11
|
+
};
|
|
12
|
+
const STANDARD_RING_CLASS = {
|
|
13
|
+
success: "border-success/40",
|
|
14
|
+
error: "border-error/40",
|
|
15
|
+
warning: "border-warning/40",
|
|
16
|
+
info: "border-info/40",
|
|
17
|
+
question: "border-info/40"
|
|
18
|
+
};
|
|
19
|
+
const STANDARD_RING_DURATION = {
|
|
20
|
+
success: 500,
|
|
21
|
+
error: 500,
|
|
22
|
+
warning: 600,
|
|
23
|
+
info: 500,
|
|
24
|
+
question: 500
|
|
25
|
+
};
|
|
26
|
+
let { type = "success", size = 80, class: className = "", forceMotion = false, idle = true, tone = "standard" } = $props();
|
|
27
|
+
const reducedMotionQuery = typeof window === "undefined" ? null : window.matchMedia("(prefers-reduced-motion: reduce)");
|
|
28
|
+
let prefersReducedMotion = $state(reducedMotionQuery?.matches ?? false);
|
|
29
|
+
const motionDisabled = $derived(!forceMotion && prefersReducedMotion);
|
|
30
|
+
const label = $derived(LABELS[type]);
|
|
31
|
+
const sizeValue = $derived(typeof size === "number" ? `${size}px` : size);
|
|
32
|
+
const showStandardRing = $derived(type === "success" || type === "error" || type === "warning" || type === "info" || type === "question");
|
|
33
|
+
const SEMANTIC_TEXT = {
|
|
34
|
+
success: "text-success",
|
|
35
|
+
error: "text-error",
|
|
36
|
+
warning: "text-warning",
|
|
37
|
+
info: "text-info",
|
|
38
|
+
question: "text-info",
|
|
39
|
+
loading: "text-primary",
|
|
40
|
+
processing: "text-secondary"
|
|
41
|
+
};
|
|
42
|
+
const onColor = $derived(tone === "on-color");
|
|
43
|
+
const semanticText = $derived(onColor ? "text-current" : SEMANTIC_TEXT[type]);
|
|
44
|
+
const standardRingClass = $derived(onColor ? "border-current/30" : STANDARD_RING_CLASS[type] ?? "");
|
|
45
|
+
const successPopClass = $derived(onColor ? "bg-current/15" : "bg-success/10");
|
|
46
|
+
const successRingClass = $derived(onColor ? "border-current/35" : "border-success/40");
|
|
47
|
+
const loadingTrackClass = $derived(onColor ? "border-current/25" : "border-primary/20");
|
|
48
|
+
const loadingSpinnerClass = $derived(onColor ? "border-current border-t-transparent" : "border-primary border-t-transparent");
|
|
49
|
+
const loadingDotClass = $derived(onColor ? "text-current/50" : "text-primary/40");
|
|
50
|
+
const processingTrackClass = $derived(onColor ? "border-current/25" : "border-secondary/20");
|
|
51
|
+
const processingIconClass = $derived(onColor ? "text-current" : "text-secondary");
|
|
52
|
+
const standardRingDuration = $derived(STANDARD_RING_DURATION[type] ?? 500);
|
|
53
|
+
const standardRingTransition = $derived({
|
|
54
|
+
duration: motionDisabled ? 0 : standardRingDuration,
|
|
55
|
+
easing: elasticOut
|
|
56
|
+
});
|
|
57
|
+
$effect(() => {
|
|
58
|
+
if (!reducedMotionQuery) {
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
const handleChange = (event) => {
|
|
62
|
+
prefersReducedMotion = event.matches;
|
|
63
|
+
};
|
|
64
|
+
prefersReducedMotion = reducedMotionQuery.matches;
|
|
65
|
+
reducedMotionQuery.addEventListener("change", handleChange);
|
|
66
|
+
return () => {
|
|
67
|
+
reducedMotionQuery.removeEventListener("change", handleChange);
|
|
68
|
+
};
|
|
69
|
+
});
|
|
70
|
+
</script>
|
|
71
|
+
<!-- Main Container -->
|
|
72
|
+
<div
|
|
73
|
+
class={`animated-icon-root relative flex items-center justify-center p-1 ${className} ${forceMotion ? 'force-motion' : ''} ${motionDisabled ? '' : idle ? 'animate-swal-motion' : 'animate-swal-enter'}`}
|
|
74
|
+
style={`width: ${sizeValue}; height: ${sizeValue};`}
|
|
75
|
+
role="img"
|
|
76
|
+
aria-label={label}
|
|
77
|
+
>
|
|
78
|
+
{#if showStandardRing}
|
|
79
|
+
<div
|
|
80
|
+
class={`absolute inset-0 rounded-full border-4 animate-pulse-soft ${standardRingClass}`}
|
|
81
|
+
aria-hidden="true"
|
|
82
|
+
in:scale={standardRingTransition}
|
|
83
|
+
></div>
|
|
84
|
+
{/if}
|
|
85
|
+
|
|
86
|
+
{#if type === "success"}
|
|
87
|
+
<div class={`success-pop absolute inset-0 rounded-full ${successPopClass}`} aria-hidden="true"></div>
|
|
88
|
+
<div
|
|
89
|
+
class={`ring-burst absolute inset-0 rounded-full border-2 ${successRingClass}`}
|
|
90
|
+
aria-hidden="true"
|
|
91
|
+
></div>
|
|
92
|
+
<svg
|
|
93
|
+
viewBox="0 0 52 52"
|
|
94
|
+
class={`relative z-10 size-full ${semanticText}`}
|
|
95
|
+
fill="none"
|
|
96
|
+
stroke="currentColor"
|
|
97
|
+
stroke-width="4"
|
|
98
|
+
stroke-linecap="round"
|
|
99
|
+
stroke-linejoin="round"
|
|
100
|
+
aria-hidden="true"
|
|
101
|
+
focusable="false"
|
|
102
|
+
>
|
|
103
|
+
<path d="M14 27l7 7 16-16" class="path-draw" />
|
|
104
|
+
</svg>
|
|
105
|
+
{:else if type === "error"}
|
|
106
|
+
<div class={`animate-error-impact relative z-10 size-full ${semanticText}`}>
|
|
107
|
+
<svg
|
|
108
|
+
viewBox="0 0 52 52"
|
|
109
|
+
class="size-full"
|
|
110
|
+
fill="none"
|
|
111
|
+
stroke="currentColor"
|
|
112
|
+
stroke-width="4"
|
|
113
|
+
stroke-linecap="round"
|
|
114
|
+
stroke-linejoin="round"
|
|
115
|
+
aria-hidden="true"
|
|
116
|
+
focusable="false"
|
|
117
|
+
>
|
|
118
|
+
<path d="M16 16l20 20" class="path-draw" />
|
|
119
|
+
<path d="M36 16l-20 20" class="path-draw" style="animation-delay: 0.15s" />
|
|
120
|
+
</svg>
|
|
121
|
+
</div>
|
|
122
|
+
{:else if type === "warning"}
|
|
123
|
+
<div class={`animate-bounce-short relative z-10 size-full ${semanticText}`}>
|
|
124
|
+
<svg
|
|
125
|
+
viewBox="0 0 52 52"
|
|
126
|
+
class="size-full"
|
|
127
|
+
fill="none"
|
|
128
|
+
stroke="currentColor"
|
|
129
|
+
stroke-width="4"
|
|
130
|
+
stroke-linecap="round"
|
|
131
|
+
stroke-linejoin="round"
|
|
132
|
+
aria-hidden="true"
|
|
133
|
+
focusable="false"
|
|
134
|
+
>
|
|
135
|
+
<path d="M26 7L7 45h38L26 7z" class="path-draw-long" />
|
|
136
|
+
<line x1="26" y1="20" x2="26" y2="30" class="path-draw" style="animation-delay: 0.4s" />
|
|
137
|
+
<line x1="26" y1="36" x2="26.01" y2="36" class="path-draw" style="animation-delay: 0.6s" />
|
|
138
|
+
</svg>
|
|
139
|
+
</div>
|
|
140
|
+
{:else if type === "info"}
|
|
141
|
+
<div class={`animate-info-pop relative z-10 size-full ${semanticText}`}>
|
|
142
|
+
<svg
|
|
143
|
+
viewBox="0 0 52 52"
|
|
144
|
+
class="size-full"
|
|
145
|
+
fill="none"
|
|
146
|
+
stroke="currentColor"
|
|
147
|
+
stroke-width="4"
|
|
148
|
+
stroke-linecap="round"
|
|
149
|
+
stroke-linejoin="round"
|
|
150
|
+
aria-hidden="true"
|
|
151
|
+
focusable="false"
|
|
152
|
+
>
|
|
153
|
+
<circle cx="26" cy="26" r="20" class="path-draw-long" />
|
|
154
|
+
<line x1="26" y1="34" x2="26" y2="24" class="path-draw" style="animation-delay: 0.3s" />
|
|
155
|
+
<line x1="26" y1="18" x2="26.01" y2="18" class="path-draw" style="animation-delay: 0.5s" />
|
|
156
|
+
</svg>
|
|
157
|
+
</div>
|
|
158
|
+
{:else if type === "question"}
|
|
159
|
+
<div class={`animate-info-pop relative z-10 size-full ${semanticText}`}>
|
|
160
|
+
<svg
|
|
161
|
+
viewBox="0 0 52 52"
|
|
162
|
+
class="size-full"
|
|
163
|
+
fill="none"
|
|
164
|
+
stroke="currentColor"
|
|
165
|
+
stroke-width="4"
|
|
166
|
+
stroke-linecap="round"
|
|
167
|
+
stroke-linejoin="round"
|
|
168
|
+
aria-hidden="true"
|
|
169
|
+
focusable="false"
|
|
170
|
+
>
|
|
171
|
+
<circle cx="26" cy="26" r="20" class="path-draw-long" />
|
|
172
|
+
<path
|
|
173
|
+
d="M22 21a6 6 0 0 1 12 2c0 4-6 5-6 8"
|
|
174
|
+
class="path-draw"
|
|
175
|
+
style="animation-delay: 0.3s"
|
|
176
|
+
/>
|
|
177
|
+
<line x1="26" y1="36" x2="26.01" y2="36" class="path-draw" style="animation-delay: 0.6s" />
|
|
178
|
+
</svg>
|
|
179
|
+
</div>
|
|
180
|
+
{:else if type === "loading"}
|
|
181
|
+
<div class={`absolute inset-0 rounded-full border-4 ${loadingTrackClass}`} aria-hidden="true"></div>
|
|
182
|
+
<div
|
|
183
|
+
class={`absolute inset-0 rounded-full border-4 animate-spin ${loadingSpinnerClass}`}
|
|
184
|
+
aria-hidden="true"
|
|
185
|
+
></div>
|
|
186
|
+
<div class={`${loadingDotClass} animate-pulse`}>
|
|
187
|
+
<svg
|
|
188
|
+
viewBox="0 0 52 52"
|
|
189
|
+
class="h-1/2 w-1/2"
|
|
190
|
+
fill="currentColor"
|
|
191
|
+
aria-hidden="true"
|
|
192
|
+
focusable="false"
|
|
193
|
+
>
|
|
194
|
+
<circle cx="26" cy="26" r="6" />
|
|
195
|
+
</svg>
|
|
196
|
+
</div>
|
|
197
|
+
{:else if type === "processing"}
|
|
198
|
+
<div
|
|
199
|
+
class={`absolute inset-0 rounded-full border-4 animate-pulse-soft ${processingTrackClass}`}
|
|
200
|
+
aria-hidden="true"
|
|
201
|
+
></div>
|
|
202
|
+
<div class={`animate-spin-slow relative z-10 size-full ${processingIconClass}`}>
|
|
203
|
+
<svg
|
|
204
|
+
viewBox="0 0 52 52"
|
|
205
|
+
class="size-full p-2"
|
|
206
|
+
fill="none"
|
|
207
|
+
stroke="currentColor"
|
|
208
|
+
stroke-width="4"
|
|
209
|
+
stroke-linecap="round"
|
|
210
|
+
stroke-linejoin="round"
|
|
211
|
+
aria-hidden="true"
|
|
212
|
+
focusable="false"
|
|
213
|
+
>
|
|
214
|
+
<path
|
|
215
|
+
d="M26 6v8m0 24v8M12.3 12.3l5.66 5.66m16.08 16.08l5.66 5.66M6 26h8m24 0h8M12.3 39.7l5.66-5.66m16.08-16.08l5.66-5.66"
|
|
216
|
+
/>
|
|
217
|
+
</svg>
|
|
218
|
+
</div>
|
|
219
|
+
{/if}
|
|
220
|
+
</div>
|
|
221
|
+
|
|
222
|
+
<style>
|
|
223
|
+
/* Animation: Stroke Drawing */
|
|
224
|
+
.path-draw {
|
|
225
|
+
stroke-dasharray: 200;
|
|
226
|
+
stroke-dashoffset: 200;
|
|
227
|
+
animation: draw 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
.path-draw-long {
|
|
231
|
+
stroke-dasharray: 260;
|
|
232
|
+
stroke-dashoffset: 260;
|
|
233
|
+
animation: draw 0.8s cubic-bezier(0.65, 0, 0.45, 1) forwards;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
@keyframes draw {
|
|
237
|
+
to {
|
|
238
|
+
stroke-dashoffset: 0;
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
/* Success Pop Effect */
|
|
243
|
+
.success-pop {
|
|
244
|
+
transform: scale(0);
|
|
245
|
+
opacity: 0;
|
|
246
|
+
animation: success-pop 0.6s cubic-bezier(0.165, 0.84, 0.44, 1) forwards;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
@keyframes success-pop {
|
|
250
|
+
0% {
|
|
251
|
+
transform: scale(0);
|
|
252
|
+
opacity: 0;
|
|
253
|
+
}
|
|
254
|
+
50% {
|
|
255
|
+
transform: scale(1.1);
|
|
256
|
+
opacity: 1;
|
|
257
|
+
}
|
|
258
|
+
100% {
|
|
259
|
+
transform: scale(1);
|
|
260
|
+
opacity: 1;
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
/* Ring Burst Effect */
|
|
265
|
+
.ring-burst {
|
|
266
|
+
transform: scale(0.5);
|
|
267
|
+
opacity: 0;
|
|
268
|
+
animation: ring-burst 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
@keyframes ring-burst {
|
|
272
|
+
0% {
|
|
273
|
+
transform: scale(0.5);
|
|
274
|
+
opacity: 0;
|
|
275
|
+
}
|
|
276
|
+
30% {
|
|
277
|
+
opacity: 0.8;
|
|
278
|
+
}
|
|
279
|
+
100% {
|
|
280
|
+
transform: scale(1.8);
|
|
281
|
+
opacity: 0;
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
/* Enhanced Impact shake for error */
|
|
286
|
+
.animate-error-impact {
|
|
287
|
+
animation: error-impact 0.6s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
@keyframes error-impact {
|
|
291
|
+
0% {
|
|
292
|
+
transform: scale(1);
|
|
293
|
+
}
|
|
294
|
+
10% {
|
|
295
|
+
transform: scale(0.9) translate3d(-2px, 0, 0);
|
|
296
|
+
}
|
|
297
|
+
20% {
|
|
298
|
+
transform: scale(0.9) translate3d(4px, 0, 0);
|
|
299
|
+
}
|
|
300
|
+
30%,
|
|
301
|
+
50%,
|
|
302
|
+
70% {
|
|
303
|
+
transform: scale(1) translate3d(-6px, 0, 0);
|
|
304
|
+
}
|
|
305
|
+
40%,
|
|
306
|
+
60% {
|
|
307
|
+
transform: scale(1) translate3d(6px, 0, 0);
|
|
308
|
+
}
|
|
309
|
+
100% {
|
|
310
|
+
transform: scale(1) translate3d(0, 0, 0);
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
/* Pulse effect for all background rings */
|
|
315
|
+
.animate-pulse-soft {
|
|
316
|
+
animation: pulse-soft 2.5s ease-in-out infinite;
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
@keyframes pulse-soft {
|
|
320
|
+
0%,
|
|
321
|
+
100% {
|
|
322
|
+
transform: scale(1);
|
|
323
|
+
opacity: 0.4;
|
|
324
|
+
}
|
|
325
|
+
50% {
|
|
326
|
+
transform: scale(1.04);
|
|
327
|
+
opacity: 0.15;
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
/* Bounce-short for Warning */
|
|
332
|
+
.animate-bounce-short {
|
|
333
|
+
animation: bounce-short 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
@keyframes bounce-short {
|
|
337
|
+
0% {
|
|
338
|
+
transform: scale(0.3);
|
|
339
|
+
opacity: 0;
|
|
340
|
+
}
|
|
341
|
+
60% {
|
|
342
|
+
transform: scale(1.1);
|
|
343
|
+
opacity: 1;
|
|
344
|
+
}
|
|
345
|
+
100% {
|
|
346
|
+
transform: scale(1);
|
|
347
|
+
opacity: 1;
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
/* Info Pop Up */
|
|
352
|
+
.animate-info-pop {
|
|
353
|
+
animation: info-pop 0.6s cubic-bezier(0.17, 0.67, 0.83, 0.67) both;
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
@keyframes info-pop {
|
|
357
|
+
0% {
|
|
358
|
+
transform: translateY(10px) scale(0.8);
|
|
359
|
+
opacity: 0;
|
|
360
|
+
}
|
|
361
|
+
100% {
|
|
362
|
+
transform: translateY(0) scale(1);
|
|
363
|
+
opacity: 1;
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
/* Spin Slow for Processing */
|
|
368
|
+
.animate-spin-slow {
|
|
369
|
+
animation: spin 3s linear infinite;
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
.animate-swal-enter {
|
|
373
|
+
animation: swal-show 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
.animate-swal-motion {
|
|
377
|
+
animation:
|
|
378
|
+
swal-show 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) both,
|
|
379
|
+
swal-idle 2.6s ease-in-out 0.6s infinite;
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
@keyframes swal-show {
|
|
383
|
+
0% {
|
|
384
|
+
transform: scale(0.7);
|
|
385
|
+
opacity: 0;
|
|
386
|
+
}
|
|
387
|
+
45% {
|
|
388
|
+
transform: scale(1.06);
|
|
389
|
+
opacity: 1;
|
|
390
|
+
}
|
|
391
|
+
80% {
|
|
392
|
+
transform: scale(0.98);
|
|
393
|
+
}
|
|
394
|
+
100% {
|
|
395
|
+
transform: scale(1);
|
|
396
|
+
opacity: 1;
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
@keyframes swal-idle {
|
|
401
|
+
0%,
|
|
402
|
+
100% {
|
|
403
|
+
transform: scale(1);
|
|
404
|
+
}
|
|
405
|
+
50% {
|
|
406
|
+
transform: scale(1.03);
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
@media (prefers-reduced-motion: reduce) {
|
|
411
|
+
.animated-icon-root:not(.force-motion) .animate-swal-motion,
|
|
412
|
+
.animated-icon-root:not(.force-motion) .animate-swal-enter,
|
|
413
|
+
.animated-icon-root:not(.force-motion) .path-draw,
|
|
414
|
+
.animated-icon-root:not(.force-motion) .path-draw-long,
|
|
415
|
+
.animated-icon-root:not(.force-motion) .success-pop,
|
|
416
|
+
.animated-icon-root:not(.force-motion) .ring-burst,
|
|
417
|
+
.animated-icon-root:not(.force-motion) .animate-error-impact,
|
|
418
|
+
.animated-icon-root:not(.force-motion) .animate-pulse-soft,
|
|
419
|
+
.animated-icon-root:not(.force-motion) .animate-bounce-short,
|
|
420
|
+
.animated-icon-root:not(.force-motion) .animate-info-pop,
|
|
421
|
+
.animated-icon-root:not(.force-motion) .animate-spin-slow,
|
|
422
|
+
.animated-icon-root:not(.force-motion) :global(.animate-spin),
|
|
423
|
+
.animated-icon-root:not(.force-motion) :global(.animate-pulse) {
|
|
424
|
+
animation: none;
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
.animated-icon-root:not(.force-motion) .path-draw,
|
|
428
|
+
.animated-icon-root:not(.force-motion) .path-draw-long {
|
|
429
|
+
stroke-dashoffset: 0;
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
.animated-icon-root:not(.force-motion) .success-pop,
|
|
433
|
+
.animated-icon-root:not(.force-motion) .ring-burst {
|
|
434
|
+
display: none;
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
.animated-icon-root:not(.force-motion) .animate-error-impact,
|
|
438
|
+
.animated-icon-root:not(.force-motion) .animate-bounce-short,
|
|
439
|
+
.animated-icon-root:not(.force-motion) .animate-info-pop,
|
|
440
|
+
.animated-icon-root:not(.force-motion) .animate-spin-slow,
|
|
441
|
+
.animated-icon-root:not(.force-motion) .animate-pulse-soft {
|
|
442
|
+
transform: none;
|
|
443
|
+
opacity: 1;
|
|
444
|
+
}
|
|
445
|
+
}
|
|
446
|
+
</style>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { AnimatedIconType } from './animated-icon.types.js';
|
|
2
|
+
import type { ToastIconTone } from './french-toast/toast-context.js';
|
|
3
|
+
interface Props {
|
|
4
|
+
type?: AnimatedIconType;
|
|
5
|
+
size?: number | string;
|
|
6
|
+
class?: string;
|
|
7
|
+
forceMotion?: boolean;
|
|
8
|
+
/** When false, only play the entrance animation (no idle pulse). */
|
|
9
|
+
idle?: boolean;
|
|
10
|
+
/** `on-color` uses currentColor for contrast on solid semantic backgrounds. */
|
|
11
|
+
tone?: ToastIconTone;
|
|
12
|
+
}
|
|
13
|
+
declare const AnimatedIcon: import("svelte").Component<Props, {}, "">;
|
|
14
|
+
type AnimatedIcon = ReturnType<typeof AnimatedIcon>;
|
|
15
|
+
export default AnimatedIcon;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type AnimatedIconType = 'success' | 'error' | 'warning' | 'info' | 'question' | 'loading' | 'processing';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2022 Kabir Goel
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
<!-- Adapted from https://github.com/timolins/react-hot-toast -->
|
|
2
|
+
<script lang="ts">let { primary = "#61d345", secondary = "#fff" } = $props();
|
|
3
|
+
export {};
|
|
4
|
+
</script>
|
|
5
|
+
|
|
6
|
+
<div style:--primary={primary} style:--secondary={secondary}></div>
|
|
7
|
+
|
|
8
|
+
<style>
|
|
9
|
+
div {
|
|
10
|
+
width: 20px;
|
|
11
|
+
opacity: 0;
|
|
12
|
+
height: 20px;
|
|
13
|
+
border-radius: 10px;
|
|
14
|
+
background: var(--primary, #61d345);
|
|
15
|
+
position: relative;
|
|
16
|
+
transform: rotate(45deg);
|
|
17
|
+
animation: circleAnimation 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
|
|
18
|
+
animation-delay: 100ms;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
div::after {
|
|
22
|
+
content: '';
|
|
23
|
+
box-sizing: border-box;
|
|
24
|
+
animation: checkmarkAnimation 0.2s ease-out forwards;
|
|
25
|
+
opacity: 0;
|
|
26
|
+
animation-delay: 200ms;
|
|
27
|
+
position: absolute;
|
|
28
|
+
border-right: 2px solid;
|
|
29
|
+
border-bottom: 2px solid;
|
|
30
|
+
border-color: var(--secondary, #fff);
|
|
31
|
+
bottom: 6px;
|
|
32
|
+
left: 6px;
|
|
33
|
+
height: 10px;
|
|
34
|
+
width: 6px;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
@keyframes circleAnimation {
|
|
38
|
+
from {
|
|
39
|
+
transform: scale(0) rotate(45deg);
|
|
40
|
+
opacity: 0;
|
|
41
|
+
}
|
|
42
|
+
to {
|
|
43
|
+
transform: scale(1) rotate(45deg);
|
|
44
|
+
opacity: 1;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
@keyframes checkmarkAnimation {
|
|
49
|
+
0% {
|
|
50
|
+
height: 0;
|
|
51
|
+
width: 0;
|
|
52
|
+
opacity: 0;
|
|
53
|
+
}
|
|
54
|
+
40% {
|
|
55
|
+
height: 0;
|
|
56
|
+
width: 6px;
|
|
57
|
+
opacity: 1;
|
|
58
|
+
}
|
|
59
|
+
100% {
|
|
60
|
+
opacity: 1;
|
|
61
|
+
height: 10px;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
</style>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { IconTheme } from '../core/types.js';
|
|
2
|
+
interface Props {
|
|
3
|
+
primary?: IconTheme['primary'];
|
|
4
|
+
secondary?: IconTheme['secondary'];
|
|
5
|
+
}
|
|
6
|
+
declare const CheckmarkIcon: import("svelte").Component<Props, {}, "">;
|
|
7
|
+
type CheckmarkIcon = ReturnType<typeof CheckmarkIcon>;
|
|
8
|
+
export default CheckmarkIcon;
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
<!-- Adapted from https://github.com/timolins/react-hot-toast -->
|
|
2
|
+
<script lang="ts">let { primary = "#ff4b4b", secondary = "#fff" } = $props();
|
|
3
|
+
export {};
|
|
4
|
+
</script>
|
|
5
|
+
|
|
6
|
+
<div style:--primary={primary} style:--secondary={secondary}></div>
|
|
7
|
+
|
|
8
|
+
<style>
|
|
9
|
+
div {
|
|
10
|
+
width: 20px;
|
|
11
|
+
opacity: 0;
|
|
12
|
+
height: 20px;
|
|
13
|
+
border-radius: 10px;
|
|
14
|
+
background: var(--primary, #ff4b4b);
|
|
15
|
+
position: relative;
|
|
16
|
+
transform: rotate(45deg);
|
|
17
|
+
animation: circleAnimation 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
|
|
18
|
+
animation-delay: 100ms;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
div::after,
|
|
22
|
+
div::before {
|
|
23
|
+
content: '';
|
|
24
|
+
animation: firstLineAnimation 0.15s ease-out forwards;
|
|
25
|
+
animation-delay: 150ms;
|
|
26
|
+
position: absolute;
|
|
27
|
+
border-radius: 3px;
|
|
28
|
+
opacity: 0;
|
|
29
|
+
background: var(--secondary, #fff);
|
|
30
|
+
bottom: 9px;
|
|
31
|
+
left: 4px;
|
|
32
|
+
height: 2px;
|
|
33
|
+
width: 12px;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
div:before {
|
|
37
|
+
animation: secondLineAnimation 0.15s ease-out forwards;
|
|
38
|
+
animation-delay: 180ms;
|
|
39
|
+
transform: rotate(90deg);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
@keyframes circleAnimation {
|
|
43
|
+
from {
|
|
44
|
+
transform: scale(0) rotate(45deg);
|
|
45
|
+
opacity: 0;
|
|
46
|
+
}
|
|
47
|
+
to {
|
|
48
|
+
transform: scale(1) rotate(45deg);
|
|
49
|
+
opacity: 1;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
@keyframes firstLineAnimation {
|
|
54
|
+
from {
|
|
55
|
+
transform: scale(0);
|
|
56
|
+
opacity: 0;
|
|
57
|
+
}
|
|
58
|
+
to {
|
|
59
|
+
transform: scale(1);
|
|
60
|
+
opacity: 1;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
@keyframes secondLineAnimation {
|
|
65
|
+
from {
|
|
66
|
+
transform: scale(0) rotate(90deg);
|
|
67
|
+
opacity: 0;
|
|
68
|
+
}
|
|
69
|
+
to {
|
|
70
|
+
transform: scale(1) rotate(90deg);
|
|
71
|
+
opacity: 1;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
</style>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { IconTheme } from '../core/types.js';
|
|
2
|
+
interface Props {
|
|
3
|
+
primary?: IconTheme['primary'];
|
|
4
|
+
secondary?: IconTheme['secondary'];
|
|
5
|
+
}
|
|
6
|
+
declare const ErrorIcon: import("svelte").Component<Props, {}, "">;
|
|
7
|
+
type ErrorIcon = ReturnType<typeof ErrorIcon>;
|
|
8
|
+
export default ErrorIcon;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
<!-- Adapted from https://github.com/timolins/react-hot-toast -->
|
|
2
|
+
<script lang="ts">let { primary = "#616161", secondary = "#e0e0e0" } = $props();
|
|
3
|
+
export {};
|
|
4
|
+
</script>
|
|
5
|
+
|
|
6
|
+
<div style:--primary={primary} style:--secondary={secondary}></div>
|
|
7
|
+
|
|
8
|
+
<style>
|
|
9
|
+
div {
|
|
10
|
+
width: 12px;
|
|
11
|
+
height: 12px;
|
|
12
|
+
box-sizing: border-box;
|
|
13
|
+
border: 2px solid;
|
|
14
|
+
border-radius: 100%;
|
|
15
|
+
border-color: var(--secondary, #e0e0e0);
|
|
16
|
+
border-right-color: var(--primary, #616161);
|
|
17
|
+
animation: rotate 1s linear infinite;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
@keyframes rotate {
|
|
21
|
+
from {
|
|
22
|
+
transform: rotate(0deg);
|
|
23
|
+
}
|
|
24
|
+
to {
|
|
25
|
+
transform: rotate(360deg);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
</style>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { IconTheme } from '../core/types.js';
|
|
2
|
+
interface Props {
|
|
3
|
+
primary?: IconTheme['primary'];
|
|
4
|
+
secondary?: IconTheme['secondary'];
|
|
5
|
+
}
|
|
6
|
+
declare const LoaderIcon: import("svelte").Component<Props, {}, "">;
|
|
7
|
+
type LoaderIcon = ReturnType<typeof LoaderIcon>;
|
|
8
|
+
export default LoaderIcon;
|