import { h } from "@stencil/core";
export class ButtonClose {
    constructor() {
        /**
         * If true will render as a free button instead of the standard icon.
         */
        this.free = false;
    }
    onClick() {
        if (this.context !== 'clear') {
            this.anjClose.emit();
        }
    }
    render() {
        return (h("anj-button", { context: this.free ? 'free' : 'icon', onClick: () => this.onClick(), ariaLabel: this.context === 'clear' ? 'Clear' : 'Close' },
            h("svg", { slot: "icon-only", xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24" },
                h("path", { d: "M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z" }))));
    }
    static get is() { return "anj-button-close"; }
    static get encapsulation() { return "scoped"; }
    static get originalStyleUrls() { return {
        "$": ["button-close.scss"]
    }; }
    static get styleUrls() { return {
        "$": ["button-close.css"]
    }; }
    static get properties() { return {
        "context": {
            "type": "string",
            "mutable": false,
            "complexType": {
                "original": "'clear' | 'floating' | undefined",
                "resolved": "\"clear\" | \"floating\"",
                "references": {}
            },
            "required": false,
            "optional": false,
            "docs": {
                "tags": [],
                "text": "Let's you use the close button styling in various ways.\nOptions are `\"clear\"`, `\"floating\"`, and undefined.\nclear: same great styling, no anjClose event.\nfloating: positions the button absolutely in the top right of the closest positioned ancestor"
            },
            "attribute": "context",
            "reflect": true
        },
        "free": {
            "type": "boolean",
            "mutable": false,
            "complexType": {
                "original": "boolean",
                "resolved": "boolean",
                "references": {}
            },
            "required": false,
            "optional": false,
            "docs": {
                "tags": [],
                "text": "If true will render as a free button instead of the standard icon."
            },
            "attribute": "free",
            "reflect": false,
            "defaultValue": "false"
        }
    }; }
    static get events() { return [{
            "method": "anjClose",
            "name": "anjClose",
            "bubbles": true,
            "cancelable": true,
            "composed": true,
            "docs": {
                "tags": [],
                "text": "Emitted when the button is clicked unless suppressed by setting the emit prop to false."
            },
            "complexType": {
                "original": "void",
                "resolved": "void",
                "references": {}
            }
        }]; }
}
