{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "alert-dialog",
  "title": "Alert Dialog",
  "description": "A confirmation that rises out of a blur, with the warning icon popping in before the rest.",
  "dependencies": [
    "@ui-sdk/core@0.1.0-beta.2",
    "@ui-sdk/react@0.1.0-beta.2"
  ],
  "registryDependencies": [
    "@keyframery/motion"
  ],
  "files": [
    {
      "path": "registry/components/keyframery/primitives/alert-dialog.tsx",
      "content": "\"use client\"\n\n/* Animated drop-in for `@ui-sdk/react/alert-dialog`: same parts, same props. Swap the import and keep\n   your code. This file adds motion only. Colours, radii, shadows and spacing stay yours. */\n\nimport {\n  AlertDialogBackdrop as AlertDialogBackdropPart,\n  AlertDialogClose as AlertDialogClosePart,\n  AlertDialogContent as AlertDialogContentPart,\n  AlertDialogTrigger as AlertDialogTriggerPart,\n} from \"@ui-sdk/react/alert-dialog\"\nimport * as React from \"react\"\n\nimport { cn } from \"@/lib/utils\"\n\nexport * from \"@ui-sdk/react/alert-dialog\"\n\n/* Press: the key gives under the finger and springs back on release. */\nconst press =\n  \"transition-[scale] duration-[calc(200ms*var(--kf-speed,1))] ease-pop not-data-disabled:not-data-pending:active:scale-[0.96] motion-reduce:transition-none!\"\n\n/* Cascade: each direct child of the content (a header, a body, a footer) rises in out of a blur a\n   little after the one before it. It is a keyframe animation rather than a transition because the\n   children have no earlier style to transition from when the content first appears. Close buttons\n   and arrows are left out so their own presses stay quick, and nothing on the children transitions,\n   so a hover is never delayed. */\nconst cascadeKeyframes = \"@keyframes kf-cascade{from{opacity:0;translate:0 8px;filter:blur(4px)}}@media (prefers-reduced-motion:reduce){@keyframes kf-cascade{from{opacity:0}}}\"\nconst cascade = cn(\n  \"[&>*:not([data-slot$=-close],[data-slot$=-arrow])]:animate-[kf-cascade_calc(420ms*var(--kf-speed,1))_var(--ease-spring)_backwards]\",\n  \"[&>*:not([data-slot$=-close],[data-slot$=-arrow])]:[animation-delay:calc(calc(40ms*var(--kf-speed,1))+(min(sibling-index(),10)-1)*calc(40ms*var(--kf-speed,1)))]\",\n  \"motion-reduce:[&>*]:animate-none\",\n)\n\nfunction AlertDialogTrigger({ className, ...props }: React.ComponentProps<typeof AlertDialogTriggerPart>) {\n  return <AlertDialogTriggerPart className={cn(press, className)} {...props} />\n}\n\nfunction AlertDialogClose({ className, ...props }: React.ComponentProps<typeof AlertDialogClosePart>) {\n  return <AlertDialogClosePart className={cn(press, className)} {...props} />\n}\n\n/* The page behind softens into a blur as it dims, and clears faster than it came. */\nfunction AlertDialogBackdrop({ className, ...props }: React.ComponentProps<typeof AlertDialogBackdropPart>) {\n  return (\n    <AlertDialogBackdropPart\n      className={cn(\n        \"backdrop-blur-[4px] transition-[opacity,backdrop-filter] duration-[calc(380ms*var(--kf-speed,1))] ease-house\",\n        \"data-starting-style:opacity-0 data-starting-style:backdrop-blur-none\",\n        \"data-ending-style:opacity-0 data-ending-style:backdrop-blur-none data-ending-style:duration-[calc(180ms*var(--kf-speed,1))]\",\n        \"motion-reduce:transition-none!\",\n        className,\n      )}\n      {...props}\n    />\n  )\n}\n\n/* Unfold from below: the sheet rises 24px out of a blur, grows from 0.9 and settles on a spring,\n   then its sections cascade in. It leaves quickly, sinking a little. */\nfunction AlertDialogContent<Payload = unknown>({\n  className,\n  ...props\n}: React.ComponentProps<typeof AlertDialogContentPart<Payload>>) {\n  return (\n    <>\n      <style href=\"kf-cascade\" precedence=\"default\">\n        {cascadeKeyframes}\n      </style>\n      <AlertDialogContentPart<Payload>\n        className={cn(\n          \"group/alert-dialog transition-[opacity,scale,translate,filter] duration-[calc(420ms*var(--kf-speed,1))] ease-spring\",\n          \"data-starting-style:translate-y-6 data-starting-style:scale-[0.9] data-starting-style:opacity-0 data-starting-style:blur-[8px]\",\n          \"data-ending-style:translate-y-2 data-ending-style:scale-[0.96] data-ending-style:opacity-0 data-ending-style:blur-[4px] data-ending-style:duration-[calc(180ms*var(--kf-speed,1))] data-ending-style:ease-house\",\n          \"data-nested-open:scale-[0.95] data-nested-open:opacity-70\",\n          cascade,\n          \"motion-reduce:transition-none!\",\n          className,\n        )}\n        {...props}\n      />\n    </>\n  )\n}\n\nexport { AlertDialogBackdrop, AlertDialogClose, AlertDialogContent, AlertDialogTrigger }\n",
      "type": "registry:component",
      "target": "components/keyframery/primitives/alert-dialog.tsx"
    },
    {
      "path": "registry/components/keyframery/alert-dialog.tsx",
      "content": "\"use client\"\n\n/* Styled alert dialog: the animated primitive plus the Keyframery look. */\n\nimport {\n  AlertDialog as AlertDialogRoot,\n  AlertDialogBackdrop as AlertDialogBackdropPart,\n  AlertDialogClose as AlertDialogClosePart,\n  AlertDialogContent as AlertDialogContentPart,\n  AlertDialogDescription as AlertDialogDescriptionPart,\n  AlertDialogShortcut as AlertDialogShortcutPart,\n  AlertDialogTitle as AlertDialogTitlePart,\n  AlertDialogTrigger as AlertDialogTriggerPart,\n} from \"@/components/keyframery/primitives/alert-dialog\"\nimport * as React from \"react\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype AlertDialogCloseVariant = \"default\" | \"primary\" | \"destructive\"\n\n\nconst keyBase = cn(\n  \"group/key relative inline-flex h-8 shrink-0 cursor-pointer items-center justify-center gap-1.5 rounded-[9px] px-3 text-[13px] leading-none font-medium whitespace-nowrap outline-none select-none [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0\",\n  /* The primitive presses the key; colour and shadow ride the same 200ms pop. */\n  \"transition-[color,background-color,box-shadow,opacity,scale] duration-[calc(200ms*var(--kf-speed,1))] ease-pop\",\n  \"focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background\",\n  \"data-disabled:cursor-not-allowed data-disabled:opacity-50 data-pending:cursor-progress\",\n  \"motion-reduce:transition-none!\",\n)\n\nconst keySurface = cn(\n  \"bg-background text-foreground dark:bg-accent\",\n  \"shadow-[0_0_0_1px_rgb(0_0_0/0.06),0_1px_1px_rgb(0_0_0/0.05),0_3px_6px_-2px_rgb(0_0_0/0.1)]\",\n  \"dark:shadow-[0_0_0_1px_rgb(255_255_255/0.07),inset_0_1px_0_rgb(255_255_255/0.08),0_2px_6px_-1px_rgb(0_0_0/0.6)]\",\n  \"not-data-disabled:hover:bg-[color-mix(in_oklab,var(--background),var(--foreground)_3%)]\",\n  \"dark:not-data-disabled:hover:bg-[color-mix(in_oklab,var(--accent),var(--foreground)_7%)]\",\n  \"not-data-disabled:hover:shadow-[0_0_0_1px_rgb(0_0_0/0.1),0_1px_1px_rgb(0_0_0/0.05),0_4px_8px_-2px_rgb(0_0_0/0.12)]\",\n  \"dark:not-data-disabled:hover:shadow-[0_0_0_1px_rgb(255_255_255/0.12),inset_0_1px_0_rgb(255_255_255/0.1),0_2px_6px_-1px_rgb(0_0_0/0.6)]\",\n  \"not-data-disabled:active:shadow-[0_0_0_1px_rgb(0_0_0/0.1),0_1px_1px_rgb(0_0_0/0.04),0_1px_2px_-1px_rgb(0_0_0/0.06)]\",\n  \"dark:not-data-disabled:active:shadow-[0_0_0_1px_rgb(255_255_255/0.09),inset_0_1px_0_rgb(255_255_255/0.04),0_1px_2px_-1px_rgb(0_0_0/0.6)]\",\n)\n\nconst closeVariants: Record<AlertDialogCloseVariant, string> = {\n  default: keySurface,\n  primary: cn(\n    \"bg-primary text-primary-foreground\",\n    \"shadow-[inset_0_1px_0_rgb(255_255_255/0.14),0_1px_2px_rgb(0_0_0/0.25)]\",\n    \"dark:shadow-[inset_0_1px_0_rgb(255_255_255/0.7),0_1px_2px_rgb(0_0_0/0.5)]\",\n    \"not-data-disabled:hover:bg-[color-mix(in_oklab,var(--primary),var(--background)_14%)]\",\n    \"not-data-disabled:active:shadow-[inset_0_1px_0_rgb(255_255_255/0.08),0_0_1px_rgb(0_0_0/0.3)]\",\n  ),\n  /* The answer that cannot be undone: a solid red key. */\n  destructive: cn(\n    \"bg-destructive text-background dark:bg-[color-mix(in_oklab,var(--destructive),var(--background)_24%)] dark:text-foreground\",\n    \"shadow-[inset_0_1px_0_rgb(255_255_255/0.18),0_1px_2px_rgb(0_0_0/0.2)]\",\n    \"dark:shadow-[inset_0_1px_0_rgb(255_255_255/0.16),0_1px_2px_rgb(0_0_0/0.5)]\",\n    \"not-data-disabled:hover:bg-[color-mix(in_oklab,var(--destructive),var(--foreground)_10%)]\",\n    \"dark:not-data-disabled:hover:bg-[color-mix(in_oklab,var(--destructive),var(--background)_14%)]\",\n    \"not-data-disabled:active:shadow-[inset_0_1px_0_rgb(255_255_255/0.08),0_0_1px_rgb(0_0_0/0.3)]\",\n  ),\n}\n\nconst swap = \"transition-[opacity,scale,filter] duration-[calc(200ms*var(--kf-speed,1))] ease-house motion-reduce:transition-none!\"\n\nfunction AlertDialog(props: React.ComponentProps<typeof AlertDialogRoot>) {\n  return <AlertDialogRoot {...props} />\n}\n\n/* A key by default, in red for `variant=\"destructive\"`. Pass `render` to use your own button. */\nfunction AlertDialogTrigger({\n  className,\n  variant = \"default\",\n  ...props\n}: React.ComponentProps<typeof AlertDialogTriggerPart> & {\n  variant?: \"default\" | \"destructive\"\n}) {\n  return (\n    <AlertDialogTriggerPart\n      data-variant={variant}\n      className={cn(\n        !props.render && [\n          keyBase,\n          keySurface,\n          variant === \"destructive\" && [\n            \"text-destructive\",\n            \"not-data-disabled:hover:bg-[color-mix(in_oklab,var(--background),var(--destructive)_7%)]\",\n            \"dark:not-data-disabled:hover:bg-[color-mix(in_oklab,var(--accent),var(--destructive)_14%)]\",\n          ],\n        ],\n        props.render && \"outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2\",\n        className,\n      )}\n      {...props}\n    />\n  )\n}\n\nfunction AlertDialogBackdrop({\n  className,\n  ...props\n}: React.ComponentProps<typeof AlertDialogBackdropPart>) {\n  return (\n    <AlertDialogBackdropPart\n      className={cn(\n        \"fixed inset-0 bg-black/25 dark:bg-black/55\",\n        className,\n      )}\n      {...props}\n    />\n  )\n}\n\n/* The same sheet as the dialog. The primitive unfolds it from below and cascades its sections in. */\nfunction AlertDialogContent({\n  className,\n  ...props\n}: React.ComponentProps<typeof AlertDialogContentPart>) {\n  return (\n    <AlertDialogContentPart\n      className={cn(\n        \"fixed inset-0 m-auto h-fit max-h-[calc(100dvh-32px)] w-[min(400px,calc(100vw-32px))] max-w-none overflow-y-auto overscroll-contain\",\n        \"border-0 p-5 outline-none backdrop:bg-transparent\",\n        \"rounded-[18px] bg-popover text-popover-foreground\",\n        \"shadow-[0_0_0_1px_rgb(0_0_0/0.06),0_2px_6px_-2px_rgb(0_0_0/0.08),0_24px_56px_-12px_rgb(0_0_0/0.28)]\",\n        \"dark:shadow-[0_0_0_1px_rgb(255_255_255/0.08),0_24px_56px_-12px_rgb(0_0_0/0.8)]\",\n        className,\n      )}\n      {...props}\n    />\n  )\n}\n\n/* A round tile for the icon that says what is at stake. It is the first section to cascade in,\n   and it pops: it starts small and overshoots a little as it lands. */\nfunction AlertDialogMedia({ className, ...props }: React.ComponentProps<\"div\">) {\n  return (\n    <>\n      <style href=\"kf-pop\" precedence=\"default\">\n        {\"@keyframes kf-pop{from{scale:0.4}}\"}\n      </style>\n      <div\n        data-slot=\"alert-dialog-media\"\n        aria-hidden\n        className={cn(\n          \"mb-4 grid size-10 place-items-center rounded-full bg-destructive/10 text-destructive dark:bg-destructive/15 [&_svg]:size-5\",\n          \"animate-[kf-cascade_calc(420ms*var(--kf-speed,1))_var(--ease-spring)_backwards,kf-pop_calc(560ms*var(--kf-speed,1))_var(--ease-pop)_backwards]!\",\n          \"motion-reduce:animate-none!\",\n          className,\n        )}\n        {...props}\n      />\n    </>\n  )\n}\n\nfunction AlertDialogHeader({ className, ...props }: React.ComponentProps<\"div\">) {\n  return (\n    <div data-slot=\"alert-dialog-header\" className={cn(\"flex flex-col gap-1\", className)} {...props} />\n  )\n}\n\n/* The answers: Cancel first, the action last, each half the width. */\nfunction AlertDialogFooter({ className, ...props }: React.ComponentProps<\"div\">) {\n  return (\n    <div\n      data-slot=\"alert-dialog-footer\"\n      className={cn(\"mt-5 grid auto-cols-fr grid-flow-col gap-2 *:w-full\", className)}\n      {...props}\n    />\n  )\n}\n\nfunction AlertDialogTitle({\n  className,\n  ...props\n}: React.ComponentProps<typeof AlertDialogTitlePart>) {\n  return (\n    <AlertDialogTitlePart\n      className={cn(\"text-[15px] leading-5 font-semibold tracking-tight\", className)}\n      {...props}\n    />\n  )\n}\n\nfunction AlertDialogDescription({\n  className,\n  ...props\n}: React.ComponentProps<typeof AlertDialogDescriptionPart>) {\n  return (\n    <AlertDialogDescriptionPart\n      className={cn(\"text-[13px] leading-5 text-muted-foreground\", className)}\n      {...props}\n    />\n  )\n}\n\n/* A key for each answer. While its action runs, the label gives its place to a spinner,\n   so the key keeps its width. */\nfunction AlertDialogClose({\n  className,\n  variant = \"default\",\n  children,\n  ...props\n}: React.ComponentProps<typeof AlertDialogClosePart> & { variant?: AlertDialogCloseVariant }) {\n  return (\n    <AlertDialogClosePart\n      data-variant={variant}\n      className={cn(!props.render && [keyBase, closeVariants[variant]], className)}\n      {...props}\n    >\n      {props.render || typeof children === \"function\" ? (\n        children\n      ) : (\n        <span className=\"inline-grid place-items-center *:[grid-area:1/1]\">\n          <span\n            className={cn(\n              \"inline-flex items-center gap-1.5\",\n              swap,\n              \"group-data-pending/key:scale-95 group-data-pending/key:opacity-0 group-data-pending/key:blur-[2px]\",\n            )}\n          >\n            {children}\n          </span>\n          <span\n            aria-hidden\n            className={cn(\n              \"grid scale-50 place-items-center opacity-0 blur-[2px]\",\n              swap,\n              \"group-data-pending/key:scale-100 group-data-pending/key:opacity-100 group-data-pending/key:blur-none\",\n            )}\n          >\n            <svg\n              viewBox=\"0 0 16 16\"\n              fill=\"none\"\n              stroke=\"currentColor\"\n              strokeWidth=\"1.5\"\n              strokeLinecap=\"round\"\n              className=\"size-4 animate-spin [animation-duration:calc(700ms*var(--kf-speed,1))] [animation-play-state:paused] group-data-pending/key:[animation-play-state:running] motion-reduce:[animation-duration:calc(1600ms*var(--kf-speed,1))]\"\n            >\n              <circle cx=\"8\" cy=\"8\" r=\"5.75\" opacity=\"0.28\" />\n              <path d=\"M8 2.25A5.75 5.75 0 0 1 13.75 8\" />\n            </svg>\n          </span>\n        </span>\n      )}\n    </AlertDialogClosePart>\n  )\n}\n\nfunction AlertDialogShortcut({\n  className,\n  ...props\n}: React.ComponentProps<typeof AlertDialogShortcutPart>) {\n  return (\n    <AlertDialogShortcutPart\n      className={cn(\n        \"ms-1 text-[12px] leading-none tracking-[0.04em] text-muted-foreground tabular-nums\",\n        className,\n      )}\n      {...props}\n    />\n  )\n}\n\nexport {\n  AlertDialog,\n  AlertDialogBackdrop,\n  AlertDialogClose,\n  AlertDialogContent,\n  AlertDialogDescription,\n  AlertDialogFooter,\n  AlertDialogHeader,\n  AlertDialogMedia,\n  AlertDialogShortcut,\n  AlertDialogTitle,\n  AlertDialogTrigger,\n}\n",
      "type": "registry:component",
      "target": "components/keyframery/alert-dialog.tsx"
    }
  ],
  "type": "registry:component"
}