import * as RadixPopover from "@radix-ui/react-popover"; import { type FC } from "react"; import { type Props as CardProps } from "../Card/Card"; type StaticComponents = { Trigger: typeof RadixPopover.Trigger; Root: typeof RadixPopover.Root; Anchor: typeof RadixPopover.Anchor; Close: typeof RadixPopover.Close; Arrow: typeof RadixPopover.Arrow; Content: FC; Card: FC; }; type ContentProps = { /** * An optional element to which to render the popover in through a portal. * * When omitted the popover will be rendered into the document.body. Inside * a `ModalDialog` (browser top layer) pass the dialog element here, otherwise * the popover renders underneath the dialog. */ container?: RadixPopover.PopoverPortalProps["container"]; } & RadixPopover.PopoverContentProps & /** * The content is a `dialog`, which must have an accessible name: describe * what the popover is for with `aria-label`, or point `aria-labelledby` at a * visible label, e.g. a heading in the popover or the label of the field * that opens it. */ ({ "aria-label": string; "aria-labelledby"?: never; } | { "aria-labelledby": string; "aria-label"?: never; }); /** * A collection of components to construct a popover: a panel with * **interactive content** that opens when the user clicks its trigger, and is * dismissed with `Escape`, by clicking outside of it, or with `Popover.Close`. * * ## When to use * * - **`Popover`**: content the user interacts with, e.g. a small form (radio * cards, inputs and a confirm button), a picker, or a settings panel. * - **`FlyOutMenu`**: a list of actions or options (`role="menu"`). Don't put * form controls in it. * - **`HoverCard`**: read-only preview content, shown when hovering. * - **`Tooltip`**: a short text label for an element. * * ## Why it exists * * Before `Popover` existed, panels with form content were built with * `FlyOutMenu`. That is built on Radix `DropdownMenu`, which: * * - prevents `Tab` inside its content, so keyboard users can't reach e.g. the * submit button; * - uses every printable key for typeahead search of menu items; * - announces the panel as a `menu` to screen readers, while it contains no * menu items. * * `HoverCard` is no alternative, since it only opens on hover. `Popover` keeps * native keyboard behavior and form semantics: focus moves into the content * when it opens, and returns to the trigger when it closes. * * @example * * ```tsx * * * * Edit priority * * * * *
…
*
*
*
* ``` */ export declare const Popover: StaticComponents; export {};