'use client';
import { __decorate } from 'tslib';
import { html } from 'lit';
import { property } from 'lit/decorators.js';
import SgdsElement from '../../base/sgds-element.js';
import css_248z from './close-button.js';
import { warnUnregisteredElements } from '../../utils/ce-registry.js';

/**
 * @summary Close button for closing actions. Used in Modal, Drawer, Alert and Toast.
 *
 */
class SgdsCloseButton extends SgdsElement {
    constructor() {
        super(...arguments);
        /** Specifies a large or small button */
        this.size = "md";
        /** The tone of the close button */
        this.tone = "default";
        this._clickHandler = () => {
            return;
        };
    }
    _handleClick() {
        this.removeEventListener("click", this._clickHandler);
        this.addEventListener("click", this._clickHandler);
    }
    firstUpdated(changedProperties) {
        super.firstUpdated(changedProperties);
        /** Cannot register sgds-icon as dependency due to some circular dependencies, so we check and warn instead */
        warnUnregisteredElements("sgds-icon");
    }
    render() {
        return html `
      <button class="btn-close" aria-label="Close button" @click=${this._handleClick}>
        <sgds-icon name="cross" size=${this.size}></sgds-icon>
      </button>
    `;
    }
}
SgdsCloseButton.styles = [...SgdsElement.styles, css_248z];
__decorate([
    property({ type: String, reflect: true })
], SgdsCloseButton.prototype, "size", void 0);
__decorate([
    property({ type: String, reflect: true })
], SgdsCloseButton.prototype, "tone", void 0);

export { SgdsCloseButton, SgdsCloseButton as default };
//# sourceMappingURL=sgds-close-button.js.map
