import type { TemplateResult } from "lit-html";
import type { DirectiveResult } from "lit-html/directive.js";
export interface DialogOptions {
/**
* Called when the user clicks the backdrop — the dimmed area outside
* the dialog box. Typically used to close the dialog.
*/
onBackdropClick?: () => void;
/**
* Inline styles merged onto the backdrop div.
* Use this to customise the overlay colour, blur, z-index, etc.
*/
style?: Record;
/**
* Inline styles merged onto the inner dialog box wrapper div.
* Use this to control width, padding, border-radius, background, etc.
*/
dialogStyle?: Record;
}
/**
* `dialog(content, options?)` — renders a full-screen backdrop with your
* content centred inside it. Prevents body scroll while open. Cleans up
* automatically when the directive disconnects.
*
* Built on `htmlHook` — lifecycle is tied to where it appears in the template.
* Use a condition to show / hide it:
*
* @example
* ```ts
* const isOpen = atom(false);
*
* html`
*
*
* ${isOpen.val && dialog(html`
*