license import { html , styles } from './action-button.template.js' ; /**
 * An action button for use with [[Card]] components.
 *
 * ```javascript
 * // Create an action button, give it a label and a click handler.
 * const button = new ActionButton();
 * button.label = 'Dismiss';
 * button.addEventListener('click', () => {
 *   card.close();
 * });
 *
 * // Now create a card, and append the button to it.
 * const card = new Card();
 * card.src = 'Card with Actions';
 * card.appendChild(button);
 * ```
 */ export class ActionButton extends HTMLElement { /**
     * The ActionButton's default tag name for registering with
     * `customElements.define`.
     */ static defaultTagName = 'action-button' ; /**
     * The ActionButton's default label.
     */ static readonly DEFAULT_LABEL = 'Button' ; private labelInternal = ActionButton . DEFAULT_LABEL ; private root = this . attachShadow ( { mode : 'open' } ) ; constructor ( ) { super ( ) ; } ignore connectedCallback ( ) { this . root . innerHTML = `<style>${ styles }</style> ${ html }` ; this . render ( ) ; } /**
     * Gets & sets the label for the instance.
     */ get label ( ) { return this . labelInternal ; } set label ( label ) { this . labelInternal = label ; this . render ( ) ; } private render ( ) { const button = this . root . querySelector ( 'button' ) ; if ( ! button ) { return ; } button . textContent = this . label ; } }