/** * Copyright 2025, SumUp Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ import { type Placement } from '@floating-ui/react-dom'; import { type ComponentType, type KeyboardEvent } from 'react'; import { type DialogProps, type PublicDialogProps } from '../Dialog/Dialog.js'; import type { ClickEvent } from '../../types/events.js'; export interface PopoverReferenceProps { 'onClick': (event: ClickEvent) => void; 'onKeyDown'?: (event: KeyboardEvent) => void; 'id': string; 'aria-controls': string; 'aria-expanded': boolean; } type OnToggle = (open: boolean | ((prevOpen: boolean) => boolean)) => void; export interface PopoverProps extends Omit, Pick { /** * The state of the Popover. */ isOpen?: boolean; /** * Function that is called when opening and closing the Popover. */ onToggle: OnToggle; /** * One of the accepted placement values. * @default `bottom`. */ placement?: Placement; /** * The placements to fallback to when there is not enough space for the * Popover. * @default `['top', 'right', 'left']`. */ fallbackPlacements?: Placement[]; /** * Displaces the floating element from its `placement` along specified axes. * * Pass a number to move the floating element on the main axis, away from (if * positive) or towards (if negative) the reference element. Pass an object * to displace the floating element on both the main and cross axes. */ offset?: number | { mainAxis?: number; crossAxis?: number; }; /** * The component that toggles the Popover when clicked. Also referred to as * reference element. */ component: ComponentType; /** * An optional class name to be applied to the component's content. */ contentClassName?: string; /** * If set to true, the Popover will not render as a modal on mobile */ disableModalOnMobile?: boolean; } export declare const Popover: import("react").ForwardRefExoticComponent>; export {};