@ttt-productions/ui-core 0.11.0 → 0.11.2
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/react/components/alert-dialog.js +3 -3
- package/dist/react/components/alert-dialog.js.map +1 -1
- package/dist/react/components/dialog.js +3 -3
- package/dist/react/components/dialog.js.map +1 -1
- package/dist/react/components/toast.d.ts.map +1 -1
- package/dist/react/components/toast.js +12 -2
- package/dist/react/components/toast.js.map +1 -1
- package/package.json +1 -1
- package/src/react/components/alert-dialog.tsx +3 -3
- package/src/react/components/dialog.tsx +3 -3
- package/src/react/components/toast.tsx +12 -1
|
@@ -9,15 +9,15 @@ const AlertDialogTrigger = AlertDialogPrimitive.Trigger;
|
|
|
9
9
|
const AlertDialogPortal = AlertDialogPrimitive.Portal;
|
|
10
10
|
const AlertDialogOverlay = React.forwardRef(({ className, ...props }, ref) => (_jsx(AlertDialogPrimitive.Overlay, { className: cn("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0", className), ...props, ref: ref })));
|
|
11
11
|
AlertDialogOverlay.displayName = AlertDialogPrimitive.Overlay.displayName;
|
|
12
|
-
const AlertDialogContent = React.forwardRef(({ className, ...props }, ref) => (_jsxs(AlertDialogPortal, { children: [_jsx(AlertDialogOverlay, {}), _jsx(AlertDialogPrimitive.Content, { ref: ref, className: cn("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg", className), ...props })] })));
|
|
12
|
+
const AlertDialogContent = React.forwardRef(({ className, ...props }, ref) => (_jsxs(AlertDialogPortal, { children: [_jsx(AlertDialogOverlay, {}), _jsx(AlertDialogPrimitive.Content, { ref: ref, className: cn("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg [&>*]:min-w-0", className), ...props })] })));
|
|
13
13
|
AlertDialogContent.displayName = AlertDialogPrimitive.Content.displayName;
|
|
14
14
|
const AlertDialogHeader = ({ className, ...props }) => (_jsx("div", { className: cn("flex flex-col space-y-2 text-center sm:text-left", className), ...props }));
|
|
15
15
|
AlertDialogHeader.displayName = "AlertDialogHeader";
|
|
16
16
|
const AlertDialogFooter = ({ className, ...props }) => (_jsx("div", { className: cn("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2", className), ...props }));
|
|
17
17
|
AlertDialogFooter.displayName = "AlertDialogFooter";
|
|
18
|
-
const AlertDialogTitle = React.forwardRef(({ className, ...props }, ref) => (_jsx(AlertDialogPrimitive.Title, { ref: ref, className: cn("text-lg font-semibold", className), ...props })));
|
|
18
|
+
const AlertDialogTitle = React.forwardRef(({ className, ...props }, ref) => (_jsx(AlertDialogPrimitive.Title, { ref: ref, className: cn("text-lg font-semibold break-words", className), ...props })));
|
|
19
19
|
AlertDialogTitle.displayName = AlertDialogPrimitive.Title.displayName;
|
|
20
|
-
const AlertDialogDescription = React.forwardRef(({ className, ...props }, ref) => (_jsx(AlertDialogPrimitive.Description, { ref: ref, className: cn("text-sm text-muted-foreground", className), ...props })));
|
|
20
|
+
const AlertDialogDescription = React.forwardRef(({ className, ...props }, ref) => (_jsx(AlertDialogPrimitive.Description, { ref: ref, className: cn("text-sm text-muted-foreground break-words", className), ...props })));
|
|
21
21
|
AlertDialogDescription.displayName = AlertDialogPrimitive.Description.displayName;
|
|
22
22
|
const AlertDialogAction = React.forwardRef(({ className, ...props }, ref) => (_jsx(AlertDialogPrimitive.Action, { ref: ref, className: cn(buttonVariants(), className), ...props })));
|
|
23
23
|
AlertDialogAction.displayName = AlertDialogPrimitive.Action.displayName;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alert-dialog.js","sourceRoot":"","sources":["../../../src/react/components/alert-dialog.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,oBAAoB,MAAM,8BAA8B,CAAA;AAEpE,OAAO,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAA;AACvC,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAE5C,MAAM,WAAW,GAAG,oBAAoB,CAAC,IAAI,CAAA;AAC7C,MAAM,kBAAkB,GAAG,oBAAoB,CAAC,OAAO,CAAA;AACvD,MAAM,iBAAiB,GAAG,oBAAoB,CAAC,MAAM,CAAA;AAErD,MAAM,kBAAkB,GAAG,KAAK,CAAC,UAAU,CAGzC,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE,CAAC,CAClC,KAAC,oBAAoB,CAAC,OAAO,IAC3B,SAAS,EAAE,EAAE,CACX,yJAAyJ,EACzJ,SAAS,CACV,KACG,KAAK,EACT,GAAG,EAAE,GAAG,GACR,CACH,CAAC,CAAA;AACF,kBAAkB,CAAC,WAAW,GAAG,oBAAoB,CAAC,OAAO,CAAC,WAAW,CAAA;AAEzE,MAAM,kBAAkB,GAAG,KAAK,CAAC,UAAU,CAGzC,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE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EjF,MAAM,iBAAiB,GAAG,KAAK,CAAC,UAAU,CAGxC,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE,CAAC,CAClC,KAAC,oBAAoB,CAAC,MAAM,IAC1B,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,EAAE,CAAC,cAAc,EAAE,EAAE,SAAS,CAAC,KACtC,KAAK,GACT,CACH,CAAC,CAAA;AACF,iBAAiB,CAAC,WAAW,GAAG,oBAAoB,CAAC,MAAM,CAAC,WAAW,CAAA;AAEvE,MAAM,iBAAiB,GAAG,KAAK,CAAC,UAAU,CAGxC,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE,CAAC,CAClC,KAAC,oBAAoB,CAAC,MAAM,IAC1B,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,EAAE,CAAC,cAAc,CAAC,EAAE,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,cAAc,EAAE,SAAS,CAAC,KAC5E,KAAK,GACT,CACH,CAAC,CAAA;AACF,iBAAiB,CAAC,WAAW,GAAG,oBAAoB,CAAC,MAAM,CAAC,WAAW,CAAA;AAEvE,OAAO,EACL,WAAW,EACX,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,EAClB,kBAAkB,EAClB,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB,EAChB,sBAAsB,EACtB,iBAAiB,EACjB,iBAAiB,GAClB,CAAA"}
|
|
@@ -10,15 +10,15 @@ const DialogPortal = DialogPrimitive.Portal;
|
|
|
10
10
|
const DialogClose = DialogPrimitive.Close;
|
|
11
11
|
const DialogOverlay = React.forwardRef(({ className, ...props }, ref) => (_jsx(DialogPrimitive.Overlay, { ref: ref, className: cn("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0", className), ...props })));
|
|
12
12
|
DialogOverlay.displayName = DialogPrimitive.Overlay.displayName;
|
|
13
|
-
const DialogContent = React.forwardRef(({ className, children, ...props }, ref) => (_jsxs(DialogPortal, { children: [_jsx(DialogOverlay, {}), _jsxs(DialogPrimitive.Content, { ref: ref, className: cn("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-card p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg", "max-h-[90vh] overflow-y-auto", className), ...props, children: [children, _jsxs(DialogPrimitive.Close, { className: "absolute right-4 top-4 rounded-xs opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground", children: [_jsx(X, { className: "h-4 w-4" }), _jsx("span", { className: "sr-only", children: "Close" })] })] })] })));
|
|
13
|
+
const DialogContent = React.forwardRef(({ className, children, ...props }, ref) => (_jsxs(DialogPortal, { children: [_jsx(DialogOverlay, {}), _jsxs(DialogPrimitive.Content, { ref: ref, className: cn("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-card p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg", "max-h-[90vh] overflow-y-auto [&>*]:min-w-0", className), ...props, children: [children, _jsxs(DialogPrimitive.Close, { className: "absolute right-4 top-4 rounded-xs opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground", children: [_jsx(X, { className: "h-4 w-4" }), _jsx("span", { className: "sr-only", children: "Close" })] })] })] })));
|
|
14
14
|
DialogContent.displayName = DialogPrimitive.Content.displayName;
|
|
15
15
|
const DialogHeader = ({ className, ...props }) => (_jsx("div", { className: cn("flex flex-col space-y-1.5 text-center sm:text-left", className), ...props }));
|
|
16
16
|
DialogHeader.displayName = "DialogHeader";
|
|
17
17
|
const DialogFooter = ({ className, ...props }) => (_jsx("div", { className: cn("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2", className), ...props }));
|
|
18
18
|
DialogFooter.displayName = "DialogFooter";
|
|
19
|
-
const DialogTitle = React.forwardRef(({ className, ...props }, ref) => (_jsx(DialogPrimitive.Title, { ref: ref, className: cn("text-lg font-semibold leading-none tracking-tight", className), ...props })));
|
|
19
|
+
const DialogTitle = React.forwardRef(({ className, ...props }, ref) => (_jsx(DialogPrimitive.Title, { ref: ref, className: cn("text-lg font-semibold leading-none tracking-tight break-words", className), ...props })));
|
|
20
20
|
DialogTitle.displayName = DialogPrimitive.Title.displayName;
|
|
21
|
-
const DialogDescription = React.forwardRef(({ className, ...props }, ref) => (_jsx(DialogPrimitive.Description, { ref: ref, className: cn("text-sm text-muted-foreground", className), ...props })));
|
|
21
|
+
const DialogDescription = React.forwardRef(({ className, ...props }, ref) => (_jsx(DialogPrimitive.Description, { ref: ref, className: cn("text-sm text-muted-foreground break-words", className), ...props })));
|
|
22
22
|
DialogDescription.displayName = DialogPrimitive.Description.displayName;
|
|
23
23
|
export { Dialog, DialogPortal, DialogOverlay, DialogClose, DialogTrigger, DialogContent, DialogHeader, DialogFooter, DialogTitle, DialogDescription, };
|
|
24
24
|
//# sourceMappingURL=dialog.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dialog.js","sourceRoot":"","sources":["../../../src/react/components/dialog.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,eAAe,MAAM,wBAAwB,CAAA;AACzD,OAAO,EAAE,CAAC,EAAE,MAAM,cAAc,CAAA;AAEhC,OAAO,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAA;AAEvC,MAAM,MAAM,GAAG,eAAe,CAAC,IAAI,CAAA;AACnC,MAAM,aAAa,GAAG,eAAe,CAAC,OAAO,CAAA;AAC7C,MAAM,YAAY,GAAG,eAAe,CAAC,MAAM,CAAA;AAC3C,MAAM,WAAW,GAAG,eAAe,CAAC,KAAK,CAAA;AAEzC,MAAM,aAAa,GAAG,KAAK,CAAC,UAAU,CAGpC,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE,CAAC,CAClC,KAAC,eAAe,CAAC,OAAO,IACtB,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,EAAE,CACX,wJAAwJ,EACxJ,SAAS,CACV,KACG,KAAK,GACT,CACH,CAAC,CAAA;AACF,aAAa,CAAC,WAAW,GAAG,eAAe,CAAC,OAAO,CAAC,WAAW,CAAA;AAE/D,MAAM,aAAa,GAAG,KAAK,CAAC,UAAU,CAGpC,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE,CAAC,CAC5C,MAAC,YAAY,eACX,KAAC,aAAa,KAAG,EACjB,MAAC,eAAe,CAAC,OAAO,IACtB,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,EAAE,CACX,ufAAuf,EACvf,
|
|
1
|
+
{"version":3,"file":"dialog.js","sourceRoot":"","sources":["../../../src/react/components/dialog.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,KAAK,KAAK,MAAM,OAAO,CA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,GAClB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toast.d.ts","sourceRoot":"","sources":["../../../src/react/components/toast.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,eAAe,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAkDlE,QAAA,MAAM,aAAa,8CAA2B,CAAC;AAE/C,QAAA,MAAM,aAAa,kKAajB,CAAC;AAaH,QAAA,MAAM,KAAK;;;IARP,4CAA4C;eACjC,MAAM;IACjB,oBAAoB;kBACN,OAAO;IACrB,oDAAoD;iBACvC,OAAO;
|
|
1
|
+
{"version":3,"file":"toast.d.ts","sourceRoot":"","sources":["../../../src/react/components/toast.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,eAAe,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAkDlE,QAAA,MAAM,aAAa,8CAA2B,CAAC;AAE/C,QAAA,MAAM,aAAa,kKAajB,CAAC;AAaH,QAAA,MAAM,KAAK;;;IARP,4CAA4C;eACjC,MAAM;IACjB,oBAAoB;kBACN,OAAO;IACrB,oDAAoD;iBACvC,OAAO;uCAmEvB,CAAC;AAGF,QAAA,MAAM,WAAW,kKAKf,CAAC;AAGH,QAAA,MAAM,UAAU,iKAcd,CAAC;AAGH,QAAA,MAAM,UAAU,2JAKd,CAAC;AAGH,QAAA,MAAM,gBAAgB,iKAKpB,CAAC;AAGH,mCAAmC;AACnC,MAAM,MAAM,UAAU,GAAG,KAAK,CAAC,wBAAwB,CAAC,OAAO,KAAK,CAAC,CAAC;AACtE,MAAM,MAAM,kBAAkB,GAAG,KAAK,CAAC,YAAY,CAAC,OAAO,WAAW,CAAC,CAAC;AAExE,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,KAAK,EAAE,UAAU,EAAE,gBAAgB,EAAE,UAAU,EAAE,WAAW,EAAE,CAAC"}
|
|
@@ -37,7 +37,7 @@ const toastVariants = cva(cn(
|
|
|
37
37
|
const ToastProvider = ToastPrimitives.Provider;
|
|
38
38
|
const ToastViewport = React.forwardRef(({ className, ...props }, ref) => (_jsx(ToastPrimitives.Viewport, { ref: ref, className: cn("fixed top-0 left-1/2 -translate-x-1/2 z-[100] flex max-h-screen w-full flex-col gap-2 p-4", "sm:max-w-[480px] md:max-w-[600px]", className), ...props })));
|
|
39
39
|
ToastViewport.displayName = ToastPrimitives.Viewport.displayName;
|
|
40
|
-
const Toast = React.forwardRef(({ className, variant, duration, dismissible = true, persistent = false, style, children, ...props }, ref) => {
|
|
40
|
+
const Toast = React.forwardRef(({ className, variant, duration, dismissible = true, persistent = false, style, children, onOpenChange, ...props }, ref) => {
|
|
41
41
|
// Caller is the source of truth for duration. Persistent toasts disable
|
|
42
42
|
// the auto-dismiss entirely by passing `Infinity` to Radix.
|
|
43
43
|
const effectiveDuration = persistent ? Infinity : (duration ?? 5000);
|
|
@@ -46,11 +46,21 @@ const Toast = React.forwardRef(({ className, variant, duration, dismissible = tr
|
|
|
46
46
|
...style,
|
|
47
47
|
["--toast-duration"]: `${effectiveDuration}ms`,
|
|
48
48
|
};
|
|
49
|
-
return (_jsxs(ToastPrimitives.Root, { ref: ref, duration: effectiveDuration, "data-variant": variant, "data-persistent": persistent ? "" : undefined, className: cn(toastVariants({ variant }), className), style: mergedStyle, ...props, children: [_jsx(ToastKeyframes, {}), children, !persistent ? (_jsx("div", { className: cn("absolute bottom-0 left-0 h-1 w-full bg-foreground/30", "origin-left"), style: {
|
|
49
|
+
return (_jsxs(ToastPrimitives.Root, { ref: ref, duration: effectiveDuration, "data-variant": variant, "data-persistent": persistent ? "" : undefined, className: cn(toastVariants({ variant }), className), style: mergedStyle, onOpenChange: onOpenChange, ...props, children: [_jsx(ToastKeyframes, {}), children, !persistent ? (_jsx("div", { "aria-hidden": true, className: cn("absolute bottom-0 left-0 h-1 w-full bg-foreground/30", "origin-left"), style: {
|
|
50
50
|
animationName: "toast-progress",
|
|
51
51
|
animationDuration: `${effectiveDuration}ms`,
|
|
52
52
|
animationTimingFunction: "linear",
|
|
53
53
|
animationFillMode: "forwards",
|
|
54
|
+
},
|
|
55
|
+
// Radix's own auto-close timer PAUSES on pointer-over the viewport,
|
|
56
|
+
// focus, and window-blur — but this CSS bar does not. When the bar
|
|
57
|
+
// empties we must dismiss regardless of Radix's paused timer, so the
|
|
58
|
+
// toast never lingers after the countdown visibly reaches zero.
|
|
59
|
+
// Radix's `duration` above remains a motion-independent backstop
|
|
60
|
+
// (e.g. under prefers-reduced-motion where this event may not fire).
|
|
61
|
+
onAnimationEnd: (e) => {
|
|
62
|
+
if (e.animationName === "toast-progress")
|
|
63
|
+
onOpenChange?.(false);
|
|
54
64
|
} })) : null, dismissible ? (_jsx(ToastPrimitives.Close, { className: cn("absolute right-2 top-2 inline-flex h-7 w-7 items-center justify-center rounded-md", "text-foreground/60 hover:text-foreground", "focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:ring-offset-background"), "aria-label": "Dismiss toast", children: _jsx(X, { className: "h-4 w-4" }) })) : null] }));
|
|
55
65
|
});
|
|
56
66
|
Toast.displayName = ToastPrimitives.Root.displayName;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toast.js","sourceRoot":"","sources":["../../../src/react/components/toast.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,eAAe,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,GAAG,EAAqB,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,CAAC,EAAE,MAAM,cAAc,CAAC;AAEjC,OAAO,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAC;AAExC;;;;;GAKG;AACH,SAAS,cAAc;IACrB,oEAAoE;IACpE,OAAO,CACL,gBACE,uBAAuB,EAAE;YACvB,MAAM,EAAE,6EAA6E;SACtF,GACD,CACH,CAAC;AACJ,CAAC;AAED,MAAM,aAAa,GAAG,GAAG,CACvB,EAAE;AACA,OAAO;AACP,yKAAyK;AACzK,wBAAwB;AACxB,8DAA8D,EAC9D,8DAA8D,EAC9D,oFAAoF,EACpF,iEAAiE,EACjE,6FAA6F,EAC7F,uEAAuE,CACxE,EACD;IACE,QAAQ,EAAE;QACR,OAAO,EAAE;YACP,OAAO,EAAE,EAAE;YACX,WAAW,EAAE,sCAAsC;YACnD,OAAO,EAAE,8CAA8C;YACvD,OAAO,EAAE,0CAA0C;YACnD,KAAK,EAAE,sCAAsC;SAC9C;KACF;IACD,eAAe,EAAE;QACf,OAAO,EAAE,SAAS;KACnB;CACF,CACF,CAAC;AAEF,MAAM,aAAa,GAAG,eAAe,CAAC,QAAQ,CAAC;AAE/C,MAAM,aAAa,GAAG,KAAK,CAAC,UAAU,CAGpC,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE,CAAC,CAClC,KAAC,eAAe,CAAC,QAAQ,IACvB,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,EAAE,CACX,2FAA2F,EAC3F,mCAAmC,EACnC,SAAS,CACV,KACG,KAAK,GACT,CACH,CAAC,CAAC;AACH,aAAa,CAAC,WAAW,GAAG,eAAe,CAAC,QAAQ,CAAC,WAAW,CAAC;AAYjE,MAAM,KAAK,GAAG,KAAK,CAAC,UAAU,CAC5B,CAAC,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,WAAW,GAAG,IAAI,EAAE,UAAU,GAAG,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE;
|
|
1
|
+
{"version":3,"file":"toast.js","sourceRoot":"","sources":["../../../src/react/components/toast.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK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KAAK,IAAC,GAAG,EAAE,GAAG,EAAE,SAAS,EAAE,EAAE,CAAC,SAAS,CAAC,KAAM,KAAK,GAAI,CACzE,CAAC,CAAC;AACH,UAAU,CAAC,WAAW,GAAG,eAAe,CAAC,KAAK,CAAC,WAAW,CAAC;AAE3D,MAAM,gBAAgB,GAAG,KAAK,CAAC,UAAU,CAGvC,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE,CAAC,CAClC,KAAC,eAAe,CAAC,WAAW,IAAC,GAAG,EAAE,GAAG,EAAE,SAAS,EAAE,EAAE,CAAC,SAAS,CAAC,KAAM,KAAK,GAAI,CAC/E,CAAC,CAAC;AACH,gBAAgB,CAAC,WAAW,GAAG,eAAe,CAAC,WAAW,CAAC,WAAW,CAAC;AAMvE,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,KAAK,EAAE,UAAU,EAAE,gBAAgB,EAAE,UAAU,EAAE,WAAW,EAAE,CAAC"}
|
package/package.json
CHANGED
|
@@ -34,7 +34,7 @@ const AlertDialogContent = React.forwardRef<
|
|
|
34
34
|
<AlertDialogPrimitive.Content
|
|
35
35
|
ref={ref}
|
|
36
36
|
className={cn(
|
|
37
|
-
"fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",
|
|
37
|
+
"fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg [&>*]:min-w-0",
|
|
38
38
|
className
|
|
39
39
|
)}
|
|
40
40
|
{...props}
|
|
@@ -74,7 +74,7 @@ const AlertDialogTitle = React.forwardRef<
|
|
|
74
74
|
>(({ className, ...props }, ref) => (
|
|
75
75
|
<AlertDialogPrimitive.Title
|
|
76
76
|
ref={ref}
|
|
77
|
-
className={cn("text-lg font-semibold", className)}
|
|
77
|
+
className={cn("text-lg font-semibold break-words", className)}
|
|
78
78
|
{...props}
|
|
79
79
|
/>
|
|
80
80
|
))
|
|
@@ -86,7 +86,7 @@ const AlertDialogDescription = React.forwardRef<
|
|
|
86
86
|
>(({ className, ...props }, ref) => (
|
|
87
87
|
<AlertDialogPrimitive.Description
|
|
88
88
|
ref={ref}
|
|
89
|
-
className={cn("text-sm text-muted-foreground", className)}
|
|
89
|
+
className={cn("text-sm text-muted-foreground break-words", className)}
|
|
90
90
|
{...props}
|
|
91
91
|
/>
|
|
92
92
|
))
|
|
@@ -36,7 +36,7 @@ const DialogContent = React.forwardRef<
|
|
|
36
36
|
ref={ref}
|
|
37
37
|
className={cn(
|
|
38
38
|
"fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-card p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",
|
|
39
|
-
"max-h-[90vh] overflow-y-auto",
|
|
39
|
+
"max-h-[90vh] overflow-y-auto [&>*]:min-w-0",
|
|
40
40
|
className
|
|
41
41
|
)}
|
|
42
42
|
{...props}
|
|
@@ -82,7 +82,7 @@ const DialogTitle = React.forwardRef<
|
|
|
82
82
|
>(({ className, ...props }, ref) => (
|
|
83
83
|
<DialogPrimitive.Title
|
|
84
84
|
ref={ref}
|
|
85
|
-
className={cn("text-lg font-semibold leading-none tracking-tight", className)}
|
|
85
|
+
className={cn("text-lg font-semibold leading-none tracking-tight break-words", className)}
|
|
86
86
|
{...props}
|
|
87
87
|
/>
|
|
88
88
|
))
|
|
@@ -94,7 +94,7 @@ const DialogDescription = React.forwardRef<
|
|
|
94
94
|
>(({ className, ...props }, ref) => (
|
|
95
95
|
<DialogPrimitive.Description
|
|
96
96
|
ref={ref}
|
|
97
|
-
className={cn("text-sm text-muted-foreground", className)}
|
|
97
|
+
className={cn("text-sm text-muted-foreground break-words", className)}
|
|
98
98
|
{...props}
|
|
99
99
|
/>
|
|
100
100
|
))
|
|
@@ -79,7 +79,7 @@ type ToastRootProps = React.ComponentPropsWithoutRef<typeof ToastPrimitives.Root
|
|
|
79
79
|
};
|
|
80
80
|
|
|
81
81
|
const Toast = React.forwardRef<React.ElementRef<typeof ToastPrimitives.Root>, ToastRootProps>(
|
|
82
|
-
({ className, variant, duration, dismissible = true, persistent = false, style, children, ...props }, ref) => {
|
|
82
|
+
({ className, variant, duration, dismissible = true, persistent = false, style, children, onOpenChange, ...props }, ref) => {
|
|
83
83
|
// Caller is the source of truth for duration. Persistent toasts disable
|
|
84
84
|
// the auto-dismiss entirely by passing `Infinity` to Radix.
|
|
85
85
|
const effectiveDuration = persistent ? Infinity : (duration ?? 5000);
|
|
@@ -97,6 +97,7 @@ const Toast = React.forwardRef<React.ElementRef<typeof ToastPrimitives.Root>, To
|
|
|
97
97
|
data-persistent={persistent ? "" : undefined}
|
|
98
98
|
className={cn(toastVariants({ variant }), className)}
|
|
99
99
|
style={mergedStyle}
|
|
100
|
+
onOpenChange={onOpenChange}
|
|
100
101
|
{...props}
|
|
101
102
|
>
|
|
102
103
|
<ToastKeyframes />
|
|
@@ -105,6 +106,7 @@ const Toast = React.forwardRef<React.ElementRef<typeof ToastPrimitives.Root>, To
|
|
|
105
106
|
{/* countdown bar — hidden entirely for persistent toasts */}
|
|
106
107
|
{!persistent ? (
|
|
107
108
|
<div
|
|
109
|
+
aria-hidden
|
|
108
110
|
className={cn("absolute bottom-0 left-0 h-1 w-full bg-foreground/30", "origin-left")}
|
|
109
111
|
style={{
|
|
110
112
|
animationName: "toast-progress",
|
|
@@ -112,6 +114,15 @@ const Toast = React.forwardRef<React.ElementRef<typeof ToastPrimitives.Root>, To
|
|
|
112
114
|
animationTimingFunction: "linear",
|
|
113
115
|
animationFillMode: "forwards",
|
|
114
116
|
}}
|
|
117
|
+
// Radix's own auto-close timer PAUSES on pointer-over the viewport,
|
|
118
|
+
// focus, and window-blur — but this CSS bar does not. When the bar
|
|
119
|
+
// empties we must dismiss regardless of Radix's paused timer, so the
|
|
120
|
+
// toast never lingers after the countdown visibly reaches zero.
|
|
121
|
+
// Radix's `duration` above remains a motion-independent backstop
|
|
122
|
+
// (e.g. under prefers-reduced-motion where this event may not fire).
|
|
123
|
+
onAnimationEnd={(e) => {
|
|
124
|
+
if (e.animationName === "toast-progress") onOpenChange?.(false);
|
|
125
|
+
}}
|
|
115
126
|
/>
|
|
116
127
|
) : null}
|
|
117
128
|
|