import { SvelteComponentTyped } from "svelte"; import type { SvelteHTMLElements } from "svelte/elements"; export type CarbonProfileMenuContext = { menuItems: import("svelte/store").Writable>; registerMenuItem: (node: HTMLElement) => void; unregisterMenuItem: (node: HTMLElement) => void; select: () => void; }; type $RestProps = SvelteHTMLElements["button"]; type $Props = { /** * Set to `true` to open the menu. * @default false */ isOpen?: boolean; /** * Specify the accessible label for the trigger button. * @default "Profile" */ iconDescription?: string; /** * Obtain a reference to the trigger button HTML element. * @default null */ ref?: null | HTMLButtonElement; /** * Customize the menu slide transition (for example, `{ duration: 200 }`). * By default, the menu does not animate. * @default false */ transition?: false | import("svelte/transition").SlideParams; /** * Set to `true` to prevent the menu from closing when clicking outside * @default false */ preventCloseOnClickOutside?: boolean; /** * Set an id for the trigger button. The menu id derives from it as * `{id}-menu`, so the server and the browser render the same id. */ id?: string | undefined; /** Trigger avatar. Falls back to a placeholder. */ avatar?: (this: void) => void; children?: (this: void) => void; [key: `data-${string}`]: unknown; }; export type ProfileMenuProps = Omit<$RestProps, keyof $Props> & $Props; export default class ProfileMenu extends SvelteComponentTyped< ProfileMenuProps, { click: WindowEventMap["click"]; close: CustomEvent<{ trigger: "outside-click" | "toggle" | "escape-key" | "select"; }>; open: CustomEvent<{ trigger: "toggle"; }>; }, { default: Record; /** Trigger avatar. Falls back to a placeholder. */ avatar: Record; } > {}