import { h, Fragment } from "@stencil/core";
import { guid } from "../../utils";
export class DgaInlineAlert {
    constructor() {
        this.type = 'neutral';
        this.isactionButtons = true;
        this.isCloseButton = true;
        this.colored = false;
        this.buttonsList = [
            {
                id: guid(),
                label: 'Button 1',
                onClick: () => { },
                exraClasses: '',
                title: 'Button',
            },
            {
                id: guid(),
                label: 'Button 2',
                onClick: () => { },
                exraClasses: '',
                title: 'Button',
            },
        ];
        this.icons = {
            'error': 'hgi-stroke hgi-help-circle',
            'warning': 'hgi-stroke hgi-alert-02',
            'success': 'hgi-stroke hgi-tick-02',
            'info': 'hgi-stroke hgi-help-circle',
            'neutral': 'hgi-stroke hgi-help-circle',
        };
    }
    render() {
        return (h("div", { key: '8bcdb9afe01434e3c35b6f554b654bd13565c6bb', class: `alert alert--${this.type} ${this.colored ? `alert--${this.type}-bg` : ''}` }, h("div", { key: '8431a91babef9529081bc1f414987a56b1b1295b', class: `alert__header ${this.helperText ? '' : 'dga-flex-center-y'}` }, h("div", { key: '3da3bfe0787af34e67575fe5226be16d62f5b7f9', class: `featured-icon featured-icon--circle featured-icon--md featured-icon--light-${this.type === 'neutral' ? 'gray' : this.type}` }, h("i", { key: '68e2d28c85c81a4b4dab2d3781ea79e8dd38846c', class: this.icons[this.type], style: { fontSize: "20px" } })), h("div", { key: 'bce8a3a0f3044852bc88839e4ddd27eed2f3cdbb', class: "alert__body" }, h("h4", { key: '2e6f5912c03791eae0c698a6d0c2625ab4255353', class: "alert__title text-md-semibold" }, this.leadText), this.helperText && h("p", { key: 'f583415f4f27319b9d46fee2fb5ca33e7347c4f3', class: "alert__content text-sm-regular" }, this.helperText), h("slot", { key: '4c448d3d9fc5fa4e3e34bf73bbf9bc75a74d719c' })), this.isCloseButton && (h("div", { key: 'c00cc7d8531d5fa575ef4cc0b5518928ab5d45e8', class: "alert__close-btn" }, h("button", { key: '107d701bc47c75234eb2f0a149f08a0196550272', class: "dga-btn dga-btn--close dga-btn--icon dga-btn--md", onClick: e => this.onClose && this.onClose(e) }, h("span", { key: '71d8e8bdeb2801fad91bd32c914e1704635331c4', class: "dga-btn-icon" }, h("i", { key: '6213d7b969f0a3a653d77934ed1fb13275959731', class: "hgi-stroke hgi-multiplication-sign", style: { fontSize: "20px" } })))))), this.isactionButtons && (h(Fragment, { key: '13aad7e5fe9185e09ea738d54220c1cf53472cb3' }, h("div", { key: 'e6c59972515f25f2f49a3c4a2dae32537ccd863b', class: "alert__action" }, this.buttonsList.length &&
            this.buttonsList.map(({ id, onClick, exraClasses, title, label }) => {
                return (h("button", Object.assign({ key: id ? id : guid(), id: id ? id : guid(), onClick: e => onClick(e), class: `dga-btn dga-btn--subtle dga-btn--md ${exraClasses}` }, (title && { title: title })), label));
            })), h("div", { key: '9d639e2a36bd4d266d6acf329e10c3a3c81be8a6', class: "alert__action-mobile" }, this.buttonsList.length &&
            this.buttonsList.map(({ id, onClick, exraClasses, title, label }) => {
                return (h("button", Object.assign({ key: id ? id : guid(), id: id ? id : guid(), onClick: e => onClick(e), class: `btn btn--secondary btn--lg ${exraClasses}` }, (title && { title: title })), label));
            }))))));
    }
    static get is() { return "dga-inline-alert"; }
    static get originalStyleUrls() {
        return {
            "$": ["dga-inline-alert.scss"]
        };
    }
    static get styleUrls() {
        return {
            "$": ["dga-inline-alert.css"]
        };
    }
    static get properties() {
        return {
            "type": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "'neutral' | 'info' | 'error' | 'success' | 'warning'",
                    "resolved": "\"error\" | \"info\" | \"neutral\" | \"success\" | \"warning\"",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "attribute": "type",
                "reflect": false,
                "defaultValue": "'neutral'"
            },
            "leadText": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "attribute": "lead-text",
                "reflect": false
            },
            "helperText": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "attribute": "helper-text",
                "reflect": false
            },
            "isactionButtons": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "attribute": "isaction-buttons",
                "reflect": false,
                "defaultValue": "true"
            },
            "isCloseButton": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "attribute": "is-close-button",
                "reflect": false,
                "defaultValue": "true"
            },
            "onClose": {
                "type": "unknown",
                "mutable": false,
                "complexType": {
                    "original": "(event: any) => void",
                    "resolved": "(event: any) => void",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false
            },
            "colored": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "attribute": "colored",
                "reflect": false,
                "defaultValue": "false"
            },
            "buttonsList": {
                "type": "unknown",
                "mutable": false,
                "complexType": {
                    "original": "{\n    id?: string;\n    label: string;\n    onClick: (event?: any) => void;\n    exraClasses?: string;\n    title?: string;\n  }[]",
                    "resolved": "{ id?: string; label: string; onClick: (event?: any) => void; exraClasses?: string; title?: string; }[]",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "defaultValue": "[\n    {\n      id: guid(),\n      label: 'Button 1',\n      onClick: () => {},\n      exraClasses: '',\n      title: 'Button',\n    },\n    {\n      id: guid(),\n      label: 'Button 2',\n      onClick: () => {},\n      exraClasses: '',\n      title: 'Button',\n    },\n  ]"
            }
        };
    }
}
//# sourceMappingURL=dga-inline-alert.js.map
