'use client';
'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

var tslib = require('tslib');
var lit = require('lit');
var decorators_js = require('lit/decorators.js');
var sgdsElement = require('../../base/sgds-element.cjs.js');
var closeButton = require('./close-button.cjs.js');
var ceRegistry = require('../../utils/ce-registry.cjs.js');

/**
 * @summary Close button for closing actions. Used in Modal, Drawer, Alert and Toast.
 *
 */
class SgdsCloseButton extends sgdsElement["default"] {
    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 */
        ceRegistry.warnUnregisteredElements("sgds-icon");
    }
    render() {
        return lit.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["default"].styles, closeButton["default"]];
tslib.__decorate([
    decorators_js.property({ type: String, reflect: true })
], SgdsCloseButton.prototype, "size", void 0);
tslib.__decorate([
    decorators_js.property({ type: String, reflect: true })
], SgdsCloseButton.prototype, "tone", void 0);

exports.SgdsCloseButton = SgdsCloseButton;
exports["default"] = SgdsCloseButton;
//# sourceMappingURL=sgds-close-button.cjs.js.map
