import SynergyElement from '../../internal/synergy-element.js'; import SynIcon from '../icon/icon.component.js'; import SynSpinner from '../spinner/spinner.component.js'; import type { CSSResultGroup } from 'lit'; import type { SynergyFormControl } from '../../internal/synergy-element.js'; /** * @summary Buttons represent actions that are available to the user. * @documentation https://synergy-design-system.github.io/?path=/docs/components-syn-button--docs * @status stable * @since 2.0 * * @dependency syn-icon * @dependency syn-spinner * * @event syn-blur - Emitted when the button loses focus. * @event syn-focus - Emitted when the button gains focus. * @event syn-invalid - Emitted when the form control has been checked for validity and its constraints aren't satisfied. * * @slot - The button's label. * @slot prefix - A presentational prefix icon or similar element. * @slot suffix - A presentational suffix icon or similar element. * * @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 SynButton extends SynergyElement implements SynergyFormControl { static styles: CSSResultGroup; static dependencies: { 'syn-icon': typeof SynIcon; 'syn-spinner': typeof SynSpinner; }; private readonly formControlController; private readonly hasSlotController; private readonly localize; button: HTMLButtonElement | HTMLLinkElement; defaultSlot: HTMLSlotElement; private iconOnly; private hasFocus; invalid: boolean; title: string; /** The button's theme variant. */ variant: 'filled' | 'outline' | 'text'; /** 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; /** Disables the button. */ disabled: boolean; /** Draws the button in a loading state. */ loading: boolean; /** * The type of button. Note that the default value is `button` instead of `submit`, which is opposite of how native * `