@brainfish-ai/components 0.16.3 → 0.16.4
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/alert-dialog.d.ts
CHANGED
|
@@ -3,12 +3,14 @@ import { ClassProp } from 'class-variance-authority/dist/types';
|
|
|
3
3
|
import * as React_2 from 'react';
|
|
4
4
|
import { VariantProps } from 'class-variance-authority';
|
|
5
5
|
|
|
6
|
-
export declare const AlertDialog: React_2.
|
|
6
|
+
export declare const AlertDialog: React_2.ForwardRefExoticComponent<AlertDialogPrimitive.AlertDialogProps & React_2.RefAttributes<never>>;
|
|
7
7
|
|
|
8
8
|
export declare const AlertDialogAction: React_2.ForwardRefExoticComponent<Omit<AlertDialogPrimitive.AlertDialogActionProps & React_2.RefAttributes<HTMLButtonElement>, "ref"> & VariantProps<(props?: ({
|
|
9
9
|
variant?: "link" | "dark" | "default" | "destructive" | "outline" | "secondary" | "ghost" | "shadow" | null | undefined;
|
|
10
10
|
size?: "default" | "icon" | "sm" | "lg" | null | undefined;
|
|
11
|
-
} & ClassProp) | undefined) => string> &
|
|
11
|
+
} & ClassProp) | undefined) => string> & {
|
|
12
|
+
asChild?: boolean | undefined;
|
|
13
|
+
} & React_2.RefAttributes<HTMLButtonElement>>;
|
|
12
14
|
|
|
13
15
|
export declare const AlertDialogCancel: React_2.ForwardRefExoticComponent<Omit<AlertDialogPrimitive.AlertDialogCancelProps & React_2.RefAttributes<HTMLButtonElement>, "ref"> & VariantProps<(props?: ({
|
|
14
16
|
variant?: "link" | "dark" | "default" | "destructive" | "outline" | "secondary" | "ghost" | "shadow" | null | undefined;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { VariantProps } from 'class-variance-authority';
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
import * as AlertDialogPrimitive from "@radix-ui/react-alert-dialog";
|
|
4
|
-
declare const AlertDialog: React.
|
|
4
|
+
declare const AlertDialog: React.ForwardRefExoticComponent<AlertDialogPrimitive.AlertDialogProps & React.RefAttributes<never>>;
|
|
5
5
|
declare const AlertDialogTrigger: React.ForwardRefExoticComponent<AlertDialogPrimitive.AlertDialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
6
6
|
declare const AlertDialogPortal: React.FC<AlertDialogPrimitive.AlertDialogPortalProps>;
|
|
7
7
|
declare const AlertDialogOverlay: React.ForwardRefExoticComponent<Omit<AlertDialogPrimitive.AlertDialogOverlayProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
@@ -23,7 +23,9 @@ declare const AlertDialogDescription: React.ForwardRefExoticComponent<Omit<Alert
|
|
|
23
23
|
declare const AlertDialogAction: React.ForwardRefExoticComponent<Omit<AlertDialogPrimitive.AlertDialogActionProps & React.RefAttributes<HTMLButtonElement>, "ref"> & VariantProps<(props?: ({
|
|
24
24
|
variant?: "link" | "dark" | "default" | "destructive" | "outline" | "secondary" | "ghost" | "shadow" | null | undefined;
|
|
25
25
|
size?: "default" | "icon" | "sm" | "lg" | null | undefined;
|
|
26
|
-
} & import('class-variance-authority/dist/types').ClassProp) | undefined) => string> &
|
|
26
|
+
} & import('class-variance-authority/dist/types').ClassProp) | undefined) => string> & {
|
|
27
|
+
asChild?: boolean | undefined;
|
|
28
|
+
} & React.RefAttributes<HTMLButtonElement>>;
|
|
27
29
|
declare const AlertDialogCancel: React.ForwardRefExoticComponent<Omit<AlertDialogPrimitive.AlertDialogCancelProps & React.RefAttributes<HTMLButtonElement>, "ref"> & VariantProps<(props?: ({
|
|
28
30
|
variant?: "link" | "dark" | "default" | "destructive" | "outline" | "secondary" | "ghost" | "shadow" | null | undefined;
|
|
29
31
|
size?: "default" | "icon" | "sm" | "lg" | null | undefined;
|
package/dist/confirm-dialog.d.ts
CHANGED
|
@@ -7,7 +7,9 @@ import { VariantProps } from 'class-variance-authority';
|
|
|
7
7
|
declare const AlertDialogAction: React_2.ForwardRefExoticComponent<Omit<AlertDialogPrimitive.AlertDialogActionProps & React_2.RefAttributes<HTMLButtonElement>, "ref"> & VariantProps<(props?: ({
|
|
8
8
|
variant?: "link" | "dark" | "default" | "destructive" | "outline" | "secondary" | "ghost" | "shadow" | null | undefined;
|
|
9
9
|
size?: "default" | "icon" | "sm" | "lg" | null | undefined;
|
|
10
|
-
} & ClassProp) | undefined) => string> &
|
|
10
|
+
} & ClassProp) | undefined) => string> & {
|
|
11
|
+
asChild?: boolean | undefined;
|
|
12
|
+
} & React_2.RefAttributes<HTMLButtonElement>>;
|
|
11
13
|
|
|
12
14
|
export declare const ConfirmDialog: default_2.ForwardRefExoticComponent<Props & default_2.RefAttributes<ConfirmDialogRef>>;
|
|
13
15
|
|
|
@@ -3,7 +3,20 @@ import * as AlertDialogPrimitive from '@radix-ui/react-alert-dialog';
|
|
|
3
3
|
import { c as cn } from '../../chunks/utils.DaMF_LVC.js';
|
|
4
4
|
import { buttonVariants } from './button.js';
|
|
5
5
|
|
|
6
|
-
const
|
|
6
|
+
const AlertDialogContext = React.createContext({});
|
|
7
|
+
const AlertDialog = React.forwardRef(({ onOpenChange, ...props }, _ref) => {
|
|
8
|
+
const handleClose = React.useCallback(() => {
|
|
9
|
+
onOpenChange?.(false);
|
|
10
|
+
}, [onOpenChange]);
|
|
11
|
+
return /* @__PURE__ */ React.createElement(AlertDialogContext.Provider, { value: { onClose: handleClose } }, /* @__PURE__ */ React.createElement(
|
|
12
|
+
AlertDialogPrimitive.Root,
|
|
13
|
+
{
|
|
14
|
+
onOpenChange,
|
|
15
|
+
...props
|
|
16
|
+
}
|
|
17
|
+
));
|
|
18
|
+
});
|
|
19
|
+
AlertDialog.displayName = AlertDialogPrimitive.Root.displayName;
|
|
7
20
|
const AlertDialogTrigger = AlertDialogPrimitive.Trigger;
|
|
8
21
|
const AlertDialogPortal = AlertDialogPrimitive.Portal;
|
|
9
22
|
const AlertDialogOverlay = React.forwardRef(({ className, zIndex, ...props }, ref) => /* @__PURE__ */ React.createElement(
|
|
@@ -78,14 +91,43 @@ const AlertDialogDescription = React.forwardRef(({ className, ...props }, ref) =
|
|
|
78
91
|
}
|
|
79
92
|
));
|
|
80
93
|
AlertDialogDescription.displayName = AlertDialogPrimitive.Description.displayName;
|
|
81
|
-
const AlertDialogAction = React.forwardRef(({ className, variant, ...props }, ref) =>
|
|
82
|
-
|
|
83
|
-
{
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
94
|
+
const AlertDialogAction = React.forwardRef(({ className, variant, asChild, onClick, ...props }, ref) => {
|
|
95
|
+
const { onClose } = React.useContext(AlertDialogContext);
|
|
96
|
+
const handleClick = React.useCallback(async (event) => {
|
|
97
|
+
if (!onClick) return;
|
|
98
|
+
const result = onClick(event);
|
|
99
|
+
const isPromise = (value) => value != null && typeof value === "object" && "then" in value;
|
|
100
|
+
if (isPromise(result)) {
|
|
101
|
+
event.preventDefault();
|
|
102
|
+
try {
|
|
103
|
+
await result;
|
|
104
|
+
onClose?.();
|
|
105
|
+
} catch (error) {
|
|
106
|
+
console.error("AlertDialogAction onClick failed:", error);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}, [onClick, onClose]);
|
|
110
|
+
if (asChild) {
|
|
111
|
+
return /* @__PURE__ */ React.createElement(
|
|
112
|
+
AlertDialogPrimitive.Action,
|
|
113
|
+
{
|
|
114
|
+
ref,
|
|
115
|
+
className: cn(buttonVariants({ variant }), className),
|
|
116
|
+
onClick: handleClick,
|
|
117
|
+
...props
|
|
118
|
+
}
|
|
119
|
+
);
|
|
87
120
|
}
|
|
88
|
-
|
|
121
|
+
return /* @__PURE__ */ React.createElement(
|
|
122
|
+
AlertDialogPrimitive.Action,
|
|
123
|
+
{
|
|
124
|
+
ref,
|
|
125
|
+
className: cn(buttonVariants({ variant }), className),
|
|
126
|
+
onClick: handleClick,
|
|
127
|
+
...props
|
|
128
|
+
}
|
|
129
|
+
);
|
|
130
|
+
});
|
|
89
131
|
AlertDialogAction.displayName = AlertDialogPrimitive.Action.displayName;
|
|
90
132
|
const AlertDialogCancel = React.forwardRef(({ className, variant, ...props }, ref) => /* @__PURE__ */ React.createElement(
|
|
91
133
|
AlertDialogPrimitive.Cancel,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alert-dialog.js","sources":["../../../../src/components/ui/alert-dialog.tsx"],"sourcesContent":["import * as React from \"react\"\nimport * as AlertDialogPrimitive from \"@radix-ui/react-alert-dialog\"\n\nimport { cn } from \"@/lib/utils\"\nimport { buttonVariants } from \"@/components/ui/button\"\nimport { VariantProps } from \"class-variance-authority\"\n\nconst AlertDialog = AlertDialogPrimitive.Root\n\nconst AlertDialogTrigger = AlertDialogPrimitive.Trigger\n\nconst AlertDialogPortal = AlertDialogPrimitive.Portal\n\nconst AlertDialogOverlay = React.forwardRef<\n React.ElementRef<typeof AlertDialogPrimitive.Overlay>,\n React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Overlay> & {\n zIndex?: string\n }\n>(({ className, zIndex, ...props }, ref) => (\n <AlertDialogPrimitive.Overlay\n className={cn(\n \"fixed inset-0 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\",\n zIndex || \"z-50\",\n className\n )}\n {...props}\n ref={ref}\n />\n))\nAlertDialogOverlay.displayName = AlertDialogPrimitive.Overlay.displayName\n\nconst AlertDialogContent = React.forwardRef<\n React.ElementRef<typeof AlertDialogPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Content> & {\n zIndex?: string\n }\n>(({ className, zIndex, ...props }, ref) => (\n <AlertDialogPortal>\n <AlertDialogOverlay zIndex={zIndex} />\n <AlertDialogPrimitive.Content\n ref={ref}\n className={cn(\n \"fixed left-[50%] top-[50%] grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] border border-border bg-background p-0 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-md\",\n zIndex || \"z-50\",\n className\n )}\n {...props}\n />\n </AlertDialogPortal>\n))\nAlertDialogContent.displayName = AlertDialogPrimitive.Content.displayName\n\nconst AlertDialogHeader = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n className={cn(\n \"flex flex-col text-center sm:text-left\",\n className\n )}\n {...props}\n />\n)\nAlertDialogHeader.displayName = \"AlertDialogHeader\"\n\nconst AlertDialogFooter = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n className={cn(\n \"flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2 pb-4 px-4\",\n className\n )}\n {...props}\n />\n)\nAlertDialogFooter.displayName = \"AlertDialogFooter\"\n\nconst AlertDialogTitle = React.forwardRef<\n React.ElementRef<typeof AlertDialogPrimitive.Title>,\n React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Title>\n>(({ className, ...props }, ref) => (\n <AlertDialogPrimitive.Title\n ref={ref}\n className={cn(\"text-lg font-medium px-4 my-0 h-12 flex items-center\", className)}\n {...props}\n />\n))\nAlertDialogTitle.displayName = AlertDialogPrimitive.Title.displayName\n\nconst AlertDialogDescription = React.forwardRef<\n React.ElementRef<typeof AlertDialogPrimitive.Description>,\n React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Description>\n>(({ className, ...props }, ref) => (\n <AlertDialogPrimitive.Description\n ref={ref}\n className={cn(\"text-sm px-4 py-3 my-0\", className)}\n {...props}\n />\n))\nAlertDialogDescription.displayName =\n AlertDialogPrimitive.Description.displayName\n\nconst AlertDialogAction = React.forwardRef<\n React.ElementRef<typeof AlertDialogPrimitive.Action>,\n React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Action> & VariantProps<typeof buttonVariants>\n>(({ className, variant, ...props }, ref) => (\n <AlertDialogPrimitive.Action\n ref={ref}\n className={cn(buttonVariants({ variant }), className)}\n {...props}\n />\n))\nAlertDialogAction.displayName = AlertDialogPrimitive.Action.displayName\n\nconst AlertDialogCancel = React.forwardRef<\n React.ElementRef<typeof AlertDialogPrimitive.Cancel>,\n React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Cancel> & VariantProps<typeof buttonVariants>\n>(({ className, variant, ...props }, ref) => (\n <AlertDialogPrimitive.Cancel\n ref={ref}\n className={cn(\n buttonVariants({ variant: variant || \"link\" }),\n \"mt-2 sm:mt-0 text-foreground\",\n className\n )}\n {...props}\n />\n))\nAlertDialogCancel.displayName = AlertDialogPrimitive.Cancel.displayName\n\nexport {\n AlertDialog,\n AlertDialogPortal,\n AlertDialogOverlay,\n AlertDialogTrigger,\n AlertDialogContent,\n AlertDialogHeader,\n AlertDialogFooter,\n AlertDialogTitle,\n AlertDialogDescription,\n AlertDialogAction,\n AlertDialogCancel,\n}\n"],"names":[],"mappings":";;;;;AAOA,MAAM,cAAc,oBAAqB,CAAA;AAEzC,MAAM,qBAAqB,oBAAqB,CAAA;AAEhD,MAAM,oBAAoB,oBAAqB,CAAA;AAEzC,MAAA,kBAAA,GAAqB,KAAM,CAAA,UAAA,CAK/B,CAAC,EAAE,WAAW,MAAQ,EAAA,GAAG,KAAM,EAAA,EAAG,GAClC,qBAAA,KAAA,CAAA,aAAA;AAAA,EAAC,oBAAqB,CAAA,OAAA;AAAA,EAArB;AAAA,IACC,SAAW,EAAA,EAAA;AAAA,MACT,mJAAA;AAAA,MACA,MAAU,IAAA,MAAA;AAAA,MACV;AAAA,KACF;AAAA,IACC,GAAG,KAAA;AAAA,IACJ;AAAA;AACF,CACD;AACD,kBAAmB,CAAA,WAAA,GAAc,qBAAqB,OAAQ,CAAA,WAAA;AAE9D,MAAM,qBAAqB,KAAM,CAAA,UAAA,CAK/B,CAAC,EAAE,WAAW,MAAQ,EAAA,GAAG,KAAM,EAAA,EAAG,wBACjC,KAAA,CAAA,a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Content":["import * as React from \"react\"\nimport * as AlertDialogPrimitive from \"@radix-ui/react-alert-dialog\"\n\nimport { cn } from \"@/lib/utils\"\nimport { buttonVariants } from \"@/components/ui/button\"\nimport { VariantProps } from \"class-variance-authority\"\n\n// Context to provide dialog close function\nconst AlertDialogContext = React.createContext<{\n onClose?: () => void;\n}>({});\n\nconst AlertDialog = React.forwardRef<\n React.ElementRef<typeof AlertDialogPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Root>\n>(({ onOpenChange, ...props }, _ref) => {\n const handleClose = React.useCallback(() => {\n onOpenChange?.(false);\n }, [onOpenChange]);\n\n return (\n <AlertDialogContext.Provider value={{ onClose: handleClose }}>\n <AlertDialogPrimitive.Root\n onOpenChange={onOpenChange}\n {...props}\n />\n </AlertDialogContext.Provider>\n );\n});\nAlertDialog.displayName = AlertDialogPrimitive.Root.displayName;\n\nconst AlertDialogTrigger = AlertDialogPrimitive.Trigger\n\nconst AlertDialogPortal = AlertDialogPrimitive.Portal\n\nconst AlertDialogOverlay = React.forwardRef<\n React.ElementRef<typeof AlertDialogPrimitive.Overlay>,\n React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Overlay> & {\n zIndex?: string\n }\n>(({ className, zIndex, ...props }, ref) => (\n <AlertDialogPrimitive.Overlay\n className={cn(\n \"fixed inset-0 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\",\n zIndex || \"z-50\",\n className\n )}\n {...props}\n ref={ref}\n />\n))\nAlertDialogOverlay.displayName = AlertDialogPrimitive.Overlay.displayName\n\nconst AlertDialogContent = React.forwardRef<\n React.ElementRef<typeof AlertDialogPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Content> & {\n zIndex?: string\n }\n>(({ className, zIndex, ...props }, ref) => (\n <AlertDialogPortal>\n <AlertDialogOverlay zIndex={zIndex} />\n <AlertDialogPrimitive.Content\n ref={ref}\n className={cn(\n \"fixed left-[50%] top-[50%] grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] border border-border bg-background p-0 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-md\",\n zIndex || \"z-50\",\n className\n )}\n {...props}\n />\n </AlertDialogPortal>\n))\nAlertDialogContent.displayName = AlertDialogPrimitive.Content.displayName\n\nconst AlertDialogHeader = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n className={cn(\n \"flex flex-col text-center sm:text-left\",\n className\n )}\n {...props}\n />\n)\nAlertDialogHeader.displayName = \"AlertDialogHeader\"\n\nconst AlertDialogFooter = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n className={cn(\n \"flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2 pb-4 px-4\",\n className\n )}\n {...props}\n />\n)\nAlertDialogFooter.displayName = \"AlertDialogFooter\"\n\nconst AlertDialogTitle = React.forwardRef<\n React.ElementRef<typeof AlertDialogPrimitive.Title>,\n React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Title>\n>(({ className, ...props }, ref) => (\n <AlertDialogPrimitive.Title\n ref={ref}\n className={cn(\"text-lg font-medium px-4 my-0 h-12 flex items-center\", className)}\n {...props}\n />\n))\nAlertDialogTitle.displayName = AlertDialogPrimitive.Title.displayName\n\nconst AlertDialogDescription = React.forwardRef<\n React.ElementRef<typeof AlertDialogPrimitive.Description>,\n React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Description>\n>(({ className, ...props }, ref) => (\n <AlertDialogPrimitive.Description\n ref={ref}\n className={cn(\"text-sm px-4 py-3 my-0\", className)}\n {...props}\n />\n))\nAlertDialogDescription.displayName =\n AlertDialogPrimitive.Description.displayName\n\nconst AlertDialogAction = React.forwardRef<\n React.ElementRef<typeof AlertDialogPrimitive.Action>,\n React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Action> & VariantProps<typeof buttonVariants> & {\n asChild?: boolean;\n }\n>(({ className, variant, asChild, onClick, ...props }, ref) => {\n const { onClose } = React.useContext(AlertDialogContext);\n\n const handleClick = React.useCallback(async (event: React.MouseEvent<HTMLButtonElement>) => {\n if (!onClick) return;\n\n const result = onClick(event);\n const isPromise = (value: unknown): value is Promise<unknown> =>\n value != null && typeof value === 'object' && 'then' in value;\n\n if (isPromise(result)) {\n event.preventDefault();\n try {\n await result;\n onClose?.();\n } catch (error) {\n console.error('AlertDialogAction onClick failed:', error);\n }\n }\n }, [onClick, onClose]);\n\n if (asChild) {\n return (\n <AlertDialogPrimitive.Action\n ref={ref}\n className={cn(buttonVariants({ variant }), className)}\n onClick={handleClick}\n {...props}\n />\n )\n }\n\n return (\n <AlertDialogPrimitive.Action\n ref={ref}\n className={cn(buttonVariants({ variant }), className)}\n onClick={handleClick}\n {...props}\n />\n )\n})\nAlertDialogAction.displayName = AlertDialogPrimitive.Action.displayName\n\nconst AlertDialogCancel = React.forwardRef<\n React.ElementRef<typeof AlertDialogPrimitive.Cancel>,\n React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Cancel> & VariantProps<typeof buttonVariants>\n>(({ className, variant, ...props }, ref) => (\n <AlertDialogPrimitive.Cancel\n ref={ref}\n className={cn(\n buttonVariants({ variant: variant || \"link\" }),\n \"mt-2 sm:mt-0 text-foreground\",\n className\n )}\n {...props}\n />\n))\nAlertDialogCancel.displayName = AlertDialogPrimitive.Cancel.displayName\n\nexport {\n AlertDialog,\n AlertDialogPortal,\n AlertDialogOverlay,\n AlertDialogTrigger,\n AlertDialogContent,\n AlertDialogHeader,\n AlertDialogFooter,\n AlertDialogTitle,\n AlertDialogDescription,\n AlertDialogAction,\n AlertDialogCancel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