;
}
/**
* Open an overlay: append a wrapper to `container`, `mount()` `content` inside
* it, wire the requested dismissals + (optionally) a focus trap, and return a
* handle. See {@link OverlayOptions}.
*/
declare function overlay(content: OverlayContent, options?: OverlayOptions): OverlayHandle;
/** Options for {@link popover}. */
interface PopoverOptions {
/** Where to append the popover wrapper. Default `document.body`. */
container?: Element;
/** Class on the wrapper. Default `'kerf-popover'`. */
className?: string;
/** Preferred side of the anchor. Flips to the other side if it would overflow the viewport. Default `'bottom'`. */
placement?: PopoverPlacement;
/** Horizontal edge to line up with the anchor: `'start'` (left edges) or `'end'` (right edges). Default `'start'`. */
align?: 'start' | 'end';
/** Gap in px between the anchor and the popover. Default `4`. */
gap?: number;
/**
* Which user actions dismiss the popover. Default `['outside']` (a click
* outside the popover, the anchor exempt). Pass `false` to close only via `close()`.
*/
dismiss?: DismissTrigger | DismissTrigger[] | false;
/** Focus behavior on open. Default `false` (non-modal — leave focus alone). */
initialFocus?: string | boolean;
/** Extra elements (besides the anchor) whose clicks do NOT count as outside. */
outsideIgnore?: Element | readonly Element[];
/** Called on any user-initiated dismissal. */
onDismiss?: () => void;
/**
* Host the popover in the browser top layer (the Popover API — `[popover]` +
* `showPopover()`) where supported, so it stacks above any `z-index` without a
* z-index war. Falls back to today's plain `` where unsupported. kerf keeps
* owning positioning + its own dismiss wiring; the popover is `popover="manual"`.
* See {@link OverlayOptions.native}. Default `false`.
*/
native?: boolean;
}
/**
* Anchored, non-modal overlay: positions `content` relative to `anchor` (below by
* default, flipping above if it would overflow, and clamped horizontally to the
* viewport) and repositions on scroll / resize while open. A thin wrapper over
* {@link overlay} with non-modal defaults — `trap: false`, `dismiss: ['outside']`,
* and the anchor added to `outsideIgnore` so the trigger click doesn't self-close.
* Returns the same {@link OverlayHandle}; `close()` also drops the reposition
* listeners. `position: fixed` is set inline (you style everything else).
*/
declare function popover(anchor: Element, content: OverlayContent, options?: PopoverOptions): OverlayHandle;
/** Content for a {@link tooltip}: text (auto-escaped), `SafeHtml`, or a render function. */
type TooltipContent = string | SafeHtml | (() => MountResult);
/** Options for {@link tooltip}. */
interface TooltipOptions extends AnchorPositionOptions {
/** Where to append the tooltip wrapper. Default `document.body`. */
container?: Element;
/** Class on the wrapper. Default `'kerf-tooltip'`. */
className?: string;
/** Delay in ms before showing after hover/focus enters. Default `400`. */
delay?: number;
/** Delay in ms before hiding after hover/focus leaves. Default `100`. */
hideDelay?: number;
/** ARIA role on the wrapper. Default `'tooltip'`. */
role?: string;
/** Host the tooltip in the browser top layer (the Popover API) where supported. See {@link OverlayOptions.native}. Default `false`. */
native?: boolean;
}
/**
* A hover/focus-triggered, non-modal, auto-hiding tooltip anchored to `anchor`.
* Shows after `delay` on `pointerenter`/`focus`, hides after `hideDelay` on
* `pointerleave`/`blur`, and positions itself with {@link autoReposition} (above
* the anchor by default). Unlike {@link popover} there is no click-dismiss model —
* it follows the pointer/focus. Returns a disposer that removes the anchor
* listeners and hides any shown tooltip. Structural only (kerf ships no CSS).
*/
declare function tooltip(anchor: Element, content: TooltipContent, options?: TooltipOptions): () => void;
export { type AnchorPositionOptions, type ChoiceAction, type ChoiceOptions, type ChoiceRenderSlots, type ConfirmOptions, type ConfirmRenderSlots, type DismissTrigger, type FieldValidator, type FormField, type FormOptions, type FormRenderField, type FormRenderSlots, type OverlayContent, type OverlayHandle, type OverlayOptions, type PopoverOptions, type PopoverPlacement, type PromptOptions, type PromptRenderSlots, type ToastContent, type ToastHandle, type ToastOptions, type ToastVariant, type TooltipContent, type TooltipOptions, autoReposition, choice, confirm, form, overlay, popover, positionAnchored, prompt, toast, tooltip };