{"version":3,"file":"popover.types.mjs","names":[],"sources":["../../../../package/common/popover/popover.types.ts"],"sourcesContent":["import type { CSSProperties, ReactNode } from 'react';\nimport type { SlotClassNames, SlotStyles, HtmlProps } from '../types/slots.types';\nimport type { Presentation } from '../configProvider/presentation.types';\n\n/** Preferred side of the trigger the panel opens on. Flips to the opposite side when there's no room. */\nexport enum PopoverPlacement {\n  Top = 'top',\n  Bottom = 'bottom',\n  Left = 'left',\n  Right = 'right',\n}\n\n/** Alignment along the trigger's cross axis (horizontal for top/bottom, vertical for left/right). */\nexport enum PopoverAlign {\n  Start = 'start',\n  Center = 'center',\n  End = 'end',\n}\n\n/** What opens the popover. */\nexport enum PopoverTrigger {\n  Click = 'click',\n  Hover = 'hover',\n  Focus = 'focus',\n}\n\nexport type PopoverSlots = 'root' | 'trigger' | 'floating' | 'panel' | 'arrow' | 'backdrop';\n\nexport interface PopoverProps extends Omit<HtmlProps, 'content'> {\n  /** The trigger element. */\n  children?: ReactNode;\n  /**\n   * Place the panel against this element instead of `children`, for one Popover does not wrap.\n   * Open it with `isOpen`; `null` falls back to `children`.\n   */\n  anchor?: HTMLElement | null;\n  /** The popover body. */\n  content?: ReactNode;\n  /** Preferred side (default `Bottom`). */\n  placement?: PopoverPlacement;\n  /** Cross-axis alignment (default `Center`). */\n  align?: PopoverAlign;\n  /** What opens the popover (default `Click`). */\n  trigger?: PopoverTrigger;\n  /** Controlled open state. Omit for uncontrolled. */\n  isOpen?: boolean;\n  /** Initial open state when uncontrolled (default `false`). */\n  defaultOpen?: boolean;\n  /**\n   * Fires whenever the popover wants to open or close. `fromKeyboard` says\n   * whether a key caused it, which is what a menu needs in order to put the\n   * focus on an entry only when the pointer was not what opened it.\n   */\n  onOpenChange?: (isOpen: boolean, meta: { fromKeyboard: boolean }) => void;\n  /** Gap in px between trigger and panel (default `10`). */\n  offset?: number;\n  /** Render the arrow pointing at the trigger (default `true`). */\n  withArrow?: boolean;\n  /** Close on a click outside, or when focus leaves the trigger and panel (default `true`). */\n  closeOnOutsideClick?: boolean;\n  /** Close when pressing Escape (default `true`). */\n  closeOnEscape?: boolean;\n  /** Delay in ms before a hover-triggered popover opens (default `100`). */\n  openDelay?: number;\n  /** Delay in ms before a hover-triggered popover closes (default `120`). */\n  closeDelay?: number;\n  /** Prevent the popover from opening. */\n  disabled?: boolean;\n  /**\n   * Move focus into the panel when it opens, and claim `role=\"dialog\"` with it.\n   * `'keyboard'` (the default) does it only when the open came from the\n   * keyboard: the panel is portaled to the end of the document, so Tab never\n   * reaches it on its own, while a click leaves the focus where the pointer\n   * already put it. `true` always, `false` never.\n   */\n  focusOnOpen?: boolean | 'keyboard';\n  /**\n   * Whether clicking the trigger while the panel is open closes it (default\n   * `true`). A menu button should toggle; a text field that opens a picker\n   * should not, or clicking into it to place the caret would close the panel.\n   */\n  closeOnTriggerClick?: boolean;\n  /**\n   * `'trigger'` gives the panel at least the trigger's width, for a list that\n   * should line up with the field it belongs to. `'auto'` (the default) lets it\n   * size to its own content.\n   */\n  width?: 'auto' | 'trigger';\n  /**\n   * Cap the panel at a readable measure (default `true`). Off for a panel with\n   * its own width, a calendar or a media grid.\n   */\n  constrainWidth?: boolean;\n  /** Where the panel opens: anchored to the trigger (`Default`), pinned to the bottom of the\n   * screen, or the latter only on a small touch screen. Only a `Click` trigger presents as a\n   * sheet. */\n  presentation?: Presentation;\n\n  className?: string;\n  style?: CSSProperties;\n  classNames?: SlotClassNames<PopoverSlots>;\n  styles?: SlotStyles<PopoverSlots>;\n}\n"],"mappings":"aAKA,IAAY,EAAL,SAAA,EAAA,OACL,GAAA,IAAA,MACA,EAAA,OAAA,SACA,EAAA,KAAA,OACA,EAAA,MAAA,SACF,EAAA,CAAA,CAAA,EAGY,EAAL,SAAA,EAAA,OACL,GAAA,MAAA,QACA,EAAA,OAAA,SACA,EAAA,IAAA,OACF,EAAA,CAAA,CAAA,EAGY,EAAL,SAAA,EAAA,OACL,GAAA,MAAA,QACA,EAAA,MAAA,QACA,EAAA,MAAA,SACF,EAAA,CAAA,CAAA"}