`, and the panel is not rendered on the server at all — it appears
* after mount. Both are needed together: a `
` start tag closes an open
* `
` regardless of how deeply it is nested, so wrapping the trigger alone
* leaves the panel to break the paragraph instead.
*
* Withholding the panel costs nothing the server render was providing: it is
* hidden and `inert` until opened, and opening requires the client anyway.
*
* Without it, an SSR'd page with a popover in a paragraph emits invalid HTML.
* The parser repairs it by closing the `
` early, which makes the server DOM
* differ from the component tree — Svelte logs `node_invalid_placement_ssr`
* and then `hydration_mismatch`, and the layout visibly shifts on hydration.
*
* **Cost:** the panel is absent from the prerendered HTML, so a non-rendering
* crawler never sees its content and the first paint has nothing to show if
* the popover is meant to open immediately. Leave it off for popovers in
* block context, where the default markup is already valid.
*
* @default false
* @summary Renders legally inside a paragraph — for triggers that sit in flowing text.
*/
inline?: boolean;
/**
* Override the enter/exit fade duration in ms. Defaults to the shared token
* `--blocks-popover-duration` (150ms; collapses to 1ms under
* `prefers-reduced-motion`).
*/
transitionDuration?: number;
/**
* Override the enter/exit easing as a CSS `` (e.g.
* `'linear'`, `'ease-out'`, `'cubic-bezier(0.4,0,0.2,1)'`). Defaults to the
* token `--blocks-popover-easing`. A CSS string, not a JS easing fn, because
* the popover motion is a pure CSS transition.
*/
transitionEasing?: string;
/**
* Whether the popover closes on Escape key. Default `true`.
* Set to `false` for cases where Escape should be intercepted by an
* inner widget (e.g. an editable cell that wants to revert on Escape).
*/
closeOnEscape?: boolean;
/**
* Whether the popover closes on outside click / pointer interaction.
* Default `true`. Set to `false` to pin the popover open until the
* consumer explicitly toggles `open`.
*/
closeOnClickOutside?: boolean;
/** Fires when the popover opens or closes from user interaction (click, escape, click-outside). Receives the new open state. */
onOpenChange?: (open: boolean) => void;
/**
* Fires after an outside click closes the popover. Use for analytics
* or to clear ephemeral state on dismiss. Does NOT control whether the
* popover closes — that is governed by `closeOnClickOutside`.
*/
onClickOutside?: () => void;
/**
* Fires after Escape closes the popover. Use for analytics or to clear
* ephemeral state on dismiss. Does NOT control whether the popover
* closes — that is governed by `closeOnEscape`.
*/
onEscape?: () => void;
/** Extra classes merged onto the floating panel element. */
class?: string;
/** Strip all default tv() classes (including the enter/exit motion). Combine with `class` or `slotClasses` for full custom styling; the panel always carries `data-state="open" | "closed"`, so custom motion can rebuild on that hook (see `popoverMotion` in popover.variants.ts for the reference implementation). */
unstyled?: boolean;
/** Per-slot class overrides. Available slots: `base` (the floating panel). */
slotClasses?: Partial>;
/**
* Apply a named preset registered via ``.
* Prefer this over `class` overrides when the requested look falls outside the
* semantic intent palette — presets keep hover/active/dark-mode logic coherent
* and make the custom look reusable across the project.
*/
preset?: string;
}
export { default as Popover } from './Popover.svelte';
export { type PopoverVariants, popoverMotion, popoverVariants } from './popover.variants.js';