shadcn-packaged 2025.2.10 → 2025.2.24
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/index.css +11 -0
- package/index.d.ts +0 -3
- package/package.json +5 -6
- package/ui/menubar.d.ts +5 -10
- package/ui/menubar.jsx +15 -5
- package/ui/select.jsx +1 -1
- package/ui/sidebar.jsx +1 -1
- package/hooks/use-toast.d.ts +0 -44
- package/hooks/use-toast.js +0 -128
- package/ui/toast.d.ts +0 -15
- package/ui/toast.jsx +0 -35
- package/ui/toaster.d.ts +0 -1
- package/ui/toaster.jsx +0 -19
package/index.css
CHANGED
@@ -143,6 +143,17 @@
|
|
143
143
|
@apply border-border;
|
144
144
|
}
|
145
145
|
|
146
|
+
body {
|
147
|
+
@apply bg-background text-foreground;
|
148
|
+
}
|
149
|
+
}
|
150
|
+
|
151
|
+
|
152
|
+
|
153
|
+
@layer base {
|
154
|
+
* {
|
155
|
+
@apply border-border outline-ring/50;
|
156
|
+
}
|
146
157
|
body {
|
147
158
|
@apply bg-background text-foreground;
|
148
159
|
}
|
package/index.d.ts
CHANGED
@@ -1,5 +1,4 @@
|
|
1
1
|
/// <reference path="./hooks/use-mobile.d.ts" />;
|
2
|
-
/// <reference path="./hooks/use-toast.d.ts" />;
|
3
2
|
/// <reference path="./lib/utils.d.ts" />;
|
4
3
|
/// <reference path="./ui/accordion.d.ts" />;
|
5
4
|
/// <reference path="./ui/alert-dialog.d.ts" />;
|
@@ -44,8 +43,6 @@
|
|
44
43
|
/// <reference path="./ui/table.d.ts" />;
|
45
44
|
/// <reference path="./ui/tabs.d.ts" />;
|
46
45
|
/// <reference path="./ui/textarea.d.ts" />;
|
47
|
-
/// <reference path="./ui/toast.d.ts" />;
|
48
|
-
/// <reference path="./ui/toaster.d.ts" />;
|
49
46
|
/// <reference path="./ui/toggle-group.d.ts" />;
|
50
47
|
/// <reference path="./ui/toggle.d.ts" />;
|
51
48
|
/// <reference path="./ui/tooltip.d.ts" />;
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "shadcn-packaged",
|
3
3
|
"private": false,
|
4
|
-
"version": "2025.2.
|
4
|
+
"version": "2025.2.24",
|
5
5
|
"type": "module",
|
6
6
|
"module": "index.mjs",
|
7
7
|
"scripts": {
|
@@ -24,7 +24,7 @@
|
|
24
24
|
"index.mjs"
|
25
25
|
],
|
26
26
|
"dependencies": {
|
27
|
-
"@hookform/resolvers": "^
|
27
|
+
"@hookform/resolvers": "^4.1.1",
|
28
28
|
"@radix-ui/react-accordion": "^1.2.3",
|
29
29
|
"@radix-ui/react-alert-dialog": "^1.1.6",
|
30
30
|
"@radix-ui/react-aspect-ratio": "^1.1.2",
|
@@ -48,7 +48,6 @@
|
|
48
48
|
"@radix-ui/react-slot": "^1.1.2",
|
49
49
|
"@radix-ui/react-switch": "^1.1.3",
|
50
50
|
"@radix-ui/react-tabs": "^1.1.3",
|
51
|
-
"@radix-ui/react-toast": "^1.2.6",
|
52
51
|
"@radix-ui/react-toggle": "^1.1.2",
|
53
52
|
"@radix-ui/react-toggle-group": "^1.1.2",
|
54
53
|
"@radix-ui/react-tooltip": "^1.1.8",
|
@@ -61,9 +60,9 @@
|
|
61
60
|
"react-hook-form": "^7.54.2",
|
62
61
|
"react-resizable-panels": "^2.1.7",
|
63
62
|
"recharts": "^2.15.1",
|
64
|
-
"sonner": "^
|
63
|
+
"sonner": "^2.0.1",
|
65
64
|
"vaul": "^1.1.2",
|
66
|
-
"zod": "^3.24.
|
65
|
+
"zod": "^3.24.2"
|
67
66
|
},
|
68
67
|
"devDependencies": {
|
69
68
|
"@types/node": "^22.10.7",
|
@@ -73,7 +72,7 @@
|
|
73
72
|
"clsx": "^2.1.1",
|
74
73
|
"globals": "^15.14.0",
|
75
74
|
"lucide-react": "^0.475.0",
|
76
|
-
"tailwind-merge": "^3.0.
|
75
|
+
"tailwind-merge": "^3.0.2",
|
77
76
|
"tailwindcss": "^3.4.17",
|
78
77
|
"tailwindcss-animate": "^1.0.7",
|
79
78
|
"typescript": "~5.6.2"
|
package/ui/menubar.d.ts
CHANGED
@@ -1,15 +1,10 @@
|
|
1
1
|
import * as React from "react";
|
2
2
|
import * as MenubarPrimitive from "@radix-ui/react-menubar";
|
3
|
-
declare
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
};
|
9
|
-
declare const MenubarGroup: React.ForwardRefExoticComponent<MenubarPrimitive.MenubarGroupProps & React.RefAttributes<HTMLDivElement>>;
|
10
|
-
declare const MenubarPortal: React.FC<MenubarPrimitive.MenubarPortalProps>;
|
11
|
-
declare const MenubarSub: React.FC<MenubarPrimitive.MenubarSubProps>;
|
12
|
-
declare const MenubarRadioGroup: React.ForwardRefExoticComponent<MenubarPrimitive.MenubarRadioGroupProps & React.RefAttributes<HTMLDivElement>>;
|
3
|
+
declare function MenubarMenu({ ...props }: React.ComponentProps<typeof MenubarPrimitive.Menu>): React.JSX.Element;
|
4
|
+
declare function MenubarGroup({ ...props }: React.ComponentProps<typeof MenubarPrimitive.Group>): React.JSX.Element;
|
5
|
+
declare function MenubarPortal({ ...props }: React.ComponentProps<typeof MenubarPrimitive.Portal>): React.JSX.Element;
|
6
|
+
declare function MenubarRadioGroup({ ...props }: React.ComponentProps<typeof MenubarPrimitive.RadioGroup>): React.JSX.Element;
|
7
|
+
declare function MenubarSub({ ...props }: React.ComponentProps<typeof MenubarPrimitive.Sub>): React.JSX.Element;
|
13
8
|
declare const Menubar: React.ForwardRefExoticComponent<Omit<MenubarPrimitive.MenubarProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
14
9
|
declare const MenubarTrigger: React.ForwardRefExoticComponent<Omit<MenubarPrimitive.MenubarTriggerProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
15
10
|
declare const MenubarSubTrigger: React.ForwardRefExoticComponent<Omit<MenubarPrimitive.MenubarSubTriggerProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
package/ui/menubar.jsx
CHANGED
@@ -3,11 +3,21 @@ import * as React from "react";
|
|
3
3
|
import * as MenubarPrimitive from "@radix-ui/react-menubar";
|
4
4
|
import { Check, ChevronRight, Circle } from "lucide-react";
|
5
5
|
import { cn } from "../lib/utils";
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
6
|
+
function MenubarMenu({ ...props }) {
|
7
|
+
return <MenubarPrimitive.Menu {...props}/>;
|
8
|
+
}
|
9
|
+
function MenubarGroup({ ...props }) {
|
10
|
+
return <MenubarPrimitive.Group {...props}/>;
|
11
|
+
}
|
12
|
+
function MenubarPortal({ ...props }) {
|
13
|
+
return <MenubarPrimitive.Portal {...props}/>;
|
14
|
+
}
|
15
|
+
function MenubarRadioGroup({ ...props }) {
|
16
|
+
return <MenubarPrimitive.RadioGroup {...props}/>;
|
17
|
+
}
|
18
|
+
function MenubarSub({ ...props }) {
|
19
|
+
return <MenubarPrimitive.Sub data-slot="menubar-sub" {...props}/>;
|
20
|
+
}
|
11
21
|
const Menubar = React.forwardRef(({ className, ...props }, ref) => (<MenubarPrimitive.Root ref={ref} className={cn("flex h-10 items-center space-x-1 rounded-md border bg-background p-1", className)} {...props}/>));
|
12
22
|
Menubar.displayName = MenubarPrimitive.Root.displayName;
|
13
23
|
const MenubarTrigger = React.forwardRef(({ className, ...props }, ref) => (<MenubarPrimitive.Trigger ref={ref} className={cn("flex cursor-default select-none items-center rounded-sm px-3 py-1.5 text-sm font-medium outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground", className)} {...props}/>));
|
package/ui/select.jsx
CHANGED
@@ -6,7 +6,7 @@ import { cn } from "../lib/utils";
|
|
6
6
|
const Select = SelectPrimitive.Root;
|
7
7
|
const SelectGroup = SelectPrimitive.Group;
|
8
8
|
const SelectValue = SelectPrimitive.Value;
|
9
|
-
const SelectTrigger = React.forwardRef(({ className, children, ...props }, ref) => (<SelectPrimitive.Trigger ref={ref} className={cn("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1", className)} {...props}>
|
9
|
+
const SelectTrigger = React.forwardRef(({ className, children, ...props }, ref) => (<SelectPrimitive.Trigger ref={ref} className={cn("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background data-[placeholder]:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1", className)} {...props}>
|
10
10
|
{children}
|
11
11
|
<SelectPrimitive.Icon asChild>
|
12
12
|
<ChevronDown className="h-4 w-4 opacity-50"/>
|
package/ui/sidebar.jsx
CHANGED
@@ -167,7 +167,7 @@ const SidebarGroup = React.forwardRef(({ className, ...props }, ref) => {
|
|
167
167
|
SidebarGroup.displayName = "SidebarGroup";
|
168
168
|
const SidebarGroupLabel = React.forwardRef(({ className, asChild = false, ...props }, ref) => {
|
169
169
|
const Comp = asChild ? Slot : "div";
|
170
|
-
return (<Comp ref={ref} data-sidebar="group-label" className={cn("duration-200 flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 outline-none ring-sidebar-ring transition-[margin,
|
170
|
+
return (<Comp ref={ref} data-sidebar="group-label" className={cn("duration-200 flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 outline-none ring-sidebar-ring transition-[margin,opacity] ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0", "group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0", className)} {...props}/>);
|
171
171
|
});
|
172
172
|
SidebarGroupLabel.displayName = "SidebarGroupLabel";
|
173
173
|
const SidebarGroupAction = React.forwardRef(({ className, asChild = false, ...props }, ref) => {
|
package/hooks/use-toast.d.ts
DELETED
@@ -1,44 +0,0 @@
|
|
1
|
-
import * as React from "react";
|
2
|
-
import type { ToastActionElement, ToastProps } from "../ui/toast";
|
3
|
-
type ToasterToast = ToastProps & {
|
4
|
-
id: string;
|
5
|
-
title?: React.ReactNode;
|
6
|
-
description?: React.ReactNode;
|
7
|
-
action?: ToastActionElement;
|
8
|
-
};
|
9
|
-
declare const actionTypes: {
|
10
|
-
readonly ADD_TOAST: "ADD_TOAST";
|
11
|
-
readonly UPDATE_TOAST: "UPDATE_TOAST";
|
12
|
-
readonly DISMISS_TOAST: "DISMISS_TOAST";
|
13
|
-
readonly REMOVE_TOAST: "REMOVE_TOAST";
|
14
|
-
};
|
15
|
-
type ActionType = typeof actionTypes;
|
16
|
-
type Action = {
|
17
|
-
type: ActionType["ADD_TOAST"];
|
18
|
-
toast: ToasterToast;
|
19
|
-
} | {
|
20
|
-
type: ActionType["UPDATE_TOAST"];
|
21
|
-
toast: Partial<ToasterToast>;
|
22
|
-
} | {
|
23
|
-
type: ActionType["DISMISS_TOAST"];
|
24
|
-
toastId?: ToasterToast["id"];
|
25
|
-
} | {
|
26
|
-
type: ActionType["REMOVE_TOAST"];
|
27
|
-
toastId?: ToasterToast["id"];
|
28
|
-
};
|
29
|
-
interface State {
|
30
|
-
toasts: ToasterToast[];
|
31
|
-
}
|
32
|
-
export declare const reducer: (state: State, action: Action) => State;
|
33
|
-
type Toast = Omit<ToasterToast, "id">;
|
34
|
-
declare function toast({ ...props }: Toast): {
|
35
|
-
id: string;
|
36
|
-
dismiss: () => void;
|
37
|
-
update: (props: ToasterToast) => void;
|
38
|
-
};
|
39
|
-
declare function useToast(): {
|
40
|
-
toast: typeof toast;
|
41
|
-
dismiss: (toastId?: string) => void;
|
42
|
-
toasts: ToasterToast[];
|
43
|
-
};
|
44
|
-
export { useToast, toast };
|
package/hooks/use-toast.js
DELETED
@@ -1,128 +0,0 @@
|
|
1
|
-
"use client";
|
2
|
-
// Inspired by react-hot-toast library
|
3
|
-
import * as React from "react";
|
4
|
-
const TOAST_LIMIT = 1;
|
5
|
-
const TOAST_REMOVE_DELAY = 1000000;
|
6
|
-
const actionTypes = {
|
7
|
-
ADD_TOAST: "ADD_TOAST",
|
8
|
-
UPDATE_TOAST: "UPDATE_TOAST",
|
9
|
-
DISMISS_TOAST: "DISMISS_TOAST",
|
10
|
-
REMOVE_TOAST: "REMOVE_TOAST",
|
11
|
-
};
|
12
|
-
let count = 0;
|
13
|
-
function genId() {
|
14
|
-
count = (count + 1) % Number.MAX_SAFE_INTEGER;
|
15
|
-
return count.toString();
|
16
|
-
}
|
17
|
-
const toastTimeouts = new Map();
|
18
|
-
const addToRemoveQueue = (toastId) => {
|
19
|
-
if (toastTimeouts.has(toastId)) {
|
20
|
-
return;
|
21
|
-
}
|
22
|
-
const timeout = setTimeout(() => {
|
23
|
-
toastTimeouts.delete(toastId);
|
24
|
-
dispatch({
|
25
|
-
type: "REMOVE_TOAST",
|
26
|
-
toastId: toastId,
|
27
|
-
});
|
28
|
-
}, TOAST_REMOVE_DELAY);
|
29
|
-
toastTimeouts.set(toastId, timeout);
|
30
|
-
};
|
31
|
-
export const reducer = (state, action) => {
|
32
|
-
switch (action.type) {
|
33
|
-
case "ADD_TOAST":
|
34
|
-
return {
|
35
|
-
...state,
|
36
|
-
toasts: [action.toast, ...state.toasts].slice(0, TOAST_LIMIT),
|
37
|
-
};
|
38
|
-
case "UPDATE_TOAST":
|
39
|
-
return {
|
40
|
-
...state,
|
41
|
-
toasts: state.toasts.map((t) => t.id === action.toast.id ? { ...t, ...action.toast } : t),
|
42
|
-
};
|
43
|
-
case "DISMISS_TOAST": {
|
44
|
-
const { toastId } = action;
|
45
|
-
// ! Side effects ! - This could be extracted into a dismissToast() action,
|
46
|
-
// but I'll keep it here for simplicity
|
47
|
-
if (toastId) {
|
48
|
-
addToRemoveQueue(toastId);
|
49
|
-
}
|
50
|
-
else {
|
51
|
-
state.toasts.forEach((toast) => {
|
52
|
-
addToRemoveQueue(toast.id);
|
53
|
-
});
|
54
|
-
}
|
55
|
-
return {
|
56
|
-
...state,
|
57
|
-
toasts: state.toasts.map((t) => t.id === toastId || toastId === undefined
|
58
|
-
? {
|
59
|
-
...t,
|
60
|
-
open: false,
|
61
|
-
}
|
62
|
-
: t),
|
63
|
-
};
|
64
|
-
}
|
65
|
-
case "REMOVE_TOAST":
|
66
|
-
if (action.toastId === undefined) {
|
67
|
-
return {
|
68
|
-
...state,
|
69
|
-
toasts: [],
|
70
|
-
};
|
71
|
-
}
|
72
|
-
return {
|
73
|
-
...state,
|
74
|
-
toasts: state.toasts.filter((t) => t.id !== action.toastId),
|
75
|
-
};
|
76
|
-
}
|
77
|
-
};
|
78
|
-
const listeners = [];
|
79
|
-
let memoryState = { toasts: [] };
|
80
|
-
function dispatch(action) {
|
81
|
-
memoryState = reducer(memoryState, action);
|
82
|
-
listeners.forEach((listener) => {
|
83
|
-
listener(memoryState);
|
84
|
-
});
|
85
|
-
}
|
86
|
-
function toast({ ...props }) {
|
87
|
-
const id = genId();
|
88
|
-
const update = (props) => dispatch({
|
89
|
-
type: "UPDATE_TOAST",
|
90
|
-
toast: { ...props, id },
|
91
|
-
});
|
92
|
-
const dismiss = () => dispatch({ type: "DISMISS_TOAST", toastId: id });
|
93
|
-
dispatch({
|
94
|
-
type: "ADD_TOAST",
|
95
|
-
toast: {
|
96
|
-
...props,
|
97
|
-
id,
|
98
|
-
open: true,
|
99
|
-
onOpenChange: (open) => {
|
100
|
-
if (!open)
|
101
|
-
dismiss();
|
102
|
-
},
|
103
|
-
},
|
104
|
-
});
|
105
|
-
return {
|
106
|
-
id: id,
|
107
|
-
dismiss,
|
108
|
-
update,
|
109
|
-
};
|
110
|
-
}
|
111
|
-
function useToast() {
|
112
|
-
const [state, setState] = React.useState(memoryState);
|
113
|
-
React.useEffect(() => {
|
114
|
-
listeners.push(setState);
|
115
|
-
return () => {
|
116
|
-
const index = listeners.indexOf(setState);
|
117
|
-
if (index > -1) {
|
118
|
-
listeners.splice(index, 1);
|
119
|
-
}
|
120
|
-
};
|
121
|
-
}, [state]);
|
122
|
-
return {
|
123
|
-
...state,
|
124
|
-
toast,
|
125
|
-
dismiss: (toastId) => dispatch({ type: "DISMISS_TOAST", toastId }),
|
126
|
-
};
|
127
|
-
}
|
128
|
-
export { useToast, toast };
|
package/ui/toast.d.ts
DELETED
@@ -1,15 +0,0 @@
|
|
1
|
-
import * as React from "react";
|
2
|
-
import * as ToastPrimitives from "@radix-ui/react-toast";
|
3
|
-
import { type VariantProps } from "class-variance-authority";
|
4
|
-
declare const ToastProvider: React.FC<ToastPrimitives.ToastProviderProps>;
|
5
|
-
declare const ToastViewport: React.ForwardRefExoticComponent<Omit<ToastPrimitives.ToastViewportProps & React.RefAttributes<HTMLOListElement>, "ref"> & React.RefAttributes<HTMLOListElement>>;
|
6
|
-
declare const Toast: React.ForwardRefExoticComponent<Omit<ToastPrimitives.ToastProps & React.RefAttributes<HTMLLIElement>, "ref"> & VariantProps<(props?: {
|
7
|
-
variant?: "default" | "destructive";
|
8
|
-
} & import("class-variance-authority/dist/types").ClassProp) => string> & React.RefAttributes<HTMLLIElement>>;
|
9
|
-
declare const ToastAction: React.ForwardRefExoticComponent<Omit<ToastPrimitives.ToastActionProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
10
|
-
declare const ToastClose: React.ForwardRefExoticComponent<Omit<ToastPrimitives.ToastCloseProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
11
|
-
declare const ToastTitle: React.ForwardRefExoticComponent<Omit<ToastPrimitives.ToastTitleProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
12
|
-
declare const ToastDescription: React.ForwardRefExoticComponent<Omit<ToastPrimitives.ToastDescriptionProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
13
|
-
type ToastProps = React.ComponentPropsWithoutRef<typeof Toast>;
|
14
|
-
type ToastActionElement = React.ReactElement<typeof ToastAction>;
|
15
|
-
export { type ToastProps, type ToastActionElement, ToastProvider, ToastViewport, Toast, ToastTitle, ToastDescription, ToastClose, ToastAction, };
|
package/ui/toast.jsx
DELETED
@@ -1,35 +0,0 @@
|
|
1
|
-
"use client";
|
2
|
-
import * as React from "react";
|
3
|
-
import * as ToastPrimitives from "@radix-ui/react-toast";
|
4
|
-
import { cva } from "class-variance-authority";
|
5
|
-
import { X } from "lucide-react";
|
6
|
-
import { cn } from "../lib/utils";
|
7
|
-
const ToastProvider = ToastPrimitives.Provider;
|
8
|
-
const ToastViewport = React.forwardRef(({ className, ...props }, ref) => (<ToastPrimitives.Viewport ref={ref} className={cn("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]", className)} {...props}/>));
|
9
|
-
ToastViewport.displayName = ToastPrimitives.Viewport.displayName;
|
10
|
-
const toastVariants = cva("group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full", {
|
11
|
-
variants: {
|
12
|
-
variant: {
|
13
|
-
default: "border bg-background text-foreground",
|
14
|
-
destructive: "destructive group border-destructive bg-destructive text-destructive-foreground",
|
15
|
-
},
|
16
|
-
},
|
17
|
-
defaultVariants: {
|
18
|
-
variant: "default",
|
19
|
-
},
|
20
|
-
});
|
21
|
-
const Toast = React.forwardRef(({ className, variant, ...props }, ref) => {
|
22
|
-
return (<ToastPrimitives.Root ref={ref} className={cn(toastVariants({ variant }), className)} {...props}/>);
|
23
|
-
});
|
24
|
-
Toast.displayName = ToastPrimitives.Root.displayName;
|
25
|
-
const ToastAction = React.forwardRef(({ className, ...props }, ref) => (<ToastPrimitives.Action ref={ref} className={cn("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors hover:bg-secondary focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive", className)} {...props}/>));
|
26
|
-
ToastAction.displayName = ToastPrimitives.Action.displayName;
|
27
|
-
const ToastClose = React.forwardRef(({ className, ...props }, ref) => (<ToastPrimitives.Close ref={ref} className={cn("absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-2 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600", className)} toast-close="" {...props}>
|
28
|
-
<X className="h-4 w-4"/>
|
29
|
-
</ToastPrimitives.Close>));
|
30
|
-
ToastClose.displayName = ToastPrimitives.Close.displayName;
|
31
|
-
const ToastTitle = React.forwardRef(({ className, ...props }, ref) => (<ToastPrimitives.Title ref={ref} className={cn("text-sm font-semibold", className)} {...props}/>));
|
32
|
-
ToastTitle.displayName = ToastPrimitives.Title.displayName;
|
33
|
-
const ToastDescription = React.forwardRef(({ className, ...props }, ref) => (<ToastPrimitives.Description ref={ref} className={cn("text-sm opacity-90", className)} {...props}/>));
|
34
|
-
ToastDescription.displayName = ToastPrimitives.Description.displayName;
|
35
|
-
export { ToastProvider, ToastViewport, Toast, ToastTitle, ToastDescription, ToastClose, ToastAction, };
|
package/ui/toaster.d.ts
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
export declare function Toaster(): import("react").JSX.Element;
|
package/ui/toaster.jsx
DELETED
@@ -1,19 +0,0 @@
|
|
1
|
-
"use client";
|
2
|
-
import { useToast } from "../hooks/use-toast";
|
3
|
-
import { Toast, ToastClose, ToastDescription, ToastProvider, ToastTitle, ToastViewport, } from "../ui/toast";
|
4
|
-
export function Toaster() {
|
5
|
-
const { toasts } = useToast();
|
6
|
-
return (<ToastProvider>
|
7
|
-
{toasts.map(function ({ id, title, description, action, ...props }) {
|
8
|
-
return (<Toast key={id} {...props}>
|
9
|
-
<div className="grid gap-1">
|
10
|
-
{title && <ToastTitle>{title}</ToastTitle>}
|
11
|
-
{description && (<ToastDescription>{description}</ToastDescription>)}
|
12
|
-
</div>
|
13
|
-
{action}
|
14
|
-
<ToastClose />
|
15
|
-
</Toast>);
|
16
|
-
})}
|
17
|
-
<ToastViewport />
|
18
|
-
</ToastProvider>);
|
19
|
-
}
|