import { Component, Prop, Host, h } from '@stencil/core';
export class IconButton {
    constructor() {
        /**
         * The icon to use. See icons doc for possible values
         */
        this.icon = 'resize';
        /**
         * The color of the button
         */
        this.color = 'default';
        /**
         * The size of the button
         */
        this.size = 'default';
        /**
         * Button type - will be ignored if used as link
         */
        this.type = 'button';
        /**
         * Link rel options - will be ignored if used as button
         */
        this.rel = 'noopener';
    }
    render() {
        const isBtn = typeof this.href === 'undefined';
        const Tag = isBtn ? 'button' : 'a';
        const disabled = isBtn ? this.disabled : undefined;
        const attrs = isBtn
            ? {
                type: this.type,
                disabled
            }
            : {
                download: this.download,
                href: this.href,
                hreflang: this.hreflang,
                rel: this.rel,
                target: this.target
            };
        const classes = ['RoundIconButton', this.color, this.size].filter(c => c !== 'default');
        return (h(Host, { "aria-disabled": disabled },
            h(Tag, Object.assign({}, attrs, { class: classes.join(' ') }),
                h("span", { class: "visuallyhidden" },
                    h("slot", null, "More")),
                h("sr-icon", { name: this.icon }))));
    }
    static get is() { return "sr-icon-button"; }
    static get encapsulation() { return "shadow"; }
    static get originalStyleUrls() { return {
        "$": ["_IconButton-component.scss"]
    }; }
    static get styleUrls() { return {
        "$": ["_IconButton-component.css"]
    }; }
    static get properties() { return {
        "icon": {
            "type": "string",
            "mutable": false,
            "complexType": {
                "original": "string",
                "resolved": "string",
                "references": {}
            },
            "required": false,
            "optional": false,
            "docs": {
                "tags": [],
                "text": "The icon to use. See icons doc for possible values"
            },
            "attribute": "icon",
            "reflect": false,
            "defaultValue": "'resize'"
        },
        "color": {
            "type": "string",
            "mutable": false,
            "complexType": {
                "original": "'default' | 'transparent'",
                "resolved": "\"default\" | \"transparent\"",
                "references": {}
            },
            "required": false,
            "optional": false,
            "docs": {
                "tags": [],
                "text": "The color of the button"
            },
            "attribute": "color",
            "reflect": false,
            "defaultValue": "'default'"
        },
        "size": {
            "type": "string",
            "mutable": false,
            "complexType": {
                "original": "'default' | 'large'",
                "resolved": "\"default\" | \"large\"",
                "references": {}
            },
            "required": false,
            "optional": false,
            "docs": {
                "tags": [],
                "text": "The size of the button"
            },
            "attribute": "size",
            "reflect": false,
            "defaultValue": "'default'"
        },
        "block": {
            "type": "boolean",
            "mutable": false,
            "complexType": {
                "original": "boolean",
                "resolved": "boolean",
                "references": {}
            },
            "required": false,
            "optional": true,
            "docs": {
                "tags": [],
                "text": "Display as block instead of inline-block"
            },
            "attribute": "block",
            "reflect": true
        },
        "type": {
            "type": "string",
            "mutable": false,
            "complexType": {
                "original": "'button' | 'submit' | 'reset'",
                "resolved": "\"button\" | \"reset\" | \"submit\"",
                "references": {}
            },
            "required": false,
            "optional": false,
            "docs": {
                "tags": [],
                "text": "Button type - will be ignored if used as link"
            },
            "attribute": "type",
            "reflect": false,
            "defaultValue": "'button'"
        },
        "disabled": {
            "type": "boolean",
            "mutable": false,
            "complexType": {
                "original": "boolean",
                "resolved": "boolean",
                "references": {}
            },
            "required": false,
            "optional": true,
            "docs": {
                "tags": [],
                "text": "Button disabled state - will be ignored if used as link"
            },
            "attribute": "disabled",
            "reflect": false
        },
        "href": {
            "type": "string",
            "mutable": false,
            "complexType": {
                "original": "string",
                "resolved": "string",
                "references": {}
            },
            "required": false,
            "optional": true,
            "docs": {
                "tags": [],
                "text": "Optional href target. If set, the component will use \\<a\\> instead of \\<button\\> internally."
            },
            "attribute": "href",
            "reflect": false
        },
        "download": {
            "type": "any",
            "mutable": false,
            "complexType": {
                "original": "any",
                "resolved": "any",
                "references": {}
            },
            "required": false,
            "optional": true,
            "docs": {
                "tags": [],
                "text": "Link rel options - will be ignored if used as button"
            },
            "attribute": "download",
            "reflect": false
        },
        "hreflang": {
            "type": "string",
            "mutable": false,
            "complexType": {
                "original": "string",
                "resolved": "string",
                "references": {}
            },
            "required": false,
            "optional": true,
            "docs": {
                "tags": [],
                "text": "Language of link target - will be ignored if used as button"
            },
            "attribute": "hreflang",
            "reflect": false
        },
        "rel": {
            "type": "string",
            "mutable": false,
            "complexType": {
                "original": "string",
                "resolved": "string",
                "references": {}
            },
            "required": false,
            "optional": false,
            "docs": {
                "tags": [],
                "text": "Link rel options - will be ignored if used as button"
            },
            "attribute": "rel",
            "reflect": false,
            "defaultValue": "'noopener'"
        },
        "target": {
            "type": "string",
            "mutable": false,
            "complexType": {
                "original": "string",
                "resolved": "string",
                "references": {}
            },
            "required": false,
            "optional": true,
            "docs": {
                "tags": [],
                "text": "Link target options - will be ignored if used as button"
            },
            "attribute": "target",
            "reflect": false
        }
    }; }
}
