import { cn } from "@bigmoves/bff/components"; import type { FunctionalComponent, JSX } from "preact"; import { Button, ButtonProps } from "./Button.tsx"; type DialogProps = JSX.HTMLAttributes & { _?: string } & { children: preact.ComponentChildren; }; type DialogContentProps = JSX.HTMLAttributes & { children: preact.ComponentChildren; }; type DialogTitleProps = { children: preact.ComponentChildren; }; type DialogCloseProps = JSX.HTMLAttributes & ButtonProps & { children: preact.ComponentChildren; }; type DialogXProps = JSX.HTMLAttributes; const _closeOnClick = "on click trigger closeDialog"; const Dialog: FunctionalComponent & { Content: FunctionalComponent; Title: FunctionalComponent; Close: FunctionalComponent; X: FunctionalComponent; _closeOnClick: string; } = ({ children, class: classProp, _ = "", ...props }) => { return (
trigger closeDialog init add .pointer-events-none to document.body add .pointer-events-auto to me add [@data-scroll-locked=true] to document.body ${_}`, }} {...props} >
{children}
); }; const DialogContent: FunctionalComponent = ( { children, class: classProp, ...props }, ) => { return (
{children}
); }; const DialogTitle: FunctionalComponent = ({ children }) => { return (

{children}

); }; const DialogX: FunctionalComponent = ({ class: classProp, }) => { return ( ); }; const DialogClose: FunctionalComponent = ( { children, ...props }, ) => { return ( ); }; Dialog.Content = DialogContent; Dialog.Title = DialogTitle; Dialog.Close = DialogClose; Dialog.X = DialogX; Dialog._closeOnClick = _closeOnClick; export { Dialog };