import { WebAwesomeFormAssociatedElement } from '../../internal/webawesome-form-associated-element.js'; import '../icon/icon.js'; import '../spinner/spinner.js'; /** * @summary Buttons represent actions the user can take, such as submitting a form, opening a dialog, or navigating to * another page. * @documentation https://webawesome.com/docs/components/button * @status stable * @since 2.0 * * @dependency wa-icon * @dependency wa-spinner * * @event blur - Emitted when the button loses focus. * @event focus - Emitted when the button gains focus. * @event wa-invalid - Emitted when the form control has been checked for validity and its constraints aren't satisfied. * * @slot - The button's label. * @slot start - An element, such as ``, placed before the label. * @slot end - An element, such as ``, placed after the label. * * @csspart base - The component's base wrapper. * @csspart start - The container that wraps the `start` slot. * @csspart label - The button's label. * @csspart end - The container that wraps the `end` slot. * @csspart caret - The button's caret icon, a `` element. * @csspart spinner - The spinner that shows when the button is in the loading state. * * @cssstate disabled - Applied when the button is disabled. * @cssstate icon-button - Applied when the button contains only a `` with no other content. * @cssstate link - Applied when the button is rendered as a link (i.e. `href` is set). * @cssstate loading - Applied when the button is in the loading state. */ export default class WaButton extends WebAwesomeFormAssociatedElement { static shadowRootOptions: { delegatesFocus: boolean; clonable?: boolean; customElementRegistry?: CustomElementRegistry; mode: ShadowRootMode; serializable?: boolean; slotAssignment?: SlotAssignmentMode; }; static css: import("lit").CSSResult[]; static get validators(): import("../../internal/webawesome-form-associated-element.js").Validator[]; assumeInteractionOn: string[]; private readonly hasSlotController; private readonly localize; button: HTMLButtonElement | HTMLLinkElement; labelSlot: HTMLSlotElement; invalid: boolean; isIconButton: boolean; title: string; /** The button's theme variant. Defaults to `neutral` if not within another element with a variant. */ variant: 'neutral' | 'brand' | 'success' | 'warning' | 'danger'; /** The button's visual appearance. */ appearance: 'accent' | 'filled' | 'outlined' | 'filled-outlined' | 'plain'; /** The button's size. */ size: 'xs' | 's' | 'm' | 'l' | 'xl' | 'small' | 'medium' | 'large'; handleSizeChange(): void; /** Draws the button with a caret. Used to indicate that the button triggers a dropdown menu or similar behavior. */ withCaret: boolean; /** * Only required for SSR. Set to `true` if you're slotting in a `start` element so the server-rendered markup * includes the start slot before the component hydrates on the client. */ withStart: boolean; /** * Only required for SSR. Set to `true` if you're slotting in an `end` element so the server-rendered markup * includes the end slot before the component hydrates on the client. */ withEnd: boolean; /** Disables the button. */ disabled: boolean; /** Draws the button in a loading state. */ loading: boolean; /** Draws a pill-style button with rounded edges. */ pill: boolean; /** * The type of button. Note that the default value is `button` instead of `submit`, which is opposite of how native * `