import { Component, Prop, h, Host } from '@stencil/core';
export class Link {
    constructor() {
        /**
         * Font Size
         */
        this.size = 'regular';
        /**
         * Link rel options - will be ignored if used as button
         */
        this.rel = 'noopener';
        /**
         * Button type - only applies if there is no href
         */
        this.type = 'button';
    }
    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 = ['Link', this.size].filter(c => c !== 'default');
        if (this.arrow)
            classes.push('arrow');
        return (h(Host, { "aria-disabled": disabled },
            h(Tag, Object.assign({}, attrs, { class: classes.join(' ') }),
                h("slot", null))));
    }
    static get is() { return "sr-link"; }
    static get encapsulation() { return "shadow"; }
    static get originalStyleUrls() { return {
        "$": ["_Link-component.scss"]
    }; }
    static get styleUrls() { return {
        "$": ["_Link-component.css"]
    }; }
    static get properties() { return {
        "arrow": {
            "type": "boolean",
            "mutable": false,
            "complexType": {
                "original": "boolean",
                "resolved": "boolean",
                "references": {}
            },
            "required": false,
            "optional": true,
            "docs": {
                "tags": [],
                "text": "Whether the link should use an arrow instead of underline"
            },
            "attribute": "arrow",
            "reflect": false
        },
        "size": {
            "type": "string",
            "mutable": false,
            "complexType": {
                "original": "'regular' | 'medium'",
                "resolved": "\"medium\" | \"regular\"",
                "references": {}
            },
            "required": false,
            "optional": false,
            "docs": {
                "tags": [],
                "text": "Font Size"
            },
            "attribute": "size",
            "reflect": false,
            "defaultValue": "'regular'"
        },
        "href": {
            "type": "string",
            "mutable": false,
            "complexType": {
                "original": "string",
                "resolved": "string",
                "references": {}
            },
            "required": false,
            "optional": true,
            "docs": {
                "tags": [],
                "text": "Optional href target. If not set, the component will use \\<button\\> instead of \\<a\\> 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
        },
        "type": {
            "type": "string",
            "mutable": false,
            "complexType": {
                "original": "'button' | 'submit' | 'reset'",
                "resolved": "\"button\" | \"reset\" | \"submit\"",
                "references": {}
            },
            "required": false,
            "optional": false,
            "docs": {
                "tags": [],
                "text": "Button type - only applies if there is no href"
            },
            "attribute": "type",
            "reflect": false,
            "defaultValue": "'button'"
        },
        "disabled": {
            "type": "boolean",
            "mutable": false,
            "complexType": {
                "original": "boolean",
                "resolved": "boolean",
                "references": {}
            },
            "required": false,
            "optional": true,
            "docs": {
                "tags": [],
                "text": "Disable the button"
            },
            "attribute": "disabled",
            "reflect": false
        }
    }; }
}
