import type { JSX } from "@solidjs/web"; import { type MaybeAccessor } from "../../internals/maybe-accessor.js"; import { type PreviewCardRootChangeEventDetails, type PreviewCardRootChangeEventReason, type PreviewCardRootState } from "../preview-card-root-context.js"; import { type PreviewCardHandle } from "../store/preview-card-store.js"; export type { PreviewCardRootChangeEventDetails, PreviewCardRootChangeEventReason, PreviewCardRootState, }; /** * Imperative actions surface written into `actionsRef` on ``. * Mirrors React's `PreviewCardRoot.Actions`. */ export interface PreviewCardRootActions { close: () => void; unmount: () => void; } /** * Render-function child variant — mirrors React's `PayloadChildRenderFunction`. * Called with the active trigger's `payload`. */ export type PreviewCardPayloadChildRenderFunction = (ctx: { payload: Payload | undefined; }) => JSX.Element; export interface PreviewCardRootProps { /** * Controlled open state. When provided (resolved value not * `undefined`), the consumer owns the state — pair with * {@link onOpenChange}. When omitted, the preview card manages its own * open state (seeded from {@link defaultOpen}), matching React Base UI. */ open?: MaybeAccessor; /** * Initial open state when uncontrolled. Read once at mount. * @default false */ defaultOpen?: MaybeAccessor; /** * Fires on every open/close request (hover, focus, Escape, outside * press, etc.). Calling `eventDetails.cancel()` keeps the preview * card's own (uncontrolled) state unchanged, mirroring React Base UI; * controlled consumers simply don't update their signal. */ onOpenChange?: ((open: boolean, eventDetails: PreviewCardRootChangeEventDetails) => void) | undefined; onOpenChangeComplete?: ((open: boolean) => void) | undefined; /** * Callback-ref (or `{ current }`) variant of React's `actionsRef`. Solid * deviation: React exposes this as `RefObject`; the Solid port * accepts either form. */ actionsRef?: ((actions: PreviewCardRootActions | null) => void) | { current: PreviewCardRootActions | null; } | undefined; /** Handle for detached triggers / imperative control. */ handle?: PreviewCardHandle | undefined; /** Active trigger id (controlled). */ triggerId?: string | null | undefined; children?: JSX.Element | PreviewCardPayloadChildRenderFunction; } /** * Groups all parts of the preview card. Doesn't render its own HTML element — * the root is a pure context provider. * * Wraps the component tree in `` unless we're already nested * inside one (matches Base UI React's behavior so cross-tree events — like * dismiss-on-outside-press — propagate correctly for preview cards rendered * inside other popups). */ export declare function PreviewCardRoot(props: PreviewCardRootProps): JSX.Element; //# sourceMappingURL=preview-card-root.d.ts.map