{ "$schema": "https://ui.shadcn.com/schema/registry-item.json", "name": "alert-dialog", "type": "registry:ui", "title": "Alert Dialog", "files": [ { "path": "ui/alert-dialog.tsrx", "type": "registry:ui", "target": "components/ui/alert-dialog.tsrx", "content": "// Base UI base alert-dialog — transcribed from upstream's `bases/base-ui/ui/alert-dialog.tsx`\n// (maintainer-supplied), running on @octanejs/base-ui's AlertDialog. Upstream part mapping:\n// Overlay -> Backdrop, Content -> Popup, Cancel -> Close. This port also composes Action via Close.\n//\n// TWO DELIBERATE DEPARTURES FROM THE SOURCE:\n// - Upstream's AlertDialogTitle carries `cn-font-heading`, a semantic hook from the pinned cn-*\n// system. This package ships the default-Tailwind utilities-inlined flavor instead, the\n// react-aria base already drops this exact class for that reason, and nothing in the playground\n// defines it (0 occurrences in the built CSS), so keeping it would ship a class that resolves\n// to nothing. Every other class string is verbatim.\n// - Upstream renders AlertDialogAction as a plain Button, so it does not dismiss the dialog.\n// Composing it through Close preserves the public Button-like API and supplies the expected\n// confirm-and-dismiss behavior shown by Base UI's own alert-dialog examples.\n//\n// Octane adaptations: no `\"use client\"`; refs are props. AlertDialogContent composes its\n// Portal/Overlay/Popup tree internally, so consumer children still flow through the ordinary\n// props.children channel.\nimport { AlertDialog as AlertDialogPrimitive } from '@octanejs/base-ui/alert-dialog';\n\nimport { cn } from '@/lib/utils';\nimport type { DivProps } from '@/lib/types';\nimport { Button } from '@/components/ui/button';\n\nexport function AlertDialog({ ...props }: Record) @{\n\t\n}\n\nexport function AlertDialogTrigger({ ...props }: Record) @{\n\t\n}\n\nexport function AlertDialogPortal({ ...props }: Record) @{\n\t\n}\n\nexport function AlertDialogOverlay({ className, ...props }: Record) @{\n\t\n}\n\nexport function AlertDialogContent({ className, size = 'default', ...props }: Record<\n\tstring,\n\tany\n>) @{\n\t\n\t\t\n\t\t\n\t\n}\n\nexport function AlertDialogHeader({ className, ...props }: DivProps) @{\n\t\n}\n\nexport function AlertDialogFooter({ className, ...props }: DivProps) @{\n\t\n}\n\nexport function AlertDialogMedia({ className, ...props }: DivProps) @{\n\t\n}\n\nexport function AlertDialogTitle({ className, ...props }: Record) @{\n\t\n}\n\nexport function AlertDialogDescription({ className, ...props }: Record) @{\n\t\n}\n\nexport function AlertDialogAction({\n\tclassName,\n\tvariant = 'default',\n\tsize = 'default',\n\t...props\n}: Record) @{\n\t}\n\t\t{...props}\n\t/>\n}\n\n// `render` takes an ELEMENT here, not a function — that is Base UI's render-prop contract, and\n// it is what lets each action keep Close's dismiss behavior while looking like a Button.\nexport function AlertDialogCancel({\n\tclassName,\n\tvariant = 'outline',\n\tsize = 'default',\n\t...props\n}: Record) @{\n\t}\n\t\t{...props}\n\t/>\n}\n" } ], "dependencies": [ "@octanejs/base-ui@0.1.36" ], "registryDependencies": [ "@octane/button", "@octane/types", "@octane/utils" ] }