import { SvelteComponentTyped } from "svelte"; import type { SvelteHTMLElements } from "svelte/elements"; export type CarbonOverflowMenuContext = { focusedId: import("svelte/store").Writable; moveFocus: import("svelte/store").Writable; items: import("svelte/store").Writable>; itemsById: import("svelte/store").Readable>; add: (item: { id: string; text: string; primaryFocus: boolean; disabled: boolean; shortcut: string; node: HTMLElement }) => void; remove: (id: string) => void; patch: (id: string, data: { text: string; disabled: boolean }) => void; update: (id: string, item: { id: string; text: string; primaryFocus: boolean; disabled: boolean; node: HTMLElement }) => void; first: () => void; last: () => void; }; type $RestProps = SvelteHTMLElements["button"]; type $Props = { /** * Specify the size of the overflow menu. * Also accepts Carbon v11's `"md"` (the 40px default) and `"lg"` (`"xl"`). */ size?: "xs" | "sm" | "md" | "lg" | "xl" | undefined; /** * Specify the direction of the overflow menu relative to the button. * @default "bottom" */ direction?: "top" | "bottom"; /** * Set to `true` to open the menu. * @default false */ open?: boolean; /** * Set to `true` to disable the trigger button * @default false */ disabled?: boolean; /** * Set to `true` to align the menu with the button's inline end instead of * its start. Under `dir="rtl"` the default menu aligns with the button's * right edge, and a flipped one with its left. * @default false */ flipped?: boolean; /** * Specify the maximum height of the menu. * A number is treated as pixels; a string is used as a CSS length. * The menu scrolls once its items exceed the height. */ maxHeight?: number | string | undefined; /** * Specify the menu options class. */ menuOptionsClass?: string | undefined; /** * Specify the icon to render. * @default OverflowMenuVertical */ icon?: Icon; /** * Specify the icon class. */ iconClass?: string | undefined; /** * Specify the trigger's accessible name and tooltip text. * An `aria-label` on the component overrides the name, not the tooltip. * A custom trigger in the `menu` slot is named by its content and has no * tooltip. * @default "Options" */ iconDescription?: string; /** * Set the tooltip placement in floating-ui form: the side, then `start` * or `end` along it, as Popover's `align` takes. Above and below, * `start` and `end` name inline sides, so they swap under `dir="rtl"`. * When set, takes precedence over `tooltipPosition` and `tooltipAlignment`. */ tooltipAlign?: "top" | "top-start" | "top-end" | "bottom" | "bottom-start" | "bottom-end" | "left" | "left-start" | "left-end" | "right" | "right-start" | "right-end" | undefined; /** * Set the position of the trigger's tooltip. * The tooltip flips to the opposite side when there is not enough space. * @deprecated use `tooltipAlign` * @default "top" */ tooltipPosition?: "top" | "right" | "bottom" | "left"; /** * Set the alignment of the trigger's tooltip. * @deprecated use `tooltipAlign` * @default "center" */ tooltipAlignment?: "start" | "center" | "end"; /** * Set an id for the button element * @default uniqueId() */ id?: string; /** * Obtain a reference to the trigger button element. * @default null */ buttonRef?: null | HTMLButtonElement; /** * Obtain a reference to the overflow menu element. * @default null */ menuRef?: null | HTMLUListElement; /** * Set to `true` to always render the menu in a portal, or `false` to * keep it in place. Left unset, the menu moves to a portal inside a * Modal, or when a box around it (`overflow` other than `visible`) * would cut it off. */ portalMenu?: boolean | undefined; menu?: (this: void) => void; children?: (this: void) => void; [key: `data-${string}`]: unknown; }; export type OverflowMenuProps = Omit<$RestProps, keyof $Props> & $Props; export default class OverflowMenu extends SvelteComponentTyped< OverflowMenuProps, { click: WindowEventMap["click"]; close: CustomEvent<{ trigger: "escape-key" | "outside-click" | "toggle" | "item-select"; /** only present when an item is selected */ index?: number; /** only present when an item is selected */ text?: string; }>; keydown: WindowEventMap["keydown"]; mouseenter: WindowEventMap["mouseenter"]; mouseleave: WindowEventMap["mouseleave"]; mouseover: WindowEventMap["mouseover"]; }, { default: Record; menu: Record; } > {}