import { SvelteComponentTyped } from "svelte"; import type { SvelteHTMLElements } from "svelte/elements"; export type CarbonContentSwitcherContext = { currentId: import("svelte/store").Writable; add: (data: { id: string; text: string; selected: boolean; icon: boolean; disabled: boolean }) => void; remove: (id: string) => void; update: (id: string) => void; setDisabled: (id: string, disabled: boolean) => void; setIcon: (id: string, icon: boolean) => void; tabStopId: import("svelte/store").Readable; /** Switch-panel pairing by position, in both directions. */ pairs: import("svelte/store").Readable<{ panelBySwitch: Record; switchByPanel: Record }>; addPanel: (id: string) => void; claimPanel: (id: string) => string | undefined; removePanel: (id: string) => void; }; type $RestProps = SvelteHTMLElements["div"]; type $Props = { /** * Set the selected index of the switch item. * Ignored when `selectedId` is set. * An out-of-range value selects the nearest switch. * @default 0 */ selectedIndex?: number; /** * Specify the selected switch by id. * When set, takes precedence over `selectedIndex` and stays on the same * logical switch as switches are added or removed. Pair with a stable `id` * on each `Switch`. */ selectedId?: string | undefined; /** * Specify the size of the content switcher. * Also accepts Carbon v11's `"md"` (the 40px default) and `"lg"` (`"xl"`). */ size?: "sm" | "md" | "lg" | "xl" | undefined; /** * Choose whether or not to automatically change selection * on focus when using arrow keys. Defaults to "automatic". * @default "automatic" */ selectionMode?: "automatic" | "manual"; /** * Set to `true` to use the low contrast variant * @default false */ lowContrast?: boolean; /** * Set to `true` to size each switch to its label instead of splitting the * width evenly. The switcher shrinks to fit its switches. * @default false */ autoWidth?: boolean; /** * Set to `true` when every switch sets `icon`, so the switcher fits its * switches from the first render, server-rendered markup included. The * switcher infers icon-only once its switches register, and that wins. * @default false */ iconOnly?: boolean; /** * Obtain a reference to the tablist HTML element. * @default null */ ref?: null | HTMLDivElement; content?: (this: void) => void; children?: (this: void) => void; [key: `data-${string}`]: unknown; }; export type ContentSwitcherProps = Omit<$RestProps, keyof $Props> & $Props; export default class ContentSwitcher extends SvelteComponentTyped< ContentSwitcherProps, { blur: WindowEventMap["blur"]; change: CustomEvent; click: WindowEventMap["click"]; focus: WindowEventMap["focus"]; mouseenter: WindowEventMap["mouseenter"]; mouseleave: WindowEventMap["mouseleave"]; mouseover: WindowEventMap["mouseover"]; }, { default: Record; content: Record; } > {}