UNPKG

@sandlada/mdc

Version:

@sandlada/mdc is an open source component library that follows the Material Design 3 design specifications.

111 lines 4.89 kB
/** * @license * Copyright 2026 Kai-Orion & Sandlada * SPDX-License-Identifier: MIT * * @fileoverview * Internal base class for `mdc-split-button` — a two-segment control. * * The split button renders two independent native `<button>` elements side by * side inside a shared container: the leading button (primary action) and the * trailing button (menu / related-action trigger). They share the container * height and a pill-shaped corner-radius system and are joined across the small * `between-space` seam, so they read as a single control, but each button paints * its own background / outline and owns its own ripple, focus ring, elevation * and disabled state. * * Both segments accept a label, an icon, or both: * - leading button — default slot (label) + `icon` slot * - trailing button — `trailing-icon` slot + `trailing-label` slot * * Activation is reported through the `leading-button-interaction` and * `trailing-button-interaction` composed events. */ import { LitElement, type TemplateResult } from 'lit'; import { type ISplitButton, type SplitButtonSize, type SplitButtonVariant } from '../split-button.interface'; export declare abstract class BaseSplitButton extends LitElement implements ISplitButton { static styles: import("lit").CSSResult[]; /** Visual variant of the whole split button. */ variant: SplitButtonVariant; /** Size of the whole split button. */ size: SplitButtonSize; /** When `true` both buttons are non-interactive and dimmed. */ disabled: boolean; /** When `true` only the leading button is non-interactive and dimmed. */ leadingDisabled: boolean; /** When `true` only the trailing button is non-interactive and dimmed. */ trailingDisabled: boolean; /** When `true` the trailing button morphs to its expanded shape. */ expanded: boolean; /** When `true` the corner-radius morph on press is disabled. */ disableMorph: boolean; /** When `true` the ripple of both buttons is disabled. */ disableRipple: boolean; /** When `true` the elevation of both buttons is disabled. */ disableElevation: boolean; /** When `true` the focus ring of both buttons is disabled. */ disableFocusRing: boolean; /** Accessible name for the trailing button when it has no visible label. */ trailingAriaLabel: string | null; hasLeadingIcon: boolean; hasLeadingLabel: boolean; hasTrailingIcon: boolean; hasTrailingLabel: boolean; readonly leadingButtonElement: HTMLButtonElement | null; readonly trailingButtonElement: HTMLButtonElement | null; private readonly assignedLeadingIcons; private readonly assignedLeadingLabelNodes; private readonly assignedTrailingIcons; private readonly assignedTrailingLabelNodes; protected get isLeadingDisabled(): boolean; protected get isTrailingDisabled(): boolean; constructor(); protected getRenderClasses(): { [x: string]: boolean; container: boolean; 'disable-morph': boolean; disabled: boolean; }; protected getLeadingButtonClasses(): { 'leading-button': boolean; 'has-icon': boolean; 'has-label': boolean; disabled: boolean; }; protected getTrailingButtonClasses(): { 'trailing-button': boolean; 'has-icon': boolean; 'has-label': boolean; expanded: boolean; disabled: boolean; }; protected render(): TemplateResult; protected renderLeadingButton(): TemplateResult; protected renderLeadingOutline(): TemplateResult; protected renderLeadingBackground(): TemplateResult; protected renderLeadingElevation(): TemplateResult; protected renderLeadingContent(): TemplateResult; protected renderLeadingIcon(): TemplateResult; protected renderLeadingLabel(): TemplateResult; protected renderLeadingRipple(): TemplateResult; protected renderLeadingFocusRing(): TemplateResult; protected renderTrailingButton(): TemplateResult; protected renderTrailingOutline(): TemplateResult; protected renderTrailingBackground(): TemplateResult; protected renderTrailingElevation(): TemplateResult; protected renderTrailingContent(): TemplateResult; protected renderTrailingIcon(): TemplateResult; protected renderTrailingLabel(): TemplateResult; protected renderTrailingRipple(): TemplateResult; protected renderTrailingFocusRing(): TemplateResult; protected renderTouchTarget(): TemplateResult; focus(): void; blur(): void; private readonly handleLeadingButtonClick; private readonly handleTrailingButtonClick; private readonly handleLeadingIconSlotChange; private readonly handleLeadingLabelSlotChange; private readonly handleTrailingIconSlotChange; private readonly handleTrailingLabelSlotChange; } //# sourceMappingURL=base-split-button.d.ts.map