import { n as FocusableOptions } from "./focusable-u2sImvln.js";
import { t as DialogStore } from "./dialog-store-DmFJrY2V.js";
import { n as DisclosureContentOptions } from "./disclosure-content-C02hnFtD.js";
import { n as PortalOptions } from "./portal-CEvdC2NU.js";
import { Props } from "@ariakit/react-utils";
import { ComponentPropsWithRef, ElementType, FC, KeyboardEvent as KeyboardEvent$1, ReactElement, RefObject, SyntheticEvent } from "react";
import { BooleanOrCallback } from "@ariakit/utils";
//#region src/dialog/dialog.d.ts
declare const TagName = "div";
type TagName = typeof TagName;
/**
 * Returns props to create a `Dialog` component.
 * @see https://ariakit.com/components/dialog
 * @example
 * ```jsx
 * const store = useDialogStore();
 * const props = useDialog({ store });
 * <Role {...props}>Dialog</Role>
 * ```
 */
declare const useDialog: import("@ariakit/react-utils").Hook<"div", DialogOptions<"div">>;
declare function createDialogComponent<T extends DialogOptions>(Component: FC<T>, useProviderContext?: () => DialogStore | undefined): (props: T) => import("react").JSX.Element | null;
/**
 * Renders a dialog similar to the native `dialog` element that's rendered in a
 * [`portal`](https://ariakit.com/reference/dialog#portal) by default.
 *
 * The dialog can be either
 * [`modal`](https://ariakit.com/reference/dialog#modal) or non-modal. The
 * visibility state can be controlled with the
 * [`open`](https://ariakit.com/reference/dialog#open) and
 * [`onClose`](https://ariakit.com/reference/dialog#onclose) props.
 * @see https://ariakit.com/components/dialog
 * @example
 * ```jsx {4-6}
 * const [open, setOpen] = useState(false);
 *
 * <button onClick={() => setOpen(true)}>Open dialog</button>
 * <Dialog open={open} onClose={() => setOpen(false)}>
 *   Dialog
 * </Dialog>
 * ```
 */
declare const Dialog: (props: DialogProps) => import("react").JSX.Element;
interface DialogOptions<T extends ElementType = TagName> extends FocusableOptions<T>, PortalOptions<T>, DisclosureContentOptions<T> {
  /**
   * Object returned by the
   * [`useDialogStore`](https://ariakit.com/reference/use-dialog-store) hook. If
   * not provided, the closest
   * [`DialogProvider`](https://ariakit.com/reference/dialog-provider)
   * component's context will be used. Otherwise, an internal store will be
   * created.
   */
  store?: DialogStore;
  /**
   * Controls the open state of the dialog. This is similar to the
   * [`open`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLDialogElement/open)
   * attribute on native dialog elements.
   *
   * Live examples:
   * - [Dialog with scrollable
   *   backdrop](https://ariakit.com/examples/dialog-backdrop-scrollable)
   * - [Dialog with details &
   *   summary](https://ariakit.com/examples/dialog-details)
   * - [Warning on Dialog
   *   hide](https://ariakit.com/examples/dialog-hide-warning)
   * - [Dialog with Menu](https://ariakit.com/examples/dialog-menu)
   */
  open?: boolean;
  /**
   * This is an event handler prop triggered when the dialog's `close` event is
   * dispatched. The `close` event is similar to the native dialog
   * [`close`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLDialogElement/close_event)
   * event. The only difference is that this event can be canceled with
   * `event.preventDefault()`, which will prevent the dialog from hiding.
   *
   * It's important to note that this event only fires when the dialog store's
   * [`open`](https://ariakit.com/reference/use-dialog-store#open) state is set
   * to `false`. If the controlled
   * [`open`](https://ariakit.com/reference/dialog#open) prop value changes, or
   * if the dialog's visibility is altered in any other way (such as unmounting
   * the dialog without adjusting the open state), this event won't be
   * triggered.
   *
   * Live examples:
   * - [Dialog with scrollable
   *   backdrop](https://ariakit.com/examples/dialog-backdrop-scrollable)
   * - [Dialog with details &
   *   summary](https://ariakit.com/examples/dialog-details)
   * - [Warning on Dialog
   *   hide](https://ariakit.com/examples/dialog-hide-warning)
   * - [Dialog with Menu](https://ariakit.com/examples/dialog-menu)
   */
  onClose?: (event: Event) => void;
  /**
   * Determines whether the dialog is modal. Modal dialogs have distinct states
   * and behaviors:
   * - The [`portal`](https://ariakit.com/reference/dialog#portal) and
   *   [`preventBodyScroll`](https://ariakit.com/reference/dialog#preventbodyscroll)
   *   props are set to `true`. They can still be manually set to `false`.
   * - When using the [`Heading`](https://ariakit.com/reference/heading) or
   *   [`DialogHeading`](https://ariakit.com/reference/dialog-heading)
   *   components within the dialog, their level will be reset so they start
   *   with `h1`.
   * - A visually hidden dismiss button will be rendered if the
   *   [`DialogDismiss`](https://ariakit.com/reference/dialog-dismiss) component
   *   hasn't been used. This allows screen reader users to close the dialog.
   * - When the dialog is open, element tree outside it will be inert.
   *
   * Live examples:
   * - [Combobox with Tabs](https://ariakit.com/examples/combobox-tabs)
   * - [Dialog with details &
   *   summary](https://ariakit.com/examples/dialog-details)
   * - [Form with Select](https://ariakit.com/examples/form-select)
   * - [Context menu](https://ariakit.com/examples/menu-context-menu)
   * - [Responsive Popover](https://ariakit.com/examples/popover-responsive)
   * @default true
   */
  modal?: boolean;
  /**
   * Determines whether there will be a backdrop behind the dialog. On modal
   * dialogs, this is `true` by default. Besides a `boolean`, this prop can also
   * be a React component or JSX element that will be rendered as the backdrop.
   *
   * **Note**: If a custom component is used, it must [accept ref and spread all
   * props to its underlying DOM
   * element](https://ariakit.com/guide/composition#custom-components-must-be-open-for-extension),
   * the same way a native element would.
   *
   * Live examples:
   * - [Animated Dialog](https://ariakit.com/examples/dialog-animated)
   * - [Dialog with scrollable
   *   backdrop](https://ariakit.com/examples/dialog-backdrop-scrollable)
   * - [Dialog with
   *   Motion](https://ariakit.com/examples/dialog-framer-motion)
   * - [Dialog with Menu](https://ariakit.com/examples/dialog-menu)
   * - [Nested Dialog](https://ariakit.com/examples/dialog-nested)
   * - [Dialog with Next.js App
   *   Router](https://ariakit.com/examples/dialog-next-router)
   * @example
   * ```jsx
   * <Dialog backdrop={<div className="backdrop" />} />
   * ```
   */
  backdrop?: boolean | ReactElement<ComponentPropsWithRef<"div">> | ElementType<ComponentPropsWithRef<"div">>;
  /**
   * Determines if the dialog will hide when the user presses the Escape key.
   *
   * This prop can be either a boolean or a function that accepts an event as an
   * argument and returns a boolean. The event object represents the keydown
   * event that initiated the hide action, which could be either a native
   * keyboard event or a React synthetic event.
   *
   * **Note**: The dialog stops handled Escape events from its React subtree
   * before they reach ancestor React bubble handlers. An ancestor capture
   * handler can own the event by stopping its propagation. If this function
   * runs before such a handler, it can call `event.stopPropagation()` to
   * prevent the handler from receiving the event.
   * @default true
   */
  hideOnEscape?: BooleanOrCallback<KeyboardEvent | KeyboardEvent$1>;
  /**
   * Determines if the dialog should hide when the user clicks or focuses on an
   * element outside the dialog.
   *
   * This prop can be either a boolean or a function that takes an event as an
   * argument and returns a boolean. The event object represents the event that
   * triggered the action, which could be a native event or a React synthetic
   * event of various types.
   *
   * Live examples:
   * - [Selection Popover](https://ariakit.com/examples/popover-selection)
   * @default true
   */
  hideOnInteractOutside?: BooleanOrCallback<Event | SyntheticEvent>;
  /**
   * When a dialog is open, the elements outside of it are disabled to prevent
   * interaction if the dialog is
   * [`modal`](https://ariakit.com/reference/dialog#modal). For non-modal
   * dialogs, interacting with elements outside the dialog prompts it to close.
   *
   * This function allows you to return an iterable collection of elements that
   * will be considered as part of the dialog, thus excluding them from this
   * behavior.
   *
   * **Note**: The elements returned by this function must exist in the DOM when
   * the dialog opens.
   *
   * Live examples:
   * - [Dialog with
   *   React-Toastify](https://ariakit.com/examples/dialog-react-toastify)
   */
  getPersistentElements?: () => Iterable<Element>;
  /**
   * Determines whether the body scrolling will be prevented when the dialog is
   * shown. This is automatically set to `true` when the dialog is
   * [`modal`](https://ariakit.com/reference/dialog#modal). You can disable this
   * prop if you want to implement your own logic.
   */
  preventBodyScroll?: boolean;
  /**
   * Determines whether an element inside the dialog will receive focus when the
   * dialog is shown. By default, this is usually the first tabbable element in
   * the dialog or the dialog itself. The
   * [`initialFocus`](https://ariakit.com/reference/dialog#initialfocus) prop
   * can be used to set a different element to receive focus.
   *
   * Live examples:
   * - [Warning on Dialog
   *   hide](https://ariakit.com/examples/dialog-hide-warning)
   * - [Sliding Menu](https://ariakit.com/examples/menu-slide)
   * - [Selection Popover](https://ariakit.com/examples/popover-selection)
   * @default true
   */
  autoFocusOnShow?: BooleanOrCallback<HTMLElement | null>;
  /**
   * Determines whether an element outside of the dialog will be focused when
   * the dialog is hidden if another element hasn't been focused in the action
   * of hiding the dialog (for example, by clicking or tabbing into another
   * tabbable element outside of the dialog).
   *
   * By default, this is usually the disclosure element. The
   * [`finalFocus`](https://ariakit.com/reference/dialog#finalfocus) prop can be
   * used to define a different element to be focused.
   *
   * Live examples:
   * - [Dialog with Next.js App
   *   Router](https://ariakit.com/examples/dialog-next-router)
   * - [Sliding menu](https://ariakit.com/examples/menu-slide)
   * @default true
   */
  autoFocusOnHide?: BooleanOrCallback<HTMLElement | null>;
  /**
   * Specifies the element that will receive focus when the dialog is first
   * opened. It can be an `HTMLElement` or a `React.RefObject` with an
   * `HTMLElement`.
   *
   * If
   * [`autoFocusOnShow`](https://ariakit.com/reference/dialog#autofocusonshow)
   * is set to `false`, this prop will have no effect. If left unset, the dialog
   * will attempt to determine the initial focus element in the following order:
   * 1. A [Focusable](https://ariakit.com/components/focusable) element with an
   *    [`autoFocus`](https://ariakit.com/reference/focusable#autofocus) prop.
   * 2. The first tabbable element inside the dialog.
   * 3. The first focusable element inside the dialog.
   * 4. The dialog element itself.
   */
  initialFocus?: HTMLElement | RefObject<HTMLElement | null> | null;
  /**
   * Determines the element that will receive focus once the dialog is closed,
   * provided that no other element has been focused while the dialog was being
   * hidden (e.g., by clicking or tabbing into another tabbable element outside
   * of the dialog).
   * - If
   *   [`autoFocusOnHide`](https://ariakit.com/reference/dialog#autofocusonhide)
   *   is set to `false`, this prop will have no effect.
   * - If left unset, the element that was focused before the dialog was opened
   *   will be focused again.
   */
  finalFocus?: HTMLElement | RefObject<HTMLElement | null> | null;
  /**
   * @private
   */
  unstable_treeSnapshotKey?: string | number | boolean | null;
}
type DialogProps<T extends ElementType = TagName> = Props<T, DialogOptions<T>>;
//#endregion
export { useDialog as a, createDialogComponent as i, DialogOptions as n, DialogProps as r, Dialog as t };
//# sourceMappingURL=dialog-C5LdRvvE.d.ts.map