import { UiElement } from '../shared/element.js'; import '../tooltip/tooltip.js'; export * from './content-switcher-item.js'; export type ContentSwitcherSize = 'sm' | 'md' | 'lg'; export type ContentSwitcherSelectionMode = 'automatic' | 'manual'; /** * Carbon `ContentSwitcher`: a `tablist` of ``s where exactly one is * selected. Click, or Left/Right (wrapping, skipping disabled items) select immediately; * `selection-mode="manual"` moves focus only and Enter / Space selects. Home / End jump * to the first / last item (APG). Sizes sm 32 / md 40 / lg 48px, full width with items shared * evenly; `icon-only` (every item is `icon-only`) shrinks to fit. `low-contrast` renders the * grey variant. Set `aria-label` on the host to name the group. * * Deviation from Carbon React: arrow keys skip disabled items (Carbon's `getNextIndex` would * try to focus a disabled button, which does nothing). * * @slot - `` elements * @fires ui-change - detail: { index, name } after the user selects a different item * @cssprop --ui-content-switcher-border / --ui-content-switcher-selected-fill / --ui-content-switcher-selected-ink - Border, selected fill and selected text of the default kind (default: Carbon's inverse; Kanok: no border, a segment in the page colour with ink text) * @cssprop --ui-content-switcher-track / --ui-content-switcher-padding / --ui-content-switcher-radius / --ui-content-switcher-outline - The track around the items (default transparent, 0, 4px, border-inverse: Carbon's outlined group; Kanok: the contained tabs' segmented track) * @cssprop --ui-content-switcher-item-radius / --ui-content-switcher-item-size / --ui-content-switcher-item-grow / --ui-content-switcher-divider / --ui-content-switcher-selected-shadow - Its items (on ``) */ export declare class UiContentSwitcher extends UiElement { static readonly styles: import("lit").CSSResult; selectedIndex: number; size: ContentSwitcherSize; selectionMode: ContentSwitcherSelectionMode; lowContrast: boolean; /** Reflected by the switcher itself when every item is `icon-only`. */ iconOnly: boolean; private readonly items; private hovered; private focused; connectedCallback(): void; protected updated(): void; private enabledItems; private sync; private itemOf; private select; private onClick; private nextItem; private onKeydown; private onPointer; private onFocus; /** Focus the selected item (the tab stop). */ focus(options?: FocusOptions): void; render(): import("lit-html").TemplateResult<1>; } export interface ContentSwitcherChangeDetail { index: number; name: string; } export interface UiContentSwitcherEventMap extends HTMLElementEventMap { 'ui-change': CustomEvent; } /** Typed listeners for UiContentSwitcher's events (declaration merging with the class). */ export interface UiContentSwitcher { addEventListener(type: K, listener: (this: UiContentSwitcher, event: UiContentSwitcherEventMap[K]) => unknown, options?: boolean | AddEventListenerOptions): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: UiContentSwitcher, event: UiContentSwitcherEventMap[K]) => unknown, options?: boolean | EventListenerOptions): void; removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare global { interface HTMLElementTagNameMap { 'ui-content-switcher': UiContentSwitcher; } }