@brainfish-ai/components 0.35.15 → 0.35.17

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.
@@ -22,7 +22,7 @@ export declare const AlertDialogCancel: React_2.ForwardRefExoticComponent<Omit<A
22
22
  } & ClassProp) | undefined) => string> & React_2.RefAttributes<HTMLButtonElement>>;
23
23
 
24
24
  export declare const AlertDialogContent: React_2.ForwardRefExoticComponent<Omit<AlertDialogPrimitive.AlertDialogContentProps & React_2.RefAttributes<HTMLDivElement>, "ref"> & {
25
- zIndex?: string;
25
+ zIndex?: number;
26
26
  } & React_2.RefAttributes<HTMLDivElement>>;
27
27
 
28
28
  export declare const AlertDialogDescription: React_2.ForwardRefExoticComponent<Omit<AlertDialogPrimitive.AlertDialogDescriptionProps & React_2.RefAttributes<HTMLParagraphElement>, "ref"> & React_2.RefAttributes<HTMLParagraphElement>>;
@@ -38,7 +38,7 @@ export declare const AlertDialogHeader: {
38
38
  };
39
39
 
40
40
  export declare const AlertDialogOverlay: React_2.ForwardRefExoticComponent<Omit<AlertDialogPrimitive.AlertDialogOverlayProps & React_2.RefAttributes<HTMLDivElement>, "ref"> & {
41
- zIndex?: string;
41
+ zIndex?: number;
42
42
  } & React_2.RefAttributes<HTMLDivElement>>;
43
43
 
44
44
  export declare const AlertDialogPortal: React_2.FC<AlertDialogPrimitive.AlertDialogPortalProps>;
@@ -1,5 +1,8 @@
1
1
  import { default as default_2 } from 'react';
2
2
 
3
- export declare const EditableLabel: default_2.ForwardRefExoticComponent<Omit<default_2.DetailedHTMLProps<default_2.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & default_2.RefAttributes<HTMLSpanElement>>;
3
+ export declare const EditableLabel: default_2.ForwardRefExoticComponent<Omit<default_2.DetailedHTMLProps<default_2.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & {
4
+ placeholder?: string;
5
+ required?: boolean;
6
+ } & default_2.RefAttributes<HTMLSpanElement>>;
4
7
 
5
8
  export { }
@@ -1,3 +1,3 @@
1
- import e from"react";import{AlertDialog as t,AlertDialogContent as n,AlertDialogHeader as a,AlertDialogTitle as l,AlertDialogDescription as r,AlertDialogFooter as i,AlertDialogCancel as o,AlertDialogAction as c}from"./ui/alert-dialog.js";const m=e.forwardRef(({title:m,description:d,onSubmit:s,onCancel:p,open:u,onOpenChange:E,variant:f,cancelText:x,submitText:C,loadingText:g,zIndex:b=50},v)=>{const y=b?`z-[${b}]`:void 0,[z,I]=e.useState(!1),[S,T]=e.useState(!1),h=u??S,k=E??T;e.useImperativeHandle(v,()=>({open:()=>k(!0),close:()=>k(!1)}));/* @__PURE__ */
2
- return e.createElement(t,{open:h,onOpenChange:k},/* @__PURE__ */e.createElement(n,{zIndex:y},/* @__PURE__ */e.createElement(a,null,/* @__PURE__ */e.createElement(l,null,m),/* @__PURE__ */e.createElement(r,null,d)),/* @__PURE__ */e.createElement(i,null,/* @__PURE__ */e.createElement(o,{onClick:()=>{z||(p?.(),k(!1))},disabled:z},x),/* @__PURE__ */e.createElement(c,{variant:f,onClick:async()=>{if(!z){I(!0);try{await s(),k(!1)}finally{I(!1)}}},disabled:z},z&&g||C))))});m.displayName="ConfirmDialog";export{m as ConfirmDialog};
1
+ import e from"react";import{AlertDialog as t,AlertDialogContent as n,AlertDialogHeader as a,AlertDialogTitle as l,AlertDialogDescription as r,AlertDialogFooter as i,AlertDialogCancel as o,AlertDialogAction as c}from"./ui/alert-dialog.js";const m=e.forwardRef(({title:m,description:s,onSubmit:d,onCancel:p,open:u,onOpenChange:E,variant:f,cancelText:x,submitText:C,loadingText:g,zIndex:b=50},y)=>{const[v,I]=e.useState(!1),[S,T]=e.useState(!1),h=u??S,k=E??T;e.useImperativeHandle(y,()=>({open:()=>k(!0),close:()=>k(!1)}));/* @__PURE__ */
2
+ return e.createElement(t,{open:h,onOpenChange:k},/* @__PURE__ */e.createElement(n,{zIndex:b},/* @__PURE__ */e.createElement(a,null,/* @__PURE__ */e.createElement(l,null,m),/* @__PURE__ */e.createElement(r,null,s)),/* @__PURE__ */e.createElement(i,null,/* @__PURE__ */e.createElement(o,{onClick:()=>{v||(p?.(),k(!1))},disabled:v},x),/* @__PURE__ */e.createElement(c,{variant:f,onClick:async()=>{if(!v){I(!0);try{await d(),k(!1)}finally{I(!1)}}},disabled:v},v&&g||C))))});m.displayName="ConfirmDialog";export{m as ConfirmDialog};
3
3
  //# sourceMappingURL=confirm-dialog.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"confirm-dialog.js","sources":["../../../src/components/confirm-dialog/confirm-dialog.tsx"],"sourcesContent":["import React from 'react';\n\nimport {\n AlertDialog,\n AlertDialogTitle,\n AlertDialogDescription,\n AlertDialogHeader,\n AlertDialogCancel,\n AlertDialogAction,\n AlertDialogFooter,\n AlertDialogContent,\n} from '../ui/alert-dialog';\n\ninterface Props {\n title: string;\n description: React.ReactNode;\n onSubmit: () => Promise<void> | void;\n onCancel?: () => void;\n // Optional external state control - if not provided, manages state internally\n open?: boolean;\n onOpenChange?: (open: boolean) => void;\n variant: React.ComponentProps<typeof AlertDialogAction>['variant'];\n cancelText: string;\n submitText: string;\n loadingText?: string;\n zIndex?: number; // z-index of the dialog\n}\n\nexport interface ConfirmDialogRef {\n open: () => void;\n close: () => void;\n}\n\nexport const ConfirmDialog = React.forwardRef<ConfirmDialogRef, Props>(\n (\n {\n title,\n description,\n onSubmit,\n onCancel,\n open: externalOpen,\n onOpenChange: externalOnOpenChange,\n variant,\n cancelText,\n submitText,\n loadingText,\n zIndex = 50,\n },\n ref,\n ) => {\n const zIndexClass = zIndex ? `z-[${zIndex}]` : undefined;\n const [isLoading, setIsLoading] = React.useState(false);\n\n // Internal state management (merged from useDialogState)\n const [internalOpen, setInternalOpen] = React.useState(false);\n\n // Use external state if provided, otherwise use internal state\n const isOpen = externalOpen ?? internalOpen;\n const setIsOpen = externalOnOpenChange ?? setInternalOpen;\n\n // Expose methods via ref for programmatic control\n React.useImperativeHandle(ref, () => ({\n open: () => setIsOpen(true),\n close: () => setIsOpen(false),\n }));\n\n const handleCancel = () => {\n if (isLoading) return; // Prevent cancel during loading\n onCancel?.();\n setIsOpen(false);\n };\n\n const handleSubmit = async () => {\n if (isLoading) return; // Prevent double submission\n\n setIsLoading(true);\n try {\n await onSubmit();\n setIsOpen(false); // Close dialog after successful submission\n } finally {\n setIsLoading(false);\n }\n };\n\n return (\n <AlertDialog open={isOpen} onOpenChange={setIsOpen}>\n <AlertDialogContent zIndex={zIndexClass}>\n <AlertDialogHeader>\n <AlertDialogTitle>{title}</AlertDialogTitle>\n <AlertDialogDescription>{description}</AlertDialogDescription>\n </AlertDialogHeader>\n <AlertDialogFooter>\n <AlertDialogCancel onClick={handleCancel} disabled={isLoading}>\n {cancelText}\n </AlertDialogCancel>\n <AlertDialogAction variant={variant} onClick={handleSubmit} disabled={isLoading}>\n {isLoading ? loadingText || submitText : submitText}\n </AlertDialogAction>\n </AlertDialogFooter>\n </AlertDialogContent>\n </AlertDialog>\n );\n },\n);\n\nConfirmDialog.displayName = 'ConfirmDialog';\n"],"names":["ConfirmDialog","React","forwardRef","title","description","onSubmit","onCancel","open","externalOpen","onOpenChange","externalOnOpenChange","variant","cancelText","submitText","loadingText","zIndex","ref","zIndexClass","isLoading","setIsLoading","useState","internalOpen","setInternalOpen","isOpen","setIsOpen","useImperativeHandle","close","createElement","AlertDialog","AlertDialogContent","AlertDialogHeader","AlertDialogTitle","AlertDialogDescription","AlertDialogFooter","AlertDialogCancel","onClick","disabled","AlertDialogAction","async","displayName"],"mappings":"8OAiCO,MAAMA,EAAgBC,EAAMC,WACjC,EAEIC,QACAC,cACAC,WACAC,WACAC,KAAMC,EACNC,aAAcC,EACdC,UACAC,aACAC,aACAC,cACAC,SAAS,IAEXC,KAEA,MAAMC,EAAcF,EAAS,MAAMA,UAAY,GACxCG,EAAWC,GAAgBlB,EAAMmB,UAAS,IAG1CC,EAAcC,GAAmBrB,EAAMmB,UAAS,GAGjDG,EAASf,GAAgBa,EACzBG,EAAYd,GAAwBY,EAG1CrB,EAAMwB,oBAAoBT,EAAK,KAAA,CAC7BT,KAAM,IAAMiB,GAAU,GACtBE,MAAO,IAAMF,GAAU;AAqBzB,OACEvB,EAAA0B,cAACC,GAAYrB,KAAMgB,EAAQd,aAAce,kBACvCvB,EAAA0B,cAACE,GAAmBd,OAAQE,kCACzBa,EAAA,oBACC7B,EAAA0B,cAACI,OAAkB5B,kCAClB6B,EAAA,KAAwB5B,mBAE3BH,EAAA0B,cAACM,sBACChC,EAAA0B,cAACO,EAAA,CAAkBC,QA1BN,KACfjB,IACJZ,MACAkB,GAAU,KAuBsCY,SAAUlB,GACjDN,kCAEFyB,EAAA,CAAkB1B,UAAkBwB,QAvBxBG,UACnB,IAAIpB,EAAJ,CAEAC,GAAa,GACb,UACQd,IACNmB,GAAU,EACZ,CAAA,QACEL,GAAa,EACf,CARe,GAsBmDiB,SAAUlB,GACnEA,GAAYJ,GAA4BD,QASvDb,EAAcuC,YAAc"}
1
+ {"version":3,"file":"confirm-dialog.js","sources":["../../../src/components/confirm-dialog/confirm-dialog.tsx"],"sourcesContent":["import React from 'react';\n\nimport {\n AlertDialog,\n AlertDialogTitle,\n AlertDialogDescription,\n AlertDialogHeader,\n AlertDialogCancel,\n AlertDialogAction,\n AlertDialogFooter,\n AlertDialogContent,\n} from '../ui/alert-dialog';\n\ninterface Props {\n title: string;\n description: React.ReactNode;\n onSubmit: () => Promise<void> | void;\n onCancel?: () => void;\n // Optional external state control - if not provided, manages state internally\n open?: boolean;\n onOpenChange?: (open: boolean) => void;\n variant: React.ComponentProps<typeof AlertDialogAction>['variant'];\n cancelText: string;\n submitText: string;\n loadingText?: string;\n zIndex?: number; // z-index of the dialog\n}\n\nexport interface ConfirmDialogRef {\n open: () => void;\n close: () => void;\n}\n\nexport const ConfirmDialog = React.forwardRef<ConfirmDialogRef, Props>(\n (\n {\n title,\n description,\n onSubmit,\n onCancel,\n open: externalOpen,\n onOpenChange: externalOnOpenChange,\n variant,\n cancelText,\n submitText,\n loadingText,\n zIndex = 50,\n },\n ref,\n ) => {\n const [isLoading, setIsLoading] = React.useState(false);\n\n // Internal state management (merged from useDialogState)\n const [internalOpen, setInternalOpen] = React.useState(false);\n\n // Use external state if provided, otherwise use internal state\n const isOpen = externalOpen ?? internalOpen;\n const setIsOpen = externalOnOpenChange ?? setInternalOpen;\n\n // Expose methods via ref for programmatic control\n React.useImperativeHandle(ref, () => ({\n open: () => setIsOpen(true),\n close: () => setIsOpen(false),\n }));\n\n const handleCancel = () => {\n if (isLoading) return; // Prevent cancel during loading\n onCancel?.();\n setIsOpen(false);\n };\n\n const handleSubmit = async () => {\n if (isLoading) return; // Prevent double submission\n\n setIsLoading(true);\n try {\n await onSubmit();\n setIsOpen(false); // Close dialog after successful submission\n } finally {\n setIsLoading(false);\n }\n };\n\n return (\n <AlertDialog open={isOpen} onOpenChange={setIsOpen}>\n <AlertDialogContent zIndex={zIndex}>\n <AlertDialogHeader>\n <AlertDialogTitle>{title}</AlertDialogTitle>\n <AlertDialogDescription>{description}</AlertDialogDescription>\n </AlertDialogHeader>\n <AlertDialogFooter>\n <AlertDialogCancel onClick={handleCancel} disabled={isLoading}>\n {cancelText}\n </AlertDialogCancel>\n <AlertDialogAction variant={variant} onClick={handleSubmit} disabled={isLoading}>\n {isLoading ? loadingText || submitText : submitText}\n </AlertDialogAction>\n </AlertDialogFooter>\n </AlertDialogContent>\n </AlertDialog>\n );\n },\n);\n\nConfirmDialog.displayName = 'ConfirmDialog';\n"],"names":["ConfirmDialog","React","forwardRef","title","description","onSubmit","onCancel","open","externalOpen","onOpenChange","externalOnOpenChange","variant","cancelText","submitText","loadingText","zIndex","ref","isLoading","setIsLoading","useState","internalOpen","setInternalOpen","isOpen","setIsOpen","useImperativeHandle","close","AlertDialog","AlertDialogContent","AlertDialogHeader","createElement","AlertDialogTitle","AlertDialogDescription","AlertDialogFooter","AlertDialogCancel","onClick","disabled","AlertDialogAction","async","displayName"],"mappings":"8OAiCO,MAAMA,EAAgBC,EAAMC,WACjC,EAEIC,QACAC,cACAC,WACAC,WACAC,KAAMC,EACNC,aAAcC,EACdC,UACAC,aACAC,aACAC,cACAC,SAAS,IAEXC,KAEA,MAAOC,EAAWC,GAAgBjB,EAAMkB,UAAS,IAG1CC,EAAcC,GAAmBpB,EAAMkB,UAAS,GAGjDG,EAASd,GAAgBY,EACzBG,EAAYb,GAAwBW,EAG1CpB,EAAMuB,oBAAoBR,EAAK,KAAA,CAC7BT,KAAM,IAAMgB,GAAU,GACtBE,MAAO,IAAMF,GAAU;AAqBzB,uBACGG,EAAA,CAAYnB,KAAMe,EAAQb,aAAcc,kCACtCI,EAAA,CAAmBZ,yCACjBa,EAAA,oBACC3B,EAAA4B,cAACC,OAAkB3B,kCAClB4B,EAAA,KAAwB3B,mBAE3BH,EAAA4B,cAACG,sBACC/B,EAAA4B,cAACI,EAAA,CAAkBC,QA1BN,KACfjB,IACJX,MACAiB,GAAU,KAuBsCY,SAAUlB,GACjDL,kCAEFwB,EAAA,CAAkBzB,UAAkBuB,QAvBxBG,UACnB,IAAIpB,EAAJ,CAEAC,GAAa,GACb,UACQb,IACNkB,GAAU,EACZ,CAAA,QACEL,GAAa,EACf,CARe,GAsBmDiB,SAAUlB,GACnEA,GAAYH,GAA4BD,QASvDb,EAAcsC,YAAc"}
@@ -1,2 +1,3 @@
1
- import e from"react";import{PencilSimple as t}from"@phosphor-icons/react";import a from"clsx";const r=e.forwardRef(({className:r,children:o,...s},n)=>/* @__PURE__ */e.createElement("span",{className:"group flex items-center"},/* @__PURE__ */e.createElement("span",{...s,ref:n,role:"textbox",contentEditable:!0,suppressContentEditableWarning:!0,className:r},o),/* @__PURE__ */e.createElement(t,{size:16,className:a("ml-2 opacity-0 -translate-x-1 transition-[opacity,transform] duration-300","group-hover:opacity-100 group-hover:translate-x-0","group-focus-within:opacity-100 group-focus-within:translate-x-0"),role:"presentation"})));r.displayName="EditableLabel";export{r as EditableLabel};
1
+ import e,{useState as t}from"react";import{PencilSimple as r}from"@phosphor-icons/react";import a from"clsx";const o=e.forwardRef(({className:o,children:n,onKeyDown:i,onBlur:l,onInput:c,placeholder:p,required:s,...u},m)=>{const[d,f]=t(!1),x=e=>!e.textContent?.trim();/* @__PURE__ */
2
+ return e.createElement("span",{className:"group flex items-center"},/* @__PURE__ */e.createElement("span",{...u,ref:m,role:"textbox",tabIndex:0,"aria-placeholder":p,"aria-multiline":!1,"aria-required":s||void 0,"aria-invalid":d||void 0,contentEditable:"plaintext-only",suppressContentEditableWarning:!0,onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),e.currentTarget.blur()),i?.(e)},onInput:e=>{x(e.currentTarget)||f(!1),c?.(e)},onBlur:e=>{s&&x(e.currentTarget)?(e.currentTarget.textContent="",f(!0)):f(!1),l?.(e)},className:a("whitespace-nowrap overflow-hidden","empty:before:content-[attr(aria-placeholder)] empty:before:text-muted-foreground",d&&"text-destructive empty:before:text-destructive",o)},n),/* @__PURE__ */e.createElement(r,{size:16,className:a("ml-2 opacity-0 -translate-x-1 transition-[opacity,transform] duration-300","group-hover:opacity-100 group-hover:translate-x-0","group-focus-within:opacity-100 group-focus-within:translate-x-0"),role:"presentation"}))});o.displayName="EditableLabel";export{o as EditableLabel};
2
3
  //# sourceMappingURL=editable-label.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"editable-label.js","sources":["../../../src/components/editable-label/editable-label.tsx"],"sourcesContent":["import React from \"react\";\nimport { PencilSimple } from \"@phosphor-icons/react\";\nimport clsx from \"clsx\";\n\nexport const EditableLabel = React.forwardRef<\n HTMLSpanElement,\n React.ComponentPropsWithoutRef<\"span\">\n>(({ className, children, ...props }, ref) => (\n <span className=\"group flex items-center\">\n <span\n {...props}\n ref={ref}\n role=\"textbox\"\n contentEditable\n suppressContentEditableWarning\n className={className}\n >\n {children}\n </span>\n <PencilSimple\n size={16}\n className={clsx(\n \"ml-2 opacity-0 -translate-x-1 transition-[opacity,transform] duration-300\",\n \"group-hover:opacity-100 group-hover:translate-x-0\",\n \"group-focus-within:opacity-100 group-focus-within:translate-x-0\"\n )}\n role=\"presentation\"\n />\n </span>\n));\n\nEditableLabel.displayName = \"EditableLabel\";\n\nexport default EditableLabel;\n"],"names":["EditableLabel","React","forwardRef","className","children","props","ref","createElement","role","contentEditable","suppressContentEditableWarning","PencilSimple","size","clsx","displayName"],"mappings":"8FAIO,MAAMA,EAAgBC,EAAMC,WAGjC,EAAGC,YAAWC,cAAaC,GAASC,mBACpCL,EAAAM,cAAC,OAAA,CAAKJ,UAAU,0CACdF,EAAAM,cAAC,OAAA,IACKF,EACJC,MACAE,KAAK,UACLC,iBAAe,EACfC,gCAA8B,EAC9BP,aAECC,kBAEHH,EAAAM,cAACI,EAAA,CACCC,KAAM,GACNT,UAAWU,EACT,4EACA,oDACA,mEAEFL,KAAK,mBAKXR,EAAcc,YAAc"}
1
+ {"version":3,"file":"editable-label.js","sources":["../../../src/components/editable-label/editable-label.tsx"],"sourcesContent":["import React, { useState } from 'react';\nimport { PencilSimple } from '@phosphor-icons/react';\nimport clsx from 'clsx';\n\ntype EditableLabelProps = React.ComponentPropsWithoutRef<'span'> & {\n placeholder?: string;\n required?: boolean;\n};\n\nexport const EditableLabel = React.forwardRef<HTMLSpanElement, EditableLabelProps>(\n ({ className, children, onKeyDown, onBlur, onInput, placeholder, required, ...props }, ref) => {\n const [invalid, setInvalid] = useState(false);\n\n const isEmpty = (element: HTMLElement) => !(element.textContent?.trim() ?? '');\n\n return (\n <span className=\"group flex items-center\">\n <span\n {...props}\n ref={ref}\n role=\"textbox\"\n tabIndex={0}\n aria-placeholder={placeholder}\n aria-multiline={false}\n aria-required={required || undefined}\n aria-invalid={invalid || undefined}\n contentEditable=\"plaintext-only\"\n suppressContentEditableWarning\n onKeyDown={(event) => {\n if (event.key === 'Enter') {\n event.preventDefault();\n event.currentTarget.blur();\n }\n onKeyDown?.(event);\n }}\n onInput={(event) => {\n if (!isEmpty(event.currentTarget)) {\n setInvalid(false);\n }\n onInput?.(event);\n }}\n onBlur={(event) => {\n if (required && isEmpty(event.currentTarget)) {\n event.currentTarget.textContent = '';\n setInvalid(true);\n } else {\n setInvalid(false);\n }\n onBlur?.(event);\n }}\n className={clsx(\n 'whitespace-nowrap overflow-hidden',\n 'empty:before:content-[attr(aria-placeholder)] empty:before:text-muted-foreground',\n invalid && 'text-destructive empty:before:text-destructive',\n className,\n )}\n >\n {children}\n </span>\n <PencilSimple\n size={16}\n className={clsx(\n 'ml-2 opacity-0 -translate-x-1 transition-[opacity,transform] duration-300',\n 'group-hover:opacity-100 group-hover:translate-x-0',\n 'group-focus-within:opacity-100 group-focus-within:translate-x-0',\n )}\n role=\"presentation\"\n />\n </span>\n );\n },\n);\n\nEditableLabel.displayName = 'EditableLabel';\n\nexport default EditableLabel;\n"],"names":["EditableLabel","React","forwardRef","className","children","onKeyDown","onBlur","onInput","placeholder","required","props","ref","invalid","setInvalid","useState","isEmpty","element","textContent","trim","createElement","role","tabIndex","contentEditable","suppressContentEditableWarning","event","key","preventDefault","currentTarget","blur","clsx","PencilSimple","size","displayName"],"mappings":"6GASO,MAAMA,EAAgBC,EAAMC,WACjC,EAAGC,YAAWC,WAAUC,YAAWC,SAAQC,UAASC,cAAaC,cAAaC,GAASC,KACrF,MAAOC,EAASC,GAAcC,GAAS,GAEjCC,EAAWC,IAA2BA,EAAQC,aAAaC;AAEjE,OACEjB,EAAAkB,cAAC,OAAA,CAAKhB,UAAU,0CACdF,EAAAkB,cAAC,OAAA,IACKT,EACJC,MACAS,KAAK,UACLC,SAAU,EACV,mBAAkBb,EAClB,kBAAgB,EAChB,gBAAeC,QAAY,EAC3B,eAAcG,QAAW,EACzBU,gBAAgB,iBAChBC,gCAA8B,EAC9BlB,UAAYmB,IACQ,UAAdA,EAAMC,MACRD,EAAME,iBACNF,EAAMG,cAAcC,QAEtBvB,IAAYmB,IAEdjB,QAAUiB,IACHT,EAAQS,EAAMG,gBACjBd,GAAW,GAEbN,IAAUiB,IAEZlB,OAASkB,IACHf,GAAYM,EAAQS,EAAMG,gBAC5BH,EAAMG,cAAcV,YAAc,GAClCJ,GAAW,IAEXA,GAAW,GAEbP,IAASkB,IAEXrB,UAAW0B,EACT,oCACA,mFACAjB,GAAW,iDACXT,IAGDC,kBAEHH,EAAAkB,cAACW,EAAA,CACCC,KAAM,GACN5B,UAAW0B,EACT,4EACA,oDACA,mEAEFT,KAAK,oBAOfpB,EAAcgC,YAAc"}
@@ -1,4 +1,4 @@
1
1
  import*as e from"react";import*as a from"@radix-ui/react-alert-dialog";import{c as t}from"../../chunks/utils.DtKoarLP.js";import{b as s}from"../../chunks/button.C7qRaFMP.js";const l=e.createContext({}),o=e.forwardRef(({onOpenChange:t,...s},o)=>{const n=e.useCallback(()=>{t?.(!1)},[t]);/* @__PURE__ */
2
- return e.createElement(l.Provider,{value:{onClose:n}},/* @__PURE__ */e.createElement(a.Root,{onOpenChange:t,...s}))});o.displayName=a.Root.displayName;const n=a.Trigger,r=a.Portal,d=e.forwardRef(({className:s,zIndex:l,...o},n)=>/* @__PURE__ */e.createElement(a.Overlay,{className:t("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",l||"z-50",s),...o,ref:n}));d.displayName=a.Overlay.displayName;const c=e.forwardRef(({className:s,zIndex:l,...o},n)=>/* @__PURE__ */e.createElement(r,null,/* @__PURE__ */e.createElement(d,{zIndex:l}),/* @__PURE__ */e.createElement(a.Content,{ref:n,className:t("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",l||"z-50",s),...o})));c.displayName=a.Content.displayName;const i=({className:a,...s})=>/* @__PURE__ */e.createElement("div",{className:t("flex flex-col text-center sm:text-left",a),...s});i.displayName="AlertDialogHeader";const m=({className:a,...s})=>/* @__PURE__ */e.createElement("div",{className:t("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2 pb-4 px-4",a),...s});m.displayName="AlertDialogFooter";const f=e.forwardRef(({className:s,...l},o)=>/* @__PURE__ */e.createElement(a.Title,{ref:o,className:t("text-lg font-medium px-4 my-0 h-12 flex items-center",s),...l}));f.displayName=a.Title.displayName;const p=e.forwardRef(({className:s,...l},o)=>/* @__PURE__ */e.createElement(a.Description,{ref:o,className:t("text-sm px-4 py-3 my-0",s),...l}));p.displayName=a.Description.displayName;const N=e.forwardRef(({className:o,variant:n,asChild:r,onClick:d,...c},i)=>{const{onClose:m}=e.useContext(l),f=e.useCallback(async e=>{if(!d)return;const a=d(e);if(null!=(t=a)&&"object"==typeof t&&"then"in t){e.preventDefault();try{await a,m?.()}catch(s){console.error("AlertDialogAction onClick failed:",s)}}var t},[d,m]);/* @__PURE__ */
2
+ return e.createElement(l.Provider,{value:{onClose:n}},/* @__PURE__ */e.createElement(a.Root,{onOpenChange:t,...s}))});o.displayName=a.Root.displayName;const n=a.Trigger,r=a.Portal,d=e.forwardRef(({className:s,zIndex:l,style:o,...n},r)=>/* @__PURE__ */e.createElement(a.Overlay,{className:t("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",s),style:null!=l?{...o,zIndex:l}:o,...n,ref:r}));d.displayName=a.Overlay.displayName;const c=e.forwardRef(({className:s,zIndex:l,style:o,...n},c)=>/* @__PURE__ */e.createElement(r,null,/* @__PURE__ */e.createElement(d,{zIndex:l}),/* @__PURE__ */e.createElement(a.Content,{ref:c,className:t("fixed left-[50%] top-[50%] z-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",s),style:null!=l?{...o,zIndex:l}:o,...n})));c.displayName=a.Content.displayName;const i=({className:a,...s})=>/* @__PURE__ */e.createElement("div",{className:t("flex flex-col text-center sm:text-left",a),...s});i.displayName="AlertDialogHeader";const m=({className:a,...s})=>/* @__PURE__ */e.createElement("div",{className:t("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2 pb-4 px-4",a),...s});m.displayName="AlertDialogFooter";const f=e.forwardRef(({className:s,...l},o)=>/* @__PURE__ */e.createElement(a.Title,{ref:o,className:t("text-lg font-medium px-4 my-0 h-12 flex items-center",s),...l}));f.displayName=a.Title.displayName;const p=e.forwardRef(({className:s,...l},o)=>/* @__PURE__ */e.createElement(a.Description,{ref:o,className:t("text-sm px-4 py-3 my-0",s),...l}));p.displayName=a.Description.displayName;const N=e.forwardRef(({className:o,variant:n,asChild:r,onClick:d,...c},i)=>{const{onClose:m}=e.useContext(l),f=e.useCallback(async e=>{if(!d)return;const a=d(e);if(null!=(t=a)&&"object"==typeof t&&"then"in t){e.preventDefault();try{await a,m?.()}catch(s){console.error("AlertDialogAction onClick failed:",s)}}var t},[d,m]);/* @__PURE__ */
3
3
  return e.createElement(a.Action,{ref:i,className:t(s({variant:n}),o),onClick:f,...c})});N.displayName=a.Action.displayName;const u=e.forwardRef(({className:l,variant:o,...n},r)=>/* @__PURE__ */e.createElement(a.Cancel,{ref:r,className:t(s({variant:o||"link"}),"mt-2 sm:mt-0 text-foreground",l),...n}));u.displayName=a.Cancel.displayName;export{o as AlertDialog,N as AlertDialogAction,u as AlertDialogCancel,c as AlertDialogContent,p as AlertDialogDescription,m as AlertDialogFooter,i as AlertDialogHeader,d as AlertDialogOverlay,r as AlertDialogPortal,f as AlertDialogTitle,n as AlertDialogTrigger};
4
4
  //# sourceMappingURL=alert-dialog.js.map
@@ -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';\nimport { VariantProps } from 'class-variance-authority';\n\nimport { cn } from '@/lib/utils';\nimport { buttonVariants } from '@/components/ui/button';\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 onOpenChange={onOpenChange} {...props} />\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 = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (\n <div className={cn('flex flex-col text-center sm:text-left', className)} {...props} />\n);\nAlertDialogHeader.displayName = 'AlertDialogHeader';\n\nconst AlertDialogFooter = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n className={cn('flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2 pb-4 px-4', className)}\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 ref={ref} className={cn('text-sm px-4 py-3 my-0', className)} {...props} />\n));\nAlertDialogDescription.displayName = AlertDialogPrimitive.Description.displayName;\n\nconst AlertDialogAction = React.forwardRef<\n React.ElementRef<typeof AlertDialogPrimitive.Action>,\n React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Action> &\n 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(\n 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 },\n [onClick, onClose],\n );\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(buttonVariants({ variant: variant || 'link' }), 'mt-2 sm:mt-0 text-foreground', className)}\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":["AlertDialogContext","React","createContext","AlertDialog","forwardRef","onOpenChange","props","_ref","handleClose","useCallback","Provider","value","onClose","createElement","AlertDialogPrimitive","Root","displayName","AlertDialogTrigger","Trigger","AlertDialogPortal","Portal","AlertDialogOverlay","className","zIndex","ref","Overlay","cn","AlertDialogContent","Content","AlertDialogHeader","AlertDialogFooter","AlertDialogTitle","Title","AlertDialogDescription","Description","AlertDialogAction","variant","asChild","onClick","useContext","handleClick","async","event","result","preventDefault","error","console","Action","buttonVariants","AlertDialogCancel","Cancel"],"mappings":"8KAQA,MAAMA,EAAqBC,EAAMC,cAE9B,IAEGC,EAAcF,EAAMG,WAGxB,EAAGC,kBAAiBC,GAASC,KAC7B,MAAMC,EAAcP,EAAMQ,YAAY,KACpCJ,KAAe,IACd,CAACA;AAEJ,uBACGL,EAAmBU,SAAnB,CAA4BC,MAAO,CAAEC,QAASJ,mBAC7CP,EAAAY,cAACC,EAAqBC,KAArB,CAA0BV,kBAAgCC,OAIjEH,EAAYa,YAAcF,EAAqBC,KAAKC,YAEpD,MAAMC,EAAqBH,EAAqBI,QAE1CC,EAAoBL,EAAqBM,OAEzCC,EAAqBpB,EAAMG,WAK/B,EAAGkB,YAAWC,YAAWjB,GAASkB,mBAClCvB,EAAAY,cAACC,EAAqBW,QAArB,CACCH,UAAWI,EACT,oJACAH,GAAU,OACVD,MAEEhB,EACJkB,SAGJH,EAAmBL,YAAcF,EAAqBW,QAAQT,YAE9D,MAAMW,EAAqB1B,EAAMG,WAK/B,EAAGkB,YAAWC,YAAWjB,GAASkB,mBAClCvB,EAAAY,cAACM,EAAA,oBACClB,EAAAY,cAACQ,EAAA,CAAmBE,0BACpBtB,EAAAY,cAACC,EAAqBc,QAArB,CACCJ,MACAF,UAAWI,EACT,igBACAH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6B,EAAkBnB,YAAcF,EAAqBiC,OAAO/B,YAE5D,MAAMiC,EAAoBhD,EAAMG,WAG9B,EAAGkB,YAAWc,aAAY9B,GAASkB,mBACnCvB,EAAAY,cAACC,EAAqBoC,OAArB,CACC1B,MACAF,UAAWI,EAAGsB,EAAe,CAAEZ,QAASA,GAAW,SAAW,+BAAgCd,MAC1FhB,KAGR2C,EAAkBjC,YAAcF,EAAqBoC,OAAOlC"}
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';\nimport { VariantProps } from 'class-variance-authority';\n\nimport { cn } from '@/lib/utils';\nimport { buttonVariants } from '@/components/ui/button';\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 onOpenChange={onOpenChange} {...props} />\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?: number;\n }\n>(({ className, zIndex, style, ...props }, ref) => (\n <AlertDialogPrimitive.Overlay\n className={cn(\n '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',\n className,\n )}\n style={zIndex != null ? { ...style, zIndex } : style}\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?: number;\n }\n>(({ className, zIndex, style, ...props }, ref) => (\n <AlertDialogPortal>\n <AlertDialogOverlay zIndex={zIndex} />\n <AlertDialogPrimitive.Content\n ref={ref}\n className={cn(\n 'fixed left-[50%] top-[50%] z-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 className,\n )}\n style={zIndex != null ? { ...style, zIndex } : style}\n {...props}\n />\n </AlertDialogPortal>\n));\nAlertDialogContent.displayName = AlertDialogPrimitive.Content.displayName;\n\nconst AlertDialogHeader = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (\n <div className={cn('flex flex-col text-center sm:text-left', className)} {...props} />\n);\nAlertDialogHeader.displayName = 'AlertDialogHeader';\n\nconst AlertDialogFooter = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n className={cn('flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2 pb-4 px-4', className)}\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 ref={ref} className={cn('text-sm px-4 py-3 my-0', className)} {...props} />\n));\nAlertDialogDescription.displayName = AlertDialogPrimitive.Description.displayName;\n\nconst AlertDialogAction = React.forwardRef<\n React.ElementRef<typeof AlertDialogPrimitive.Action>,\n React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Action> &\n 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(\n 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 },\n [onClick, onClose],\n );\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(buttonVariants({ variant: variant || 'link' }), 'mt-2 sm:mt-0 text-foreground', className)}\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":["AlertDialogContext","React","createContext","AlertDialog","forwardRef","onOpenChange","props","_ref","handleClose","useCallback","Provider","value","onClose","createElement","AlertDialogPrimitive","Root","displayName","AlertDialogTrigger","Trigger","AlertDialogPortal","Portal","AlertDialogOverlay","className","zIndex","style","ref","Overlay","cn","AlertDialogContent","Content","AlertDialogHeader","AlertDialogFooter","AlertDialogTitle","Title","AlertDialogDescription","Description","AlertDialogAction","variant","asChild","onClick","useContext","handleClick","async","event","result","preventDefault","error","console","Action","buttonVariants","AlertDialogCancel","Cancel"],"mappings":"8KAQA,MAAMA,EAAqBC,EAAMC,cAE9B,IAEGC,EAAcF,EAAMG,WAGxB,EAAGC,kBAAiBC,GAASC,KAC7B,MAAMC,EAAcP,EAAMQ,YAAY,KACpCJ,KAAe,IACd,CAACA;AAEJ,uBACGL,EAAmBU,SAAnB,CAA4BC,MAAO,CAAEC,QAASJ,mBAC7CP,EAAAY,cAACC,EAAqBC,KAArB,CAA0BV,kBAAgCC,OAIjEH,EAAYa,YAAcF,EAAqBC,KAAKC,YAEpD,MAAMC,EAAqBH,EAAqBI,QAE1CC,EAAoBL,EAAqBM,OAEzCC,EAAqBpB,EAAMG,WAK/B,EAAGkB,YAAWC,SAAQC,WAAUlB,GAASmB,mBACzCxB,EAAAY,cAACC,EAAqBY,QAArB,CACCJ,UAAWK,EACT,yJACAL,GAEFE,MAAiB,MAAVD,EAAiB,IAAKC,EAAOD,UAAWC,KAC3ClB,EACJmB,SAGJJ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