import { Dialog as DialogPrimitive } from "@kobalte/core/dialog"; import type { ComponentProps, ParentProps, ValidComponent } from "solid-js"; import { splitProps } from "solid-js"; import { IconX } from "@/components/ui/icons"; import { cn } from "@/lib/cn"; export const Dialog = DialogPrimitive; export const DialogTrigger = DialogPrimitive.Trigger; export const DialogClose = DialogPrimitive.CloseButton; export function DialogContent( props: ComponentProps> & { dismissable?: boolean }, ) { const [local, rest] = splitProps(props as ComponentProps & { dismissable?: boolean }, [ "class", "children", "dismissable", ]); return ( {/* z-[70]: above the mobile nav sheet (z-60) and tab bar (z-40). */} {/* flex center — animate-fade-up must not own transform positioning */} {/* The centring box is inset by the system bars, so a tall dialog is never clipped by the status bar or the gesture bar. */}
e.preventDefault() : undefined} onInteractOutside={local.dismissable === false ? (e) => e.preventDefault() : undefined} onEscapeKeyDown={local.dismissable === false ? (e) => e.preventDefault() : undefined} {...rest} > {local.children}
); } export function DialogHeader(props: ParentProps<{ class?: string }>) { return
{props.children}
; } export function DialogBody(props: ParentProps<{ class?: string }>) { return
{props.children}
; } export function DialogTitle( props: ComponentProps>, ) { const [local, rest] = splitProps(props as ComponentProps, ["class"]); return ( ); } export function DialogDescription( props: ComponentProps>, ) { const [local, rest] = splitProps(props as ComponentProps, ["class"]); return ( ); }