UNPKG

@darksnow-ui/alert-dialog

Version:

alert-dialog component for DarkSnow UI

1 lines 7.34 kB
{"version":3,"sources":["../src/AlertDialog.tsx"],"names":["AlertDialog","e","AlertDialogTrigger","AlertDialogPortal","AlertDialogOverlay","r","className","props","ref","jsx","clsx","AlertDialogContent","jsxs","AlertDialogHeader","AlertDialogFooter","AlertDialogTitle","AlertDialogDescription","AlertDialogAction","buttonVariants","AlertDialogCancel"],"mappings":";AAKaA,IAAAA,CAAAA,CAAmCC,YAEnCC,CAAAA,IAAAA,CAAAA,CAAAA,CAA0CD,YAE1CE,CAAAA,OAAAA,CAAAA,CAAAA,CAAyCF,YAEzCG,CAAAA,MAAAA,CAAAA,CAAAA,CAA2BC,YAGtC,CAAA,UAAA,CAAA,CAAC,CAAE,SAAA,CAAAC,CAAW,CAAA,GAAGC,CAAM,CAAA,CAAGC,CAC1BC,GAAAA,cAAAA,CAAsBR,YAArB,CAAA,OAAA,CAAA,CACC,SAAWS,CAAAA,SAAAA,CACT,gKACAJ,CAAAA,CACF,CACC,CAAA,GAAGC,CACJ,CAAA,GAAA,CAAKC,CACP,CAAA,CACD,EACDJ,CAAAA,CAAmB,WAAmC,CAAAH,YAAA,CAAA,OAAA,CAAQ,WAEvD,CAAA,IAAMU,CAA2B,CAAAN,YAAA,CAAA,UAAA,CAGtC,CAAC,CAAE,SAAAC,CAAAA,CAAAA,CAAW,GAAGC,CAAM,CAAA,CAAGC,CAC1BI,GAAAA,eAAAA,CAACT,CAAA,CAAA,CACC,QAAAM,CAAAA,CAAAA,cAAAA,CAACL,CAAA,CAAA,EAAmB,CACpBK,CAAAA,cAAAA,CAAsBR,YAArB,CAAA,OAAA,CAAA,CACC,GAAKO,CAAAA,CAAAA,CACL,SAAWE,CAAAA,SAAAA,CACT,8hBACAJ,CAAAA,CACF,CACC,CAAA,GAAGC,CACN,CAAA,CAAA,CAAA,CACF,CACD,EACDI,CAAmB,CAAA,WAAA,CAAmCV,YAAQ,CAAA,OAAA,CAAA,WA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CAAA,CAAC,CAAE,SAAA,CAAAC,CAAW,CAAA,GAAGC,CAAM,CAAA,CAAGC,CAC1BC,GAAAA,cAAAA,CAAsBR,YAArB,CAAA,MAAA,CAAA,CACC,GAAKO,CAAAA,CAAAA,CACL,SAAWE,CAAAA,SAAAA,CAAKQ,qBAAe,EAAA,CAAGZ,CAAS,CAAA,CAC1C,GAAGC,CAAAA,CACN,CACD,EACDU,CAAkB,CAAA,WAAA,CAAmChB,YAAO,CAAA,MAAA,CAAA,WAAA,CAE/CkB,IAAAA,CAAAA,CAA0Bd,YAGrC,CAAA,UAAA,CAAA,CAAC,CAAE,SAAA,CAAAC,CAAW,CAAA,GAAGC,CAAM,CAAA,CAAGC,CAC1BC,GAAAA,cAAAA,CAAsBR,YAArB,CAAA,MAAA,CAAA,CACC,GAAKO,CAAAA,CAAAA,CACL,SAAWE,CAAAA,SAAAA,CACTQ,qBAAe,CAAA,CAAE,OAAS,CAAA,SAAU,CAAC,CAAA,CACrC,cACAZ,CAAAA,CACF,CACC,CAAA,GAAGC,CACN,CAAA,CACD,EACDY,CAAAA,CAAkB,YAAmClB,YAAO,CAAA,MAAA,CAAA,WAAA","file":"index.cjs","sourcesContent":["import * as React from \"react\"\nimport * as AlertDialogPrimitive from \"@radix-ui/react-alert-dialog\"\nimport { clsx } from \"clsx\"\nimport { buttonVariants } from \"@darksnow-ui/button\"\n\nexport const AlertDialog = AlertDialogPrimitive.Root\n\nexport const AlertDialogTrigger = AlertDialogPrimitive.Trigger\n\nexport const AlertDialogPortal = AlertDialogPrimitive.Portal\n\nexport const AlertDialogOverlay = React.forwardRef<\n React.ElementRef<typeof AlertDialogPrimitive.Overlay>,\n React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Overlay>\n>(({ className, ...props }, ref) => (\n <AlertDialogPrimitive.Overlay\n className={clsx(\n \"fixed inset-0 z-50 bg-theme-bg-dark/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 {...props}\n ref={ref}\n />\n))\nAlertDialogOverlay.displayName = AlertDialogPrimitive.Overlay.displayName\n\nexport const AlertDialogContent = React.forwardRef<\n React.ElementRef<typeof AlertDialogPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Content>\n>(({ className, ...props }, ref) => (\n <AlertDialogPortal>\n <AlertDialogOverlay />\n <AlertDialogPrimitive.Content\n ref={ref}\n className={clsx(\n \"fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border border-theme-mark-light bg-theme-surface p-6 shadow-theme-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\",\n className,\n )}\n {...props}\n />\n </AlertDialogPortal>\n))\nAlertDialogContent.displayName = AlertDialogPrimitive.Content.displayName\n\nexport const AlertDialogHeader = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n className={clsx(\n \"flex flex-col space-y-2 text-center sm:text-left\",\n className,\n )}\n {...props}\n />\n)\nAlertDialogHeader.displayName = \"AlertDialogHeader\"\n\nexport const AlertDialogFooter = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n className={clsx(\n \"flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2\",\n className,\n )}\n {...props}\n />\n)\nAlertDialogFooter.displayName = \"AlertDialogFooter\"\n\nexport const 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={clsx(\"text-lg font-semibold\", className)}\n {...props}\n />\n))\nAlertDialogTitle.displayName = AlertDialogPrimitive.Title.displayName\n\nexport const 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={clsx(\"text-sm text-theme-content-muted\", className)}\n {...props}\n />\n))\nAlertDialogDescription.displayName =\n AlertDialogPrimitive.Description.displayName\n\nexport const AlertDialogAction = React.forwardRef<\n React.ElementRef<typeof AlertDialogPrimitive.Action>,\n React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Action>\n>(({ className, ...props }, ref) => (\n <AlertDialogPrimitive.Action\n ref={ref}\n className={clsx(buttonVariants(), className)}\n {...props}\n />\n))\nAlertDialogAction.displayName = AlertDialogPrimitive.Action.displayName\n\nexport const AlertDialogCancel = React.forwardRef<\n React.ElementRef<typeof AlertDialogPrimitive.Cancel>,\n React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Cancel>\n>(({ className, ...props }, ref) => (\n <AlertDialogPrimitive.Cancel\n ref={ref}\n className={clsx(\n buttonVariants({ variant: \"outline\" }),\n \"mt-2 sm:mt-0\",\n className,\n )}\n {...props}\n />\n))\nAlertDialogCancel.displayName = AlertDialogPrimitive.Cancel.displayName"]}