{
  "tag": "ed-popup",
  "kind": "component",
  "summary": "Positions a floating box next to an anchor element and keeps it in view; the base other floating components\nsuch as dropdown, select and tooltip are built on.",
  "status": "experimental",
  "level": "molecule",
  "since": "1.0",
  "docs": "https://test-apps.eurodata.de/a/eurodata-ui/docs/components/popup/",
  "usage": "https://test-apps.eurodata.de/a/eurodata-ui/docs/components/popup/usage/",
  "playwright": "getByTestId('…')",
  "dependencies": [],
  "use": [
    "Building a custom floating panel, such as a suggestion list, anchored to a field and kept inside the visible window",
    "A floating box with an arrow pointing at the element it belongs to, flipping to the other side near the screen edge"
  ],
  "notFor": [
    {
      "when": "A ready-made panel opened by a click",
      "instead": "a [Popover](https://test-apps.eurodata.de/a/eurodata-ui/docs/components/popover)"
    },
    {
      "when": "A short hint on hover or focus",
      "instead": "a [Tooltip](https://test-apps.eurodata.de/a/eurodata-ui/docs/components/tooltip)"
    },
    {
      "when": "A menu of commands",
      "instead": "a [Dropdown](https://test-apps.eurodata.de/a/eurodata-ui/docs/components/dropdown)"
    }
  ],
  "rules": [],
  "api": {
    "attributes": [
      {
        "name": "anchor",
        "property": "anchor",
        "type": "string | Element | { getBoundingClientRect: { }, contextElement?: Element }",
        "description": "The element the popup will be anchored to. If the anchor lives outside of the popup, you can provide the anchor\nelement `id`, a DOM element reference, or a `VirtualElement`. If the anchor lives inside the popup, use the\n`anchor` slot instead."
      },
      {
        "name": "active",
        "property": "active",
        "type": "boolean",
        "default": "false",
        "description": "Activates the positioning logic and shows the popup. When this attribute is removed, the positioning logic is torn\ndown and the popup will be hidden."
      },
      {
        "name": "placement",
        "property": "placement",
        "type": "'left' | 'right' | 'top-start' | 'top-end' | 'bottom-start' | 'bottom-end' | 'top' | 'bottom' | 'right-start' | 'right-end' | 'left-start' | 'left-end'",
        "default": "'top'",
        "description": "The preferred placement of the popup. Note that the actual placement will vary as configured to keep the\npanel inside of the viewport."
      },
      {
        "name": "boundary",
        "property": "boundary",
        "type": "'viewport' | 'scroll'",
        "default": "'viewport'",
        "description": "The bounding box to use for flipping, shifting, and auto-sizing."
      },
      {
        "name": "distance",
        "property": "distance",
        "type": "number",
        "default": "0",
        "description": "The distance in pixels from which to offset the panel away from its anchor."
      },
      {
        "name": "skidding",
        "property": "skidding",
        "type": "number",
        "default": "0",
        "description": "The distance in pixels from which to offset the panel along its anchor."
      },
      {
        "name": "arrow",
        "property": "arrow",
        "type": "boolean",
        "default": "false",
        "description": "Attaches an arrow to the popup. The arrow's size and color can be customized using the `--ed-popup-arrow-size` and\n`--ed-popup-arrow-color` custom properties. For additional customizations, you can also target the arrow using\n`::part(arrow)` in your stylesheet."
      },
      {
        "name": "arrow-placement",
        "property": "arrowPlacement",
        "type": "'anchor' | 'start' | 'end' | 'center'",
        "default": "'anchor'",
        "description": "The placement of the arrow. The default is `anchor`, which will align the arrow as close to the center of the\nanchor as possible, considering available space and `arrow-padding`. A value of `start`, `end`, or `center` will\nalign the arrow to the start, end, or center of the popover instead."
      },
      {
        "name": "arrow-padding",
        "property": "arrowPadding",
        "type": "number",
        "default": "10",
        "description": "The amount of padding between the arrow and the edges of the popup. If the popup has a border-radius, for example,\nthis will prevent it from overflowing the corners."
      },
      {
        "name": "flip",
        "property": "flip",
        "type": "boolean",
        "default": "false",
        "description": "When set, placement of the popup will flip to the opposite site to keep it in view. You can use\n`flipFallbackPlacements` to further configure how the fallback placement is determined."
      },
      {
        "name": "flip-fallback-placements",
        "property": "flipFallbackPlacements",
        "type": "string",
        "default": "''",
        "description": "If the preferred placement doesn't fit, popup will be tested in these fallback placements until one fits. Must be a\nstring of any number of placements separated by a space, e.g. \"top bottom left\". If no placement fits, the flip\nfallback strategy will be used instead."
      },
      {
        "name": "flip-fallback-strategy",
        "property": "flipFallbackStrategy",
        "type": "'best-fit' | 'initial'",
        "default": "'best-fit'",
        "description": "When neither the preferred placement nor the fallback placements fit, this value will be used to determine whether\nthe popup should be positioned using the best available fit based on available space or as it was initially\npreferred."
      },
      {
        "name": "flipBoundary",
        "property": "flipBoundary",
        "type": "Element | Element[]",
        "description": "The flip boundary describes clipping element(s) that overflow will be checked relative to when flipping. By\ndefault, the boundary includes overflow ancestors that will cause the element to be clipped. If needed, you can\nchange the boundary by passing a reference to one or more elements to this property."
      },
      {
        "name": "flip-padding",
        "property": "flipPadding",
        "type": "number",
        "default": "0",
        "description": "The amount of padding, in pixels, to exceed before the flip behavior will occur."
      },
      {
        "name": "shift",
        "property": "shift",
        "type": "boolean",
        "default": "false",
        "description": "Moves the popup along the axis to keep it in view when clipped."
      },
      {
        "name": "shiftBoundary",
        "property": "shiftBoundary",
        "type": "Element | Element[]",
        "description": "The shift boundary describes clipping element(s) that overflow will be checked relative to when shifting. By\ndefault, the boundary includes overflow ancestors that will cause the element to be clipped. If needed, you can\nchange the boundary by passing a reference to one or more elements to this property."
      },
      {
        "name": "shift-padding",
        "property": "shiftPadding",
        "type": "number",
        "default": "0",
        "description": "The amount of padding, in pixels, to exceed before the shift behavior will occur."
      },
      {
        "name": "auto-size",
        "property": "autoSize",
        "type": "'both' | 'horizontal' | 'vertical'",
        "description": "When set, this will cause the popup to automatically resize itself to prevent it from overflowing."
      },
      {
        "name": "sync",
        "property": "sync",
        "type": "'width' | 'height' | 'both'",
        "description": "Syncs the popup's width or height to that of the anchor element."
      },
      {
        "name": "autoSizeBoundary",
        "property": "autoSizeBoundary",
        "type": "Element | Element[]",
        "description": "The auto-size boundary describes clipping element(s) that overflow will be checked relative to when resizing. By\ndefault, the boundary includes overflow ancestors that will cause the element to be clipped. If needed, you can\nchange the boundary by passing a reference to one or more elements to this property."
      },
      {
        "name": "auto-size-padding",
        "property": "autoSizePadding",
        "type": "number",
        "default": "0",
        "description": "The amount of padding, in pixels, to exceed before the auto-size behavior will occur."
      },
      {
        "name": "hover-bridge",
        "property": "hoverBridge",
        "type": "boolean",
        "default": "false",
        "description": "When a gap exists between the anchor and the popup element, this option will add a \"hover bridge\" that fills the\ngap using an invisible element. This makes listening for events such as `mouseenter` and `mouseleave` more sane\nbecause the pointer never technically leaves the element. The hover bridge will only be drawn when the popover is\nactive."
      },
      {
        "name": "dir",
        "property": "dir",
        "type": "string"
      },
      {
        "name": "lang",
        "property": "lang",
        "type": "string"
      }
    ],
    "properties": [
      {
        "name": "popup",
        "type": "HTMLElement",
        "description": "A reference to the internal popup container. Useful for animating and styling the popup with JavaScript."
      }
    ],
    "methods": [
      {
        "name": "reposition",
        "description": "Forces the popup to recalculate and reposition itself."
      },
      {
        "name": "getPropertyDescriptor",
        "static": true,
        "parameters": [
          {
            "name": "name",
            "type": "PropertyKey"
          },
          {
            "name": "key",
            "type": "string | symbol"
          },
          {
            "name": "options",
            "type": "PropertyDeclaration"
          }
        ],
        "returns": "PropertyDescriptor | undefined",
        "description": "Wraps the accessor of reflected properties so they always hold a valid value, as a native\nreflected IDL attribute does (`button.type = undefined` reads `submit`):\n\n- A property that declares `useDefault` takes the first value set on an element for its\n  default. That value is its field initializer's: the constructor has finished before markup,\n  a framework or any other code can set anything. Every later `null` or `undefined` means what\n  a dropped prop means on a native element — the attribute is removed: with the attribute\n  there, it is removed and Lit's `useDefault` restores the default without writing it; without\n  one, the property is set to the default. A value set and cleared again before the element\n  updates still writes the default once, from the pending reflection.\n- A Boolean is coerced with `Boolean()`, so `undefined` is `false`.\n\nLit's `useDefault` keeps the initial default out of the DOM. Setting the default explicitly\nwrites it, as `button.type = 'submit'` writes `type`."
      }
    ],
    "events": [
      {
        "name": "ed-reposition",
        "react": "onEdReposition",
        "description": "Emitted when the popup is repositioned. This event can fire a lot, so avoid putting expensive operations in your listener or consider debouncing it."
      }
    ],
    "slots": [
      {
        "name": "",
        "description": "The popup's content."
      },
      {
        "name": "anchor",
        "description": "The element the popup will be anchored to. If the anchor lives outside the popup, you can use the `anchor` attribute or property instead."
      }
    ],
    "cssProperties": [
      {
        "name": "--ed-popup-arrow-size",
        "default": "6px",
        "description": "The size of the arrow. Note that an arrow won't be shown unless the `arrow` attribute is used."
      },
      {
        "name": "--ed-popup-border-width",
        "description": "The width of any custom border applied to the popup. This is used to reposition the arrow to overlap to the inside edge of the popup border."
      },
      {
        "name": "--ed-popup-arrow-color",
        "default": "black",
        "description": "The color of the arrow."
      },
      {
        "name": "--ed-popup-auto-size-available-width",
        "description": "A read-only custom property that determines the amount of width the popup can be before overflowing. Useful for positioning child elements that need to overflow. This property is only available when using `auto-size`."
      },
      {
        "name": "--ed-popup-auto-size-available-height",
        "description": "A read-only custom property that determines the amount of height the popup can be before overflowing. Useful for positioning child elements that need to overflow. This property is only available when using `auto-size`."
      },
      {
        "name": "--ed-show-duration",
        "default": "var(--ed-transition-fast)",
        "description": "The show duration to use when applying built-in animation classes."
      },
      {
        "name": "--ed-hide-duration",
        "default": "var(--ed-transition-fast)",
        "description": "The hide duration to use when applying built-in animation classes."
      }
    ],
    "parts": [
      {
        "name": "arrow",
        "description": "The arrow's container. Avoid setting `top|bottom|left|right` properties, as these values are assigned dynamically as the popup moves. This is most useful for applying a background color to match the popup, and maybe a border or box shadow."
      },
      {
        "name": "popup",
        "description": "The popup's container. Useful for setting a background color, box shadow, etc."
      },
      {
        "name": "hover-bridge",
        "description": "The hover bridge element. Only available when the `hover-bridge` option is enabled."
      }
    ],
    "states": []
  },
  "import": "import '@eurodata/eurodata-ui/dist/components/popup/popup.js';",
  "react": {
    "component": "EdPopup",
    "import": "import EdPopup from '@eurodata/eurodata-ui/dist/react/popup/index.js';"
  }
}
