{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "alert-dialog",
  "type": "registry:ui",
  "dependencies": [
    "@kobalte/core"
  ],
  "registryDependencies": [
    "@gc-solid/button"
  ],
  "files": [
    {
      "path": "ui/alert-dialog.tsx",
      "content": "import type { Component, ComponentProps, JSX, ValidComponent } from \"solid-js\"\nimport { mergeProps, splitProps } from \"solid-js\"\n\nimport * as AlertDialogPrimitive from \"@kobalte/core/alert-dialog\"\nimport type { PolymorphicProps } from \"@kobalte/core/polymorphic\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Button, type ButtonProps } from \"@/components/ui/button\"\n\nconst AlertDialog: Component<AlertDialogPrimitive.AlertDialogRootProps> = (props) => {\n  return <AlertDialogPrimitive.Root data-slot=\"alert-dialog\" {...props} />\n}\n\nconst AlertDialogTrigger = <T extends ValidComponent = \"button\">(\n  props: PolymorphicProps<T, AlertDialogPrimitive.AlertDialogTriggerProps<T>>\n) => {\n  return <AlertDialogPrimitive.Trigger data-slot=\"alert-dialog-trigger\" {...props} />\n}\n\nconst AlertDialogPortal: Component<AlertDialogPrimitive.AlertDialogPortalProps> = (props) => {\n  return <AlertDialogPrimitive.Portal data-slot=\"alert-dialog-portal\" {...props} />\n}\n\ntype AlertDialogOverlayProps<T extends ValidComponent = \"div\"> =\n  AlertDialogPrimitive.AlertDialogOverlayProps<T> & {\n    class?: string | undefined\n  }\n\nconst AlertDialogOverlay = <T extends ValidComponent = \"div\">(\n  props: PolymorphicProps<T, AlertDialogOverlayProps<T>>\n) => {\n  const [local, others] = splitProps(props as AlertDialogOverlayProps, [\"class\"])\n  return (\n    <AlertDialogPrimitive.Overlay\n      class={cn(\"cn-alert-dialog-overlay fixed inset-0 z-50\", local.class)}\n      data-slot=\"alert-dialog-overlay\"\n      {...others}\n    />\n  )\n}\n\ntype AlertDialogContentProps<T extends ValidComponent = \"div\"> =\n  AlertDialogPrimitive.AlertDialogContentProps<T> & {\n    class?: string | undefined\n    size?: \"default\" | \"sm\"\n  }\n\nconst AlertDialogContent = <T extends ValidComponent = \"div\">(\n  rawProps: PolymorphicProps<T, AlertDialogContentProps<T>>\n) => {\n  const props = mergeProps({ size: \"default\" }, rawProps)\n  const [local, others] = splitProps(props as AlertDialogContentProps, [\"class\", \"size\"])\n  return (\n    <AlertDialogPortal>\n      <AlertDialogOverlay />\n      <AlertDialogPrimitive.Content\n        class={cn(\n          \"cn-alert-dialog-content group/alert-dialog-content -translate-x-1/2 -translate-y-1/2 fixed top-1/2 left-1/2 z-50 grid w-full outline-none\",\n          local.class\n        )}\n        data-size={local.size}\n        data-slot=\"alert-dialog-content\"\n        {...others}\n      />\n    </AlertDialogPortal>\n  )\n}\n\ntype AlertDialogHeaderProps = ComponentProps<\"div\"> & {\n  class?: string | undefined\n}\n\nconst AlertDialogHeader: Component<AlertDialogHeaderProps> = (props) => {\n  const [local, others] = splitProps(props, [\"class\"])\n  return (\n    <div\n      class={cn(\"cn-alert-dialog-header\", local.class)}\n      data-slot=\"alert-dialog-header\"\n      {...others}\n    />\n  )\n}\n\ntype AlertDialogFooterProps = ComponentProps<\"div\"> & {\n  class?: string | undefined\n}\n\nconst AlertDialogFooter: Component<AlertDialogFooterProps> = (props) => {\n  const [local, others] = splitProps(props, [\"class\"])\n  return (\n    <div\n      class={cn(\n        \"cn-alert-dialog-footer flex flex-col-reverse gap-2 group-data-[size=sm]/alert-dialog-content:grid group-data-[size=sm]/alert-dialog-content:grid-cols-2 sm:flex-row sm:justify-end\",\n        local.class\n      )}\n      data-slot=\"alert-dialog-footer\"\n      {...others}\n    />\n  )\n}\n\ntype AlertDialogMediaProps = ComponentProps<\"div\"> & {\n  class?: string | undefined\n}\n\nconst AlertDialogMedia: Component<AlertDialogMediaProps> = (props) => {\n  const [local, others] = splitProps(props, [\"class\"])\n  return (\n    <div\n      class={cn(\"cn-alert-dialog-media\", local.class)}\n      data-slot=\"alert-dialog-media\"\n      {...others}\n    />\n  )\n}\n\ntype AlertDialogTitleProps<T extends ValidComponent = \"h2\"> =\n  AlertDialogPrimitive.AlertDialogTitleProps<T> & {\n    class?: string | undefined\n  }\n\nconst AlertDialogTitle = <T extends ValidComponent = \"h2\">(\n  props: PolymorphicProps<T, AlertDialogTitleProps<T>>\n) => {\n  const [local, others] = splitProps(props as AlertDialogTitleProps, [\"class\"])\n  return (\n    <AlertDialogPrimitive.Title\n      class={cn(\"cn-alert-dialog-title\", local.class)}\n      data-slot=\"alert-dialog-title\"\n      {...others}\n    />\n  )\n}\n\ntype AlertDialogDescriptionProps<T extends ValidComponent = \"p\"> =\n  AlertDialogPrimitive.AlertDialogDescriptionProps<T> & {\n    class?: string | undefined\n  }\n\nconst AlertDialogDescription = <T extends ValidComponent = \"p\">(\n  props: PolymorphicProps<T, AlertDialogDescriptionProps<T>>\n) => {\n  const [local, others] = splitProps(props as AlertDialogDescriptionProps, [\"class\"])\n  return (\n    <AlertDialogPrimitive.Description\n      class={cn(\"cn-alert-dialog-description\", local.class)}\n      data-slot=\"alert-dialog-description\"\n      {...others}\n    />\n  )\n}\n\ntype AlertDialogActionProps<T extends ValidComponent = \"button\"> =\n  AlertDialogPrimitive.AlertDialogCloseButtonProps<T> &\n    Pick<ButtonProps, \"variant\" | \"size\"> & {\n      class?: string | undefined\n      children?: JSX.Element\n    }\n\nconst AlertDialogAction = <T extends ValidComponent = \"button\">(\n  rawProps: PolymorphicProps<T, AlertDialogActionProps<T>>\n) => {\n  const props = mergeProps({ variant: \"default\", size: \"default\" } as const, rawProps)\n  const [local, others] = splitProps(props as AlertDialogActionProps, [\n    \"class\",\n    \"variant\",\n    \"size\",\n    \"children\"\n  ])\n  return (\n    <Button\n      as={AlertDialogPrimitive.CloseButton}\n      size={local.size}\n      variant={local.variant}\n      {...others}\n    >\n      <span class={cn(\"cn-alert-dialog-action\", local.class)} data-slot=\"alert-dialog-action\">\n        {local.children}\n      </span>\n    </Button>\n  )\n}\n\ntype AlertDialogCancelProps<T extends ValidComponent = \"button\"> =\n  AlertDialogPrimitive.AlertDialogCloseButtonProps<T> &\n    Pick<ButtonProps, \"variant\" | \"size\"> & {\n      class?: string | undefined\n      children?: JSX.Element\n    }\n\nconst AlertDialogCancel = <T extends ValidComponent = \"button\">(\n  rawProps: PolymorphicProps<T, AlertDialogCancelProps<T>>\n) => {\n  const props = mergeProps({ variant: \"outline\", size: \"default\" } as const, rawProps)\n  const [local, others] = splitProps(props as AlertDialogCancelProps, [\n    \"class\",\n    \"variant\",\n    \"size\",\n    \"children\"\n  ])\n  return (\n    <Button\n      as={AlertDialogPrimitive.CloseButton}\n      size={local.size}\n      variant={local.variant}\n      {...others}\n    >\n      <span class={cn(\"cn-alert-dialog-cancel\", local.class)} data-slot=\"alert-dialog-cancel\">\n        {local.children}\n      </span>\n    </Button>\n  )\n}\n\nexport {\n  AlertDialog,\n  AlertDialogAction,\n  AlertDialogCancel,\n  AlertDialogContent,\n  AlertDialogDescription,\n  AlertDialogFooter,\n  AlertDialogHeader,\n  AlertDialogMedia,\n  AlertDialogOverlay,\n  AlertDialogPortal,\n  AlertDialogTitle,\n  AlertDialogTrigger\n}\n",
      "type": "registry:ui"
    }
  ]
}