import { h, Host } from "@stencil/core";
import { govHost } from "../../helpers/Dom/template";
import { BannerBackground, BannerClass, BannerForeground, BannerSizes, BannerTextColor } from "./constants";
import { validateProp } from "../../helpers/Validate/props";
export class GovBanner {
    constructor() {
        /**
         * Banner’s size.
         */
        this.size = BannerSizes._M;
        /**
         * Banner’s background
         */
        this.background = BannerBackground.SIMPLE;
        /**
         * Banner’s foreground
         */
        this.foreground = BannerForeground.LOGO;
        /**
         * XL Banner’s text color
         */
        this.textColor = BannerTextColor.LIGHT;
        this.h = govHost(this.host);
    }
    validateSize(newValue) {
        validateProp(BannerSizes, newValue, BannerClass.root);
    }
    validateBackground(newValue) {
        validateProp(BannerBackground, newValue, BannerClass.root);
    }
    validateForeground(newValue) {
        validateProp(BannerForeground, newValue, BannerClass.root);
    }
    validateTextColor(newValue) {
        validateProp(BannerTextColor, newValue, BannerClass.root);
    }
    componentWillLoad() {
        this.validateSize(this.size);
        this.validateBackground(this.background);
        this.validateForeground(this.foreground);
        this.validateTextColor(this.textColor);
    }
    render() {
        return (h(Host, Object.assign({ key: 'c035b04b0715ffcc996d66a1f673d1bd9518284c', class: this.h.classes(BannerClass.root), role: "region", size: this.size }, (this.size !== "xl" ? {
            background: this.background,
            foreground: this.foreground
        } : { 'text-color': this.textColor })), h("div", { key: 'd5a59901f7a1a707c3679ffc20677163bbf31dc7' }, h("div", { key: '366d4ce913119a38f3166fdc70d9ae06181e7a5d', class: BannerClass.content }, h("slot", { key: '92baa67137573e91b5eb74884b2fa1cb68d5bf90', name: "headline" }), h("slot", { key: '2630dbd6c23e8ec71b136d76df977b0bef7aa830' })), this.h.hasSlot('button') && (h("slot", { key: '0e8b200648c9a4af27da49a5f725be48159ad595', name: "button" }))), h("slot", { key: '79bdb4c7d136d66561aab55012c8d5669503469f', name: "image" })));
    }
    static get is() { return "gov-banner"; }
    static get properties() {
        return {
            "size": {
                "type": "string",
                "attribute": "size",
                "mutable": false,
                "complexType": {
                    "original": "BannerSizesType",
                    "resolved": "\"l\" | \"m\" | \"s\" | \"xl\"",
                    "references": {
                        "BannerSizesType": {
                            "location": "import",
                            "path": "./constants",
                            "id": "../../../packages/core/src/components/gov-banner/constants.ts::BannerSizesType"
                        }
                    }
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Banner\u2019s size."
                },
                "getter": false,
                "setter": false,
                "reflect": true,
                "defaultValue": "BannerSizes._M"
            },
            "background": {
                "type": "string",
                "attribute": "background",
                "mutable": false,
                "complexType": {
                    "original": "BannerBackgroundsType",
                    "resolved": "\"lines\" | \"simple\" | \"stripes\" | \"waves\"",
                    "references": {
                        "BannerBackgroundsType": {
                            "location": "import",
                            "path": "./constants",
                            "id": "../../../packages/core/src/components/gov-banner/constants.ts::BannerBackgroundsType"
                        }
                    }
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Banner\u2019s background"
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "defaultValue": "BannerBackground.SIMPLE"
            },
            "foreground": {
                "type": "string",
                "attribute": "foreground",
                "mutable": false,
                "complexType": {
                    "original": "BannerForegroundsType",
                    "resolved": "\"icon\" | \"image\" | \"logo\"",
                    "references": {
                        "BannerForegroundsType": {
                            "location": "import",
                            "path": "./constants",
                            "id": "../../../packages/core/src/components/gov-banner/constants.ts::BannerForegroundsType"
                        }
                    }
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Banner\u2019s foreground"
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "defaultValue": "BannerForeground.LOGO"
            },
            "textColor": {
                "type": "string",
                "attribute": "text-color",
                "mutable": false,
                "complexType": {
                    "original": "BannerTextColorsType",
                    "resolved": "\"dark\" | \"light\"",
                    "references": {
                        "BannerTextColorsType": {
                            "location": "import",
                            "path": "./constants",
                            "id": "../../../packages/core/src/components/gov-banner/constants.ts::BannerTextColorsType"
                        }
                    }
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "XL Banner\u2019s text color"
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "defaultValue": "BannerTextColor.LIGHT"
            }
        };
    }
    static get elementRef() { return "host"; }
    static get watchers() {
        return [{
                "propName": "size",
                "methodName": "validateSize"
            }, {
                "propName": "background",
                "methodName": "validateBackground"
            }, {
                "propName": "foreground",
                "methodName": "validateForeground"
            }, {
                "propName": "text-color",
                "methodName": "validateTextColor"
            }];
    }
}
//# sourceMappingURL=gov-banner.js.map
