@trendyol/baklava
Version:
Trendyol Baklava Design System
97 lines • 2.59 kB
TypeScript
import { CSSResultGroup, LitElement, TemplateResult } from "lit";
import "../icon/bl-icon";
import { BaklavaIcon } from "../icon/icon-list";
export declare type ButtonVariant = "primary" | "secondary" | "tertiary";
export declare type ButtonKind = "default" | "neutral" | "success" | "danger";
export declare type ButtonSize = "small" | "medium" | "large";
export declare type TargetType = "_blank" | "_parent" | "_self" | "_top";
/**
* @tag bl-button
* @summary Baklava Button component
*
* @cssproperty [--bl-button-display=inline-block] Sets the display property of button
* @cssproperty [--bl-button-justify=center] Sets the justify-content property of button
*
*/
export default class BlButton extends LitElement {
static get styles(): CSSResultGroup;
/**
* Sets the button variant
*/
variant: ButtonVariant;
/**
* Sets the button kind
*/
kind: ButtonKind;
/**
* Sets the button size
*/
size: ButtonSize;
/**
* Sets the button label. Used for accessibility.
*/
label: string;
/**
* Sets the button label for loading status.
*/
loadingLabel: string;
/**
* Sets loading state of button
*/
loading: boolean;
/**
* Sets button as disabled
*/
disabled: boolean;
/**
* Set link url. If set, button will be rendered as anchor tag.
*/
href?: string;
/**
* Sets the icon name. Shows icon with bl-icon component
*/
icon?: BaklavaIcon;
/**
* Sets the anchor target. Used when `href` is set.
*/
target?: TargetType;
/**
* Sets the type of the button. Set `submit` to use button as the submitter of parent form.
*/
type: "submit";
/**
* Sets button type to dropdown
*/
dropdown: boolean;
/**
* Sets button to get keyboard focus automatically
*/
autofocus: boolean;
/**
* Sets the associated form of the button. Use when `type` is set to `submit` and button is not inside the target form.
*/
form: HTMLFormElement | string;
/**
* Active state
*/
active: boolean;
private button;
/**
* Fires when button clicked
*/
private onClick;
private get _isActive();
connectedCallback(): void;
private caretTemplate;
private _handleClick;
focus(): void;
get _hasIconSlot(): boolean;
get _hasDefaultSlot(): boolean;
render(): TemplateResult;
}
declare global {
interface HTMLElementTagNameMap {
"bl-button": BlButton;
}
}
//# sourceMappingURL=bl-button.d.ts.map