@spectrum-web-components/button
Version:
An `<sp-button>` represents an action a user can take. sp-buttons can be clicked or tapped to perform an action or to navigate to another page. sp-buttons in Spectrum have several variations for different uses and multiple levels of loudness for various a
53 lines (52 loc) • 2.02 kB
TypeScript
import { CSSResultArray, PropertyValues, TemplateResult } from '@spectrum-web-components/base';
import { ButtonBase } from './ButtonBase.js';
import { PendingStateController } from '@spectrum-web-components/reactive-controllers/src/PendingState.js';
export type DeprecatedButtonVariants = 'cta' | 'overBackground';
export type ButtonStatics = 'white' | 'black';
export type ButtonVariants = 'accent' | 'primary' | 'secondary' | 'negative' | ButtonStatics | DeprecatedButtonVariants;
export declare const VALID_VARIANTS: string[];
export declare const VALID_STATICS: string[];
export type ButtonTreatments = 'fill' | 'outline';
declare const Button_base: typeof ButtonBase & {
new (...args: any[]): import("@spectrum-web-components/base").SizedElementInterface;
prototype: import("@spectrum-web-components/base").SizedElementInterface;
};
/**
* @element sp-button
*
* @slot - text label of the Button
* @slot icon - The icon to use for Button
*/
export declare class Button extends Button_base {
static get styles(): CSSResultArray;
pendingLabel: string;
pending: boolean;
pendingStateController: PendingStateController<this>;
/**
* Initializes the `PendingStateController` for the Button component.
* The `PendingStateController` manages the pending state of the Button.
*/
constructor();
click(): void;
/**
* The visual variant to apply to this button.
*/
get variant(): ButtonVariants;
set variant(variant: ButtonVariants);
private _variant;
static: 'black' | 'white' | undefined;
/**
* The visual variant to apply to this button.
*/
treatment: ButtonTreatments;
/**
* Style this button to be less obvious
*/
set quiet(quiet: boolean);
get quiet(): boolean;
protected firstUpdated(changes: PropertyValues<this>): void;
protected update(changes: PropertyValues): void;
protected updated(changed: PropertyValues): void;
protected renderButton(): TemplateResult;
}
export {};