import { SvelteComponentTyped } from "svelte"; import type { SvelteHTMLElements } from "svelte/elements"; export type CarbonHeaderActionContext = { select: () => void; }; type $RestProps = SvelteHTMLElements["button"]; type $Props = { /** * Set to `true` to open the panel. * @default false */ isOpen?: boolean; /** * Specify the icon to render when the action panel is closed. * @default Switcher */ icon?: Icon; /** * Specify the icon to render when the action panel is open. * @default Close */ closeIcon?: Icon; /** * Specify the text displayed next to the icon. * Alternatively, use the named slot "textChildren". * @example * ```svelte * *
Custom Text
*
* ``` */ text?: string | undefined; /** * Specify an icon tooltip. The tooltip will not be displayed * if either the `text` prop or a named slot="textChildren" is used. */ iconDescription?: string | undefined; /** * Set the alignment of the tooltip relative to the icon. * Only applies when `iconDescription` is provided. * @default "center" */ tooltipAlignment?: "start" | "center" | "end"; /** * Obtain a reference to the button HTML element. * @default null */ ref?: null | HTMLButtonElement; /** * Customize the panel transition (e.g., `transition:slide`). * The panel does not animate by default; provide slide * params (e.g., `{ duration: 200 }`) to enable the transition. * @default false */ transition?: false | import("svelte/transition").SlideParams; /** * Set to `true` to prevent the panel from closing when clicking outside * @default false */ preventCloseOnClickOutside?: boolean; /** * Set an id for the trigger button element. Also used to label the panel. * @default uniqueId() */ id?: string; textChildren?: (this: void) => void; children?: (this: void) => void; [key: `data-${string}`]: unknown; }; export type HeaderActionProps = Omit<$RestProps, keyof $Props> & $Props; export default class HeaderAction extends SvelteComponentTyped< HeaderActionProps, { click: WindowEventMap["click"]; close: CustomEvent<{ trigger: "outside-click" | "toggle" | "escape-key" | "select"; }>; open: CustomEvent<{ trigger: "toggle"; }>; }, { default: Record; closeIcon: Record; icon: Record; textChildren: Record; } > {}