{"$schema":"https://ui.shadcn.com/schema/registry-item.json","name":"alert-dialog","title":"Alert Dialog","author":"brijr","description":"A modal dialog that interrupts to confirm an action.","dependencies":["@ui-sdk/react","@ui-sdk/core","class-variance-authority","cn"],"registryDependencies":["https://ui.bridger.to/r/button.json"],"files":[{"path":"components/ui/alert-dialog.tsx","content":"import * as React from \"react\"\nimport {\n  AlertDialog,\n  AlertDialogBackdrop as AlertDialogBackdropPrimitive,\n  AlertDialogClose as AlertDialogClosePrimitive,\n  AlertDialogContent as AlertDialogContentPrimitive,\n  AlertDialogDescription as AlertDialogDescriptionPrimitive,\n  AlertDialogShortcut as AlertDialogShortcutPrimitive,\n  AlertDialogTitle as AlertDialogTitlePrimitive,\n  AlertDialogTrigger,\n} from \"@ui-sdk/react/alert-dialog\"\nimport { renderElement, type PartProps } from \"@ui-sdk/react/primitive\"\nimport { type VariantProps } from \"class-variance-authority\"\nimport { cn } from \"cn\"\nimport { buttonVariants } from \"@/components/ui/button\"\n\nfunction AlertDialogOverlay({\n  className,\n  ...props\n}: Omit<\n  React.ComponentProps<typeof AlertDialogBackdropPrimitive>,\n  \"className\"\n> & {\n  className?: string\n}) {\n  return (\n    <AlertDialogBackdropPrimitive\n      className={cn(\n        \"fixed inset-0 bg-black/50 transition-opacity duration-(--duration-overlay) ease-(--easing-enter) data-ending-style:opacity-0 data-ending-style:duration-(--duration-overlay-exit) data-starting-style:opacity-0 motion-reduce:transition-none\",\n        className\n      )}\n      {...props}\n    />\n  )\n}\n\nfunction AlertDialogContent({\n  className,\n  overlay = <AlertDialogOverlay />,\n  ...props\n}: Omit<\n  React.ComponentProps<typeof AlertDialogContentPrimitive>,\n  \"className\"\n> & {\n  className?: string\n  /** The backdrop behind the dialog. Pass your own, or `null` for none. */\n  overlay?: React.ReactElement | null\n}) {\n  return (\n    <>\n      {overlay}\n      <AlertDialogContentPrimitive\n        className={cn(\n          \"fixed top-1/2 left-1/2 grid max-h-[calc(100dvh-2rem)] w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 overflow-y-auto overscroll-contain rounded-xl bg-popover p-6 text-popover-foreground shadow-(--elevation-overlay) transition-[opacity,scale] duration-(--duration-overlay) ease-(--easing-enter) outline-none data-ending-style:scale-95 data-ending-style:opacity-0 data-ending-style:duration-(--duration-overlay-exit) data-starting-style:scale-95 data-starting-style:opacity-0 motion-reduce:transition-none sm:max-w-lg\",\n          className\n        )}\n        {...props}\n      />\n    </>\n  )\n}\n\nfunction AlertDialogHeader({\n  className,\n  render,\n  ...props\n}: Omit<PartProps<\"div\">, \"className\"> & { className?: string }) {\n  return renderElement(\n    \"div\",\n    {\n      \"data-slot\": \"alert-dialog-header\",\n      className: cn(\n        \"flex flex-col gap-1.5 text-center sm:text-left\",\n        className\n      ),\n      ...props,\n    },\n    render\n  )\n}\n\nfunction AlertDialogFooter({\n  className,\n  render,\n  ...props\n}: Omit<PartProps<\"div\">, \"className\"> & { className?: string }) {\n  return renderElement(\n    \"div\",\n    {\n      \"data-slot\": \"alert-dialog-footer\",\n      className: cn(\n        \"flex flex-col-reverse gap-2 sm:flex-row sm:justify-end\",\n        className\n      ),\n      ...props,\n    },\n    render\n  )\n}\n\nfunction AlertDialogTitle({\n  className,\n  ...props\n}: Omit<React.ComponentProps<typeof AlertDialogTitlePrimitive>, \"className\"> & {\n  className?: string\n}) {\n  return (\n    <AlertDialogTitlePrimitive\n      className={cn(\n        \"text-base leading-snug font-medium text-balance\",\n        className\n      )}\n      {...props}\n    />\n  )\n}\n\nfunction AlertDialogDescription({\n  className,\n  ...props\n}: Omit<\n  React.ComponentProps<typeof AlertDialogDescriptionPrimitive>,\n  \"className\"\n> & {\n  className?: string\n}) {\n  return (\n    <AlertDialogDescriptionPrimitive\n      className={cn(\"text-sm text-muted-foreground\", className)}\n      {...props}\n    />\n  )\n}\n\nfunction AlertDialogAction({\n  className,\n  value = \"confirm\",\n  variant,\n  size,\n  ...props\n}: Omit<React.ComponentProps<typeof AlertDialogClosePrimitive>, \"className\"> &\n  VariantProps<typeof buttonVariants> & {\n    className?: string\n  }) {\n  return (\n    <AlertDialogClosePrimitive\n      value={value}\n      className={cn(\n        buttonVariants({ variant, size }),\n        \"disabled:pointer-events-none disabled:opacity-50\",\n        className\n      )}\n      {...props}\n    />\n  )\n}\n\nfunction AlertDialogCancel({\n  className,\n  variant = \"outline\",\n  size,\n  ...props\n}: Omit<React.ComponentProps<typeof AlertDialogClosePrimitive>, \"className\"> &\n  VariantProps<typeof buttonVariants> & {\n    className?: string\n  }) {\n  return (\n    <AlertDialogClosePrimitive\n      className={cn(\n        buttonVariants({ variant, size }),\n        \"disabled:pointer-events-none disabled:opacity-50\",\n        className\n      )}\n      {...props}\n    />\n  )\n}\n\nfunction AlertDialogShortcut({\n  className,\n  ...props\n}: Omit<\n  React.ComponentProps<typeof AlertDialogShortcutPrimitive>,\n  \"className\"\n> & {\n  className?: string\n}) {\n  return (\n    <AlertDialogShortcutPrimitive\n      className={cn(\n        \"text-xs tracking-widest text-muted-foreground in-[.bg-primary]:text-primary-foreground/70 in-[.text-destructive]:text-current\",\n        className\n      )}\n      {...props}\n    />\n  )\n}\n\nexport {\n  AlertDialog,\n  AlertDialogOverlay,\n  AlertDialogTrigger,\n  AlertDialogContent,\n  AlertDialogHeader,\n  AlertDialogFooter,\n  AlertDialogTitle,\n  AlertDialogDescription,\n  AlertDialogAction,\n  AlertDialogCancel,\n  AlertDialogShortcut,\n}\n","type":"registry:ui"}],"type":"registry:ui"}