import { N as BoxOverflow, m as ResponsiveShadowProps, n as LayerProps, p as ResponsiveRadiusProps, r as Placement } from "./layer-ChlP9Ik6.js";
import { s as ThemeColorSchemeKey } from "./_system-CTe2lb5l.js";
import { t as CardTone } from "./card-C0a0wQTc.js";
import { Ref } from "react";
/**
 * @beta
 */
type PopoverMargins = [number, number, number, number];
/** @beta */
type PopoverUpdateCallback = () => void;
/** @public */
type PopoverWidth = number | 'auto';
/** @public */
interface PopoverProps extends Omit<LayerProps, 'as'>, ResponsiveRadiusProps, ResponsiveShadowProps {
  /** @beta */
  __unstable_margins?: PopoverMargins;
  /**
   * Whether the popover should animate in and out.
   *
   * @beta
   * @defaultValue false
   */
  animate?: boolean;
  arrow?: boolean;
  /** @deprecated Use `floatingBoundary` and/or `referenceBoundary` instead */
  boundaryElement?: never;
  children?: React.JSX.Element;
  /**
     * When `true`, prevent overflow within the current boundary:
     * - by flipping on its side axis
     * - by resizing
    /*
     * Note that:
     * - setting `preventOverflow` to `true` also prevents overflow on its side axis
     * - setting `matchReferenceWidth` to `true` also causes the popover to resize
     *
     * @defaultValue false
     */
  constrainSize?: boolean;
  content?: React.ReactNode;
  disabled?: boolean;
  fallbackPlacements?: Placement[];
  floatingBoundary?: HTMLElement | null;
  /**
   * When `true`, set the maximum width to match the reference element, and also prevent overflow within
   * the current boundary by resizing.
   *
   * Note that setting `constrainSize` to `true` also causes the popover to resize
   *
   * @defaultValue false
   */
  matchReferenceWidth?: boolean;
  /**
   * When true, blocks all pointer interaction with elements beneath the popover until closed.
   *
   * @beta
   * @defaultValue false
   */
  modal?: boolean;
  /**
   * Whether the popover is open.
   *
   * Set it inside `startTransition`. A closed popover pre-renders its content hidden, in a
   * transition, once the reference element shows intent to open it (focus, a pointer entering or
   * pressing it). Opening in a transition too lets React keep rendering that content in the
   * background when the open comes before it is done, instead of rendering it synchronously in the
   * click. Content that was pre-rendered already shows in the first frame after the click either
   * way.
   *
   * ```tsx
   * const [open, setOpen] = useState(false)
   *
   * <Popover content={content} open={open}>
   *   <Button onClick={() => startTransition(() => setOpen((isOpen) => !isOpen))} text="Toggle" />
   * </Popover>
   * ```
   *
   * Wrap the state update itself: a `startTransition` around code that schedules the update for
   * later (a timeout) does not reach it.
   */
  open?: boolean;
  overflow?: BoxOverflow;
  padding?: number | number[];
  placement?: Placement;
  /**
   * When 'flip' (default), the placement is determined from the initial placement and the
   * fallback placements in order. Whichever fits in the viewport first.
   *
   * When 'autoPlacement', the initial placement and all fallback placements are evaluated
   * and the placement with the most viewport space available.
   *
   * Option is only relevant if either `constrainSize` or `preventOverflow` is `true`
   */
  placementStrategy?: 'flip' | 'autoPlacement';
  /** Whether or not to render the popover in a portal element. */
  portal?: boolean | string;
  preventOverflow?: boolean;
  referenceBoundary?: HTMLElement | null;
  /**
   * When defined, the popover will be positioned relative to this element.
   * The children of the popover won't be rendered.
   */
  referenceElement?: HTMLElement | null;
  scheme?: ThemeColorSchemeKey;
  tone?: CardTone;
  /** @beta */
  updateRef?: Ref<PopoverUpdateCallback | undefined>;
  width?: PopoverWidth | PopoverWidth[];
}
/**
 * The `Popover` component is used to display some content on top of another.
 *
 * @public
 */
declare function Popover(props: PopoverProps & Omit<React.HTMLProps<HTMLDivElement>, 'as' | 'children' | 'content' | 'width'>): React.JSX.Element;
export { PopoverMargins as a, PopoverWidth as i, PopoverProps as n, PopoverUpdateCallback as r, Popover as t };
//# sourceMappingURL=popover-HDVgZg5e.d.ts.map