import { t as PopoverStore } from "./popover-store-BJQhU0yZ.js";
import { n as DialogOptions } from "./dialog-C5LdRvvE.js";
import { Props } from "@ariakit/react-utils";
import { ElementType, HTMLAttributes } from "react";
//#region src/popover/popover.d.ts
declare const TagName = "div";
type TagName = typeof TagName;
interface AnchorRect {
  x?: number;
  y?: number;
  width?: number;
  height?: number;
}
interface OverflowPaddingObject {
  top?: number;
  right?: number;
  bottom?: number;
  left?: number;
}
type OverflowPadding = number | OverflowPaddingObject;
/**
 * Returns props to create a `Popover` component.
 * @see https://ariakit.com/components/popover
 * @example
 * ```jsx
 * const store = usePopoverStore();
 * const props = usePopover({ store });
 * <Role {...props}>Popover</Role>
 * ```
 */
declare const usePopover: import("@ariakit/react-utils").Hook<"div", PopoverOptions<"div">>;
/**
 * Renders a popover element that's automatically positioned relative to an
 * anchor element.
 * @see https://ariakit.com/components/popover
 * @example
 * ```jsx {3}
 * <PopoverProvider>
 *   <PopoverDisclosure>Disclosure</PopoverDisclosure>
 *   <Popover>Popover</Popover>
 * </PopoverProvider>
 * ```
 */
declare const Popover: (props: PopoverProps<"div">) => import("react").JSX.Element | null;
interface PopoverOptions<T extends ElementType = TagName> extends DialogOptions<T> {
  /**
   * Object returned by the
   * [`usePopoverStore`](https://ariakit.com/reference/use-popover-store) hook.
   * If not provided, the closest
   * [`PopoverProvider`](https://ariakit.com/reference/popover-provider)
   * component's context will be used.
   */
  store?: PopoverStore;
  /**
   * Props that will be passed to the popover wrapper element. This element will
   * be used to position the popover.
   *
   * Live examples:
   * - [Navigation Menubar](https://ariakit.com/examples/menubar-navigation)
   * - [Sliding Menu](https://ariakit.com/examples/menu-slide)
   */
  wrapperProps?: HTMLAttributes<HTMLDivElement>;
  /**
   * Whether the popover has `position: fixed` or not.
   * @default false
   */
  fixed?: boolean;
  /**
   * @default false
   */
  modal?: DialogOptions<T>["modal"];
  /**
   * @default false
   */
  portal?: DialogOptions<T>["portal"];
  /**
   * The distance, in pixels, between the popover and the anchor element.
   *
   * Live examples:
   * - [Combobox filtering](https://ariakit.com/examples/combobox-filtering)
   * - [Form with Select](https://ariakit.com/examples/form-select)
   * - [Hovercard with keyboard support](https://ariakit.com/examples/hovercard-disclosure)
   * - [MenuItemRadio](https://ariakit.com/examples/menu-item-radio)
   * - [Submenu](https://ariakit.com/examples/menu-nested)
   * - [Toolbar with Select](https://ariakit.com/examples/toolbar-select)
   * @default 0
   */
  gutter?: number;
  /**
   * The skidding, in pixels, of the popover along the anchor element. Can be
   * set to negative values to make the popover shift to the opposite side.
   *
   * Live examples:
   * - [Combobox with Tabs](https://ariakit.com/examples/combobox-tabs)
   * - [Navigation Menubar](https://ariakit.com/examples/menubar-navigation)
   * - [Submenu](https://ariakit.com/examples/menu-nested)
   * - [Menubar](https://ariakit.com/components/menubar)
   * - [Select with Combobox and
   *   Tabs](https://ariakit.com/examples/select-combobox-tab)
   * @default 0
   */
  shift?: number;
  /**
   * Controls the behavior of the popover when it overflows the viewport:
   * - If a `boolean`, specifies whether the popover should flip to the opposite
   *   side when it overflows.
   * - If a `string`, indicates the preferred fallback placements when it
   *   overflows. The placements must be spaced-delimited, e.g. "top left".
   *
   * Live examples:
   * - [Sliding Menu](https://ariakit.com/examples/menu-slide)
   * - [Menubar](https://ariakit.com/components/menubar)
   * @default true
   */
  flip?: boolean | string;
  /**
   * Whether the popover should slide when it overflows.
   * @default true
   */
  slide?: boolean;
  /**
   * Whether the popover can overlap the anchor element when it overflows.
   *
   * Live examples:
   * - [Menubar](https://ariakit.com/components/menubar)
   * - [Submenu with
   *   Combobox](https://ariakit.com/examples/menu-nested-combobox)
   * @default false
   */
  overlap?: boolean;
  /**
   * Whether the popover should have the same width as the anchor element. This
   * will be exposed to CSS as
   * [`--popover-anchor-width`](https://ariakit.com/guide/styling#--popover-anchor-width).
   * @default false
   */
  sameWidth?: boolean;
  /**
   * Whether the popover should fit the viewport. If this is set to true, the
   * popover wrapper will have `maxWidth` and `maxHeight` set to the viewport
   * size. This will be exposed to CSS as
   * [`--popover-available-width`](https://ariakit.com/guide/styling#--popover-available-width)
   * and
   * [`--popover-available-height`](https://ariakit.com/guide/styling#--popover-available-height).
   *
   * Live examples:
   * - [Textarea with inline
   *   Combobox](https://ariakit.com/examples/combobox-textarea)
   * - [Menubar](https://ariakit.com/components/menubar)
   * @default false
   */
  fitViewport?: boolean;
  /**
   * The minimum padding, in pixels, between the arrow and the popover corner.
   * @default 4
   */
  arrowPadding?: number;
  /**
   * The minimum padding, in pixels, between the popover and the viewport edge.
   * Pass a number to use the same padding on every side, or an object to define
   * each side separately. This will be exposed to CSS as
   * [`--popover-overflow-padding`](https://ariakit.com/guide/styling#--popover-overflow-padding).
   * When passing an object, the CSS variable is the maximum of the horizontal
   * `left` and `right` values, with omitted sides treated as `0`.
   *
   * Live examples:
   * - [Sliding Menu](https://ariakit.com/examples/menu-slide)
   * @default 8
   */
  overflowPadding?: OverflowPadding;
  /**
   * Function that returns the anchor element's DOMRect. If this is explicitly
   * passed, it will override the anchor `getBoundingClientRect` method.
   *
   * Live examples:
   *  - [Textarea with inline combobox](https://ariakit.com/examples/combobox-textarea)
   *  - [Standalone Popover](https://ariakit.com/examples/popover-standalone)
   *  - [Context menu](https://ariakit.com/examples/menu-context-menu)
   *  - [Selection Popover](https://ariakit.com/examples/popover-selection)
   */
  getAnchorRect?: (anchor: HTMLElement | null) => AnchorRect | null;
  /**
   * A callback that will be called when the popover needs to calculate its
   * position. This will override the internal `updatePosition` function. The
   * original `updatePosition` function will be passed as an argument, so it can
   * be called inside the callback to apply the default behavior.
   *
   * Live examples:
   *  - [Responsive Popover](https://ariakit.com/examples/popover-responsive)
   */
  updatePosition?: (props: {
    updatePosition: () => Promise<void>;
  }) => void | Promise<void>;
}
type PopoverProps<T extends ElementType = TagName> = Props<T, PopoverOptions<T>>;
//#endregion
export { usePopover as i, PopoverOptions as n, PopoverProps as r, Popover as t };
//# sourceMappingURL=popover-ogM2HryK.d.ts.map