import TerraElement, { type TerraFormControl } from '../../internal/terra-element.js'; import type { CSSResultGroup } from 'lit'; import TerraIcon from '../icon/icon.component.js'; /** * @summary Buttons represent actions that are available to the user. * @documentation https://terra-ui.netlify.app/components/button * @status stable * @since 1.0 * * @slot - The button's label. * @slot prefix - A presentational prefix icon or similar element. * @slot suffix - A presentational suffix icon or similar element. * * @event terra-blur - emitted when the button is blurred * @event terra-focus - emitted when the button is focused * * @csspart base - The component's base wrapper. * @csspart prefix - The container that wraps the prefix. * @csspart label - The button's label. * @csspart suffix - The container that wraps the suffix. * @csspart caret - The button's caret icon, an `` element. * @csspart spinner - The spinner that shows when the button is in the loading state. */ export default class TerraButton extends TerraElement implements TerraFormControl { #private; static styles: CSSResultGroup; static dependencies: { 'terra-icon': typeof TerraIcon; }; private readonly formControlController; private readonly hasSlotController; button: HTMLButtonElement | HTMLLinkElement; private hasFocus; invalid: boolean; title: string; /** The button's theme variant. */ variant: 'default' | 'primary' | 'success' | 'warning' | 'danger' | 'text' | 'pagelink'; /** The button's size. */ size: 'small' | 'medium' | 'large'; /** Draws the button with a caret. Used to indicate that the button triggers a dropdown menu or similar behavior. */ caret: boolean; /** The button's shape. Used to control the radius edge shape when button is not in a terra-button-group. */ shape: 'square' | 'square-left' | 'square-right'; /** Disables the button. */ disabled: boolean; /** Draws the button in a loading state. */ loading: boolean; /** Draws an outlined button. */ outline: boolean; /** * Draws a circular icon button. When this attribute is present, the button expects a single `` in the * default slot. */ circle: boolean; /** * The type of button. Note that the default value is `button` instead of `submit`, which is opposite of how native * `