varsel 0.4.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/VarselItem.svelte +15 -6
- package/dist/VarselItem.svelte.d.ts.map +1 -1
- package/dist/core/toast-factory.d.ts.map +1 -1
- package/dist/core/toast-factory.js +9 -0
- package/dist/core/types.d.ts +8 -2
- package/dist/core/types.d.ts.map +1 -1
- package/dist/core/variants.d.ts +2 -2
- package/dist/core/variants.d.ts.map +1 -1
- package/dist/core/variants.js +2 -0
- package/dist/styles.css +3 -0
- package/dist/variant-icons.d.ts +23 -1
- package/dist/variant-icons.d.ts.map +1 -1
- package/dist/variant-icons.js +9 -1
- package/package.json +1 -1
package/dist/VarselItem.svelte
CHANGED
|
@@ -76,7 +76,8 @@ let renderIndex = $derived(toast.renderIndex);
|
|
|
76
76
|
let shouldClose = $derived(toast.shouldClose);
|
|
77
77
|
let position = $derived(toast.position || "bottom-center");
|
|
78
78
|
let className = $derived(toast.className || "");
|
|
79
|
-
let
|
|
79
|
+
let onAutoClose = $derived(toast.onAutoClose);
|
|
80
|
+
let onDismiss = $derived(toast.onDismiss);
|
|
80
81
|
let showClose = $derived(toast.showClose ?? defaultShowClose);
|
|
81
82
|
|
|
82
83
|
let toastRef = $state<HTMLDivElement | null>(null);
|
|
@@ -172,6 +173,9 @@ const getFocusableElements = () => {
|
|
|
172
173
|
);
|
|
173
174
|
};
|
|
174
175
|
|
|
176
|
+
type CloseReason = "auto" | "dismiss" | null;
|
|
177
|
+
let closeReason: CloseReason = null;
|
|
178
|
+
|
|
175
179
|
const handleTransitionEnd = (event: TransitionEvent) => {
|
|
176
180
|
if (event.target !== toastRef) return;
|
|
177
181
|
if (event.propertyName !== "opacity" && event.propertyName !== "transform")
|
|
@@ -180,15 +184,20 @@ const handleTransitionEnd = (event: TransitionEvent) => {
|
|
|
180
184
|
if (exitAnimationComplete) return;
|
|
181
185
|
|
|
182
186
|
exitAnimationComplete = true;
|
|
183
|
-
|
|
187
|
+
if (closeReason === "auto") {
|
|
188
|
+
onAutoClose?.();
|
|
189
|
+
} else if (closeReason === "dismiss") {
|
|
190
|
+
onDismiss?.();
|
|
191
|
+
}
|
|
184
192
|
onRemove(id);
|
|
185
193
|
};
|
|
186
194
|
|
|
187
|
-
const handleClose = () => {
|
|
195
|
+
const handleClose = (reason: Exclude<CloseReason, null> = "dismiss") => {
|
|
188
196
|
if (!toastRef || isExiting) return;
|
|
189
197
|
|
|
190
198
|
isExiting = true;
|
|
191
199
|
exitAnimationComplete = false;
|
|
200
|
+
closeReason = reason;
|
|
192
201
|
|
|
193
202
|
toastState.update(id, { shouldClose: true });
|
|
194
203
|
|
|
@@ -334,11 +343,11 @@ $effect(() => {
|
|
|
334
343
|
if (!Number.isFinite(ms)) {
|
|
335
344
|
// Do not set timeout for infinite duration
|
|
336
345
|
} else if (ms === 0) {
|
|
337
|
-
handleClose();
|
|
346
|
+
handleClose("auto");
|
|
338
347
|
} else {
|
|
339
348
|
timerStartRef = Date.now();
|
|
340
349
|
timeoutRef = setTimeout(() => {
|
|
341
|
-
handleClose();
|
|
350
|
+
handleClose("auto");
|
|
342
351
|
}, ms);
|
|
343
352
|
}
|
|
344
353
|
}
|
|
@@ -754,7 +763,7 @@ const handleBlurCapture = (event: FocusEvent) => {
|
|
|
754
763
|
{#if showClose}
|
|
755
764
|
<button
|
|
756
765
|
type="button"
|
|
757
|
-
onclick={handleClose}
|
|
766
|
+
onclick={() => handleClose()}
|
|
758
767
|
class={cn(
|
|
759
768
|
"absolute top-2 end-2 cursor-pointer rounded-vs-sm p-1 text-vs-foreground/45 hover:bg-vs-popover-muted hover:text-vs-foreground/70 transition-[background-color,color,box-shadow] ease-vs-button duration-100 focus-visible:ring-1 focus-visible:ring-vs-ring/50 focus-visible:outline-none",
|
|
760
769
|
)}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VarselItem.svelte.d.ts","sourceRoot":"","sources":["../src/lib/VarselItem.svelte.ts"],"names":[],"mappings":"AAUA,OAAO,EAYN,KAAK,eAAe,EAIpB,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"VarselItem.svelte.d.ts","sourceRoot":"","sources":["../src/lib/VarselItem.svelte.ts"],"names":[],"mappings":"AAUA,OAAO,EAYN,KAAK,eAAe,EAIpB,MAAM,aAAa,CAAC;AAUpB,KAAK,gBAAgB,GAAI;IACzB,KAAK,EAAE,eAAe,CAAC;IACvB,QAAQ,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/B,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,cAAc,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IACtD,iBAAiB,CAAC,EAAE,MAAM,IAAI,CAAC;IAC/B,iBAAiB,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IAC/C,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACzB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,aAAa,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAywBF,QAAA,MAAM,UAAU,sDAAwC,CAAC;AACzD,KAAK,UAAU,GAAG,UAAU,CAAC,OAAO,UAAU,CAAC,CAAC;AAChD,eAAe,UAAU,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toast-factory.d.ts","sourceRoot":"","sources":["../../src/lib/core/toast-factory.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAGX,YAAY,EAEZ,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"toast-factory.d.ts","sourceRoot":"","sources":["../../src/lib/core/toast-factory.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAGX,YAAY,EAEZ,MAAM,SAAS,CAAC;AAgKjB,eAAO,MAAM,KAAK,cAAc,CAAC"}
|
|
@@ -41,6 +41,15 @@ createToast.warning = (data) => {
|
|
|
41
41
|
}
|
|
42
42
|
return toastState.add({ ...data, variant: "warning" });
|
|
43
43
|
};
|
|
44
|
+
/**
|
|
45
|
+
* Creates an info variant toast.
|
|
46
|
+
*/
|
|
47
|
+
createToast.info = (data) => {
|
|
48
|
+
if (typeof data === "string") {
|
|
49
|
+
return toastState.add({ description: data, variant: "info" });
|
|
50
|
+
}
|
|
51
|
+
return toastState.add({ ...data, variant: "info" });
|
|
52
|
+
};
|
|
44
53
|
/**
|
|
45
54
|
* Creates an error (destructive) variant toast.
|
|
46
55
|
*/
|
package/dist/core/types.d.ts
CHANGED
|
@@ -31,8 +31,10 @@ export interface ToastData extends VariantProps<typeof toastContainerVariants> {
|
|
|
31
31
|
/** Callback function executed when the action button is clicked. */
|
|
32
32
|
onClick: () => void;
|
|
33
33
|
};
|
|
34
|
-
/** Callback
|
|
35
|
-
|
|
34
|
+
/** Callback fired when the toast finishes its auto-close timer. */
|
|
35
|
+
onAutoClose?: () => void;
|
|
36
|
+
/** Callback fired when the toast is dismissed manually (button, swipe, `toast.dismiss`, etc.). */
|
|
37
|
+
onDismiss?: () => void;
|
|
36
38
|
/** Internal flag: signals that the toast should begin its closing animation. */
|
|
37
39
|
shouldClose?: boolean;
|
|
38
40
|
/** Internal flag: signals that the toast is currently leaving the DOM. */
|
|
@@ -78,6 +80,10 @@ export type ToastInvoker = {
|
|
|
78
80
|
* Creates a warning toast notification.
|
|
79
81
|
*/
|
|
80
82
|
warning: (data: Omit<ToastData, "id" | "variant"> | string) => string;
|
|
83
|
+
/**
|
|
84
|
+
* Creates an info toast notification.
|
|
85
|
+
*/
|
|
86
|
+
info: (data: Omit<ToastData, "id" | "variant"> | string) => string;
|
|
81
87
|
/**
|
|
82
88
|
* Creates an error toast notification.
|
|
83
89
|
*/
|
package/dist/core/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/lib/core/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAExC,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AACzD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAEzD;;GAEG;AACH,MAAM,WAAW,SAAU,SAAQ,YAAY,CAAC,OAAO,sBAAsB,CAAC;IAC7E,uCAAuC;IACvC,EAAE,EAAE,MAAM,CAAC;IACX,gDAAgD;IAChD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,mEAAmE;IACnE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,0DAA0D;IAC1D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,+CAA+C;IAC/C,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,4DAA4D;IAC5D,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,0DAA0D;IAC1D,MAAM,CAAC,EAAE;QACR,mCAAmC;QACnC,KAAK,EAAE,MAAM,CAAC;QACd,oEAAoE;QACpE,OAAO,EAAE,MAAM,IAAI,CAAC;KACpB,CAAC;IACF,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/lib/core/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAA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AAC;IACzB,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,cAAc,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IACtD,iBAAiB,CAAC,EAAE,MAAM,IAAI,CAAC;CAC/B;AAED,sDAAsD;AACtD,MAAM,MAAM,eAAe,GAAG,CAAC,MAAM,EAAE,SAAS,EAAE,KAAK,IAAI,CAAC;AAE5D,YAAY,EAAE,aAAa,EAAE,SAAS,EAAE,cAAc,EAAE,CAAC"}
|
package/dist/core/variants.d.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
export declare const toastContainerVariants: (props?: ({
|
|
7
7
|
position?: "top-left" | "top-center" | "top-right" | "bottom-left" | "bottom-center" | "bottom-right" | null | undefined;
|
|
8
|
-
variant?: "default" | "success" | "warning" | "destructive" | "custom" | null | undefined;
|
|
8
|
+
variant?: "default" | "success" | "warning" | "destructive" | "info" | "custom" | null | undefined;
|
|
9
9
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
10
10
|
/**
|
|
11
11
|
* CVA definition for the inner content wrapper of the toast.
|
|
@@ -13,6 +13,6 @@ export declare const toastContainerVariants: (props?: ({
|
|
|
13
13
|
* separate from the structural container.
|
|
14
14
|
*/
|
|
15
15
|
export declare const toastContentVariants: (props?: ({
|
|
16
|
-
variant?: "default" | "success" | "warning" | "destructive" | "custom" | null | undefined;
|
|
16
|
+
variant?: "default" | "success" | "warning" | "destructive" | "info" | "custom" | null | undefined;
|
|
17
17
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
18
18
|
//# sourceMappingURL=variants.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"variants.d.ts","sourceRoot":"","sources":["../../src/lib/core/variants.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,eAAO,MAAM,sBAAsB;;;
|
|
1
|
+
{"version":3,"file":"variants.d.ts","sourceRoot":"","sources":["../../src/lib/core/variants.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,eAAO,MAAM,sBAAsB;;;8EAsClC,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,oBAAoB;;8EAc/B,CAAC"}
|
package/dist/core/variants.js
CHANGED
|
@@ -25,6 +25,7 @@ export const toastContainerVariants = cva("pointer-events-auto fixed will-change
|
|
|
25
25
|
success: "rounded-vs-lg border shadow-vs-toast border-vs-border bg-vs-popover text-vs-success/90",
|
|
26
26
|
warning: "rounded-vs-lg border shadow-vs-toast border-vs-border bg-vs-popover text-vs-warning/90",
|
|
27
27
|
destructive: "rounded-vs-lg border shadow-vs-toast border-vs-border bg-vs-popover text-vs-destructive/90",
|
|
28
|
+
info: "rounded-vs-lg border shadow-vs-toast border-vs-border bg-vs-popover text-vs-info/90",
|
|
28
29
|
custom: "",
|
|
29
30
|
},
|
|
30
31
|
},
|
|
@@ -45,6 +46,7 @@ export const toastContentVariants = cva("relative overflow-hidden rounded-vs-lg"
|
|
|
45
46
|
success: "",
|
|
46
47
|
warning: "",
|
|
47
48
|
destructive: "",
|
|
49
|
+
info: "",
|
|
48
50
|
custom: "",
|
|
49
51
|
},
|
|
50
52
|
},
|
package/dist/styles.css
CHANGED
|
@@ -23,6 +23,7 @@
|
|
|
23
23
|
--color-vs-destructive: oklch(0.62 0.21 25);
|
|
24
24
|
--color-vs-warning: oklch(0.8 0.2 75);
|
|
25
25
|
--color-vs-success: oklch(0.7 0.18 155);
|
|
26
|
+
--color-vs-info: oklch(0.7 0.18 240);
|
|
26
27
|
|
|
27
28
|
/* Shadows */
|
|
28
29
|
--shadow-vs-button:
|
|
@@ -53,6 +54,7 @@
|
|
|
53
54
|
--color-vs-destructive: oklch(0.72 0.27 25);
|
|
54
55
|
--color-vs-warning: oklch(0.82 0.24 85);
|
|
55
56
|
--color-vs-success: oklch(0.78 0.25 155);
|
|
57
|
+
--color-vs-info: oklch(0.78 0.18 240);
|
|
56
58
|
}
|
|
57
59
|
|
|
58
60
|
@theme {
|
|
@@ -65,6 +67,7 @@
|
|
|
65
67
|
--color-vs-destructive: var(--vs-destructive);
|
|
66
68
|
--color-vs-warning: var(--vs-warning);
|
|
67
69
|
--color-vs-success: var(--vs-success);
|
|
70
|
+
--color-vs-info: var(--vs-info);
|
|
68
71
|
--shadow-vs-button: var(--shadow-vs-button);
|
|
69
72
|
--shadow-vs-toast: var(--shadow-vs-toast);
|
|
70
73
|
--radius-vs-sm: calc(var(--radius-base) * 2);
|
package/dist/variant-icons.d.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* These are lightweight SVG path data objects rendered by the toast component.
|
|
4
4
|
*/
|
|
5
5
|
import type { ToastData } from "./internals";
|
|
6
|
-
declare const ICON_VARIANTS: readonly ["success", "warning", "destructive"];
|
|
6
|
+
declare const ICON_VARIANTS: readonly ["success", "warning", "destructive", "info"];
|
|
7
7
|
export type IconVariant = (typeof ICON_VARIANTS)[number];
|
|
8
8
|
type IconElement = {
|
|
9
9
|
tag: "path";
|
|
@@ -75,6 +75,28 @@ export declare const variantIconMap: {
|
|
|
75
75
|
r?: undefined;
|
|
76
76
|
})[];
|
|
77
77
|
};
|
|
78
|
+
info: {
|
|
79
|
+
viewBox: string;
|
|
80
|
+
elements: ({
|
|
81
|
+
tag: "circle";
|
|
82
|
+
cx: number;
|
|
83
|
+
cy: number;
|
|
84
|
+
r: number;
|
|
85
|
+
x1?: undefined;
|
|
86
|
+
y1?: undefined;
|
|
87
|
+
x2?: undefined;
|
|
88
|
+
y2?: undefined;
|
|
89
|
+
} | {
|
|
90
|
+
tag: "line";
|
|
91
|
+
x1: number;
|
|
92
|
+
y1: number;
|
|
93
|
+
x2: number;
|
|
94
|
+
y2: number;
|
|
95
|
+
cx?: undefined;
|
|
96
|
+
cy?: undefined;
|
|
97
|
+
r?: undefined;
|
|
98
|
+
})[];
|
|
99
|
+
};
|
|
78
100
|
};
|
|
79
101
|
/**
|
|
80
102
|
* Checks if a given toast variant has an associated icon.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"variant-icons.d.ts","sourceRoot":"","sources":["../src/lib/variant-icons.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAE7C,QAAA,MAAM,aAAa,
|
|
1
|
+
{"version":3,"file":"variant-icons.d.ts","sourceRoot":"","sources":["../src/lib/variant-icons.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAE7C,QAAA,MAAM,aAAa,wDAAyD,CAAC;AAE7E,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,CAAC,CAAC;AAEzD,KAAK,WAAW,GACb;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,GAC1B;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,MAAM,CAAA;CAAE,GAC/D;IAAE,GAAG,EAAE,QAAQ,CAAC;IAAC,EAAE,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAExD,MAAM,WAAW,qBAAqB;IACrC,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,WAAW,EAAE,CAAC;CACxB;AAED,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmC2B,CAAC;AAEvD;;;;GAIG;AACH,eAAO,MAAM,cAAc,GAC1B,UAAU,SAAS,CAAC,SAAS,CAAC,KAC5B,OAAO,IAAI,WAEb,CAAC"}
|
package/dist/variant-icons.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const ICON_VARIANTS = ["success", "warning", "destructive"];
|
|
1
|
+
const ICON_VARIANTS = ["success", "warning", "destructive", "info"];
|
|
2
2
|
export const variantIconMap = {
|
|
3
3
|
success: {
|
|
4
4
|
viewBox: "0 0 24 24",
|
|
@@ -26,6 +26,14 @@ export const variantIconMap = {
|
|
|
26
26
|
{ tag: "path", d: "m9 9 6 6" },
|
|
27
27
|
],
|
|
28
28
|
},
|
|
29
|
+
info: {
|
|
30
|
+
viewBox: "0 0 24 24",
|
|
31
|
+
elements: [
|
|
32
|
+
{ tag: "circle", cx: 12, cy: 12, r: 10 },
|
|
33
|
+
{ tag: "line", x1: 12, y1: 16, x2: 12, y2: 12 },
|
|
34
|
+
{ tag: "line", x1: 12, y1: 8, x2: 12.01, y2: 8 },
|
|
35
|
+
],
|
|
36
|
+
},
|
|
29
37
|
};
|
|
30
38
|
/**
|
|
31
39
|
* Checks if a given toast variant has an associated icon.
|