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 workspace or account name shown next to the avatar. */ text?: string | undefined; /** * Specify the maximum width of `text` before it truncates with an ellipsis. * A number is treated as pixels; a string is used as a CSS length. * Set to `"none"` to let the trigger grow with the text. * @default "10rem" */ maxWidth?: number | string; /** * Specify the accessible label for the trigger button. * Only used when `text` is not set. * @default "Switch account" */ 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; /** Optional leading avatar. Renders nothing by default. */ avatar?: (this: void) => void; children?: (this: void) => void; [key: `data-${string}`]: unknown; }; export type HeaderSwitcherProps = Omit<$RestProps, keyof $Props> & $Props; export default class HeaderSwitcher extends SvelteComponentTyped< HeaderSwitcherProps, { click: WindowEventMap["click"]; close: CustomEvent<{ trigger: "outside-click" | "toggle" | "escape-key" | "select"; }>; open: CustomEvent<{ trigger: "toggle"; }>; }, { default: Record; /** Optional leading avatar. Renders nothing by default. */ avatar: Record; } > {}