'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

const core = require('./core-859ae5a6.js');

const Alert = class {
    constructor(hostRef) {
        core.registerInstance(this, hostRef);
        /**
         * Sets the alert context
         * Options are: `"info"`, "success"`, `"danger"`, `"warning"`, and `"primary"`.
         * Default value is: 'info'
         */
        this.context = 'info';
        this.anjAlertWillDismiss = core.createEvent(this, "anjAlertWillDismiss", 7);
    }
    onDismiss() {
        this.anjAlertWillDismiss.emit();
        this.element.remove();
    }
    onCollapseEvent(collapse) {
        this.collapsedClass = (collapse.detail) ? 'anj-collapsed' : undefined;
    }
    render() {
        return (core.h(core.Host, { class: this.collapsedClass }, core.h("slot", null)));
    }
    get element() { return core.getElement(this); }
    static get style() { return ".sc-anj-alert-h {\n  display: block;\n  font-size: 0.875rem;\n  font-family: var(--anj-font-family);\n  font-weight: normal;\n  line-height: 1.5;\n  outline: none;\n  border-radius: 0;\n  -webkit-box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 3px 1px -2px rgba(0, 0, 0, 0.12), 0 1px 5px 0 rgba(0, 0, 0, 0.2);\n  box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 3px 1px -2px rgba(0, 0, 0, 0.12), 0 1px 5px 0 rgba(0, 0, 0, 0.2);\n  padding: 1rem;\n  background-color: var(--anj-light);\n  display: block;\n  background-color: #f1f5f6;\n  max-height: 1000px;\n  overflow: hidden;\n  position: relative;\n  -webkit-transition: max-height 0.4s ease-in;\n  transition: max-height 0.4s ease-in;\n}\n.sc-anj-alert-h, .sc-anj-alert-h::before, .sc-anj-alert-h::after {\n  -webkit-box-sizing: border-box;\n  box-sizing: border-box;\n  outline: none;\n}\n.sc-anj-alert-h:focus, .sc-anj-alert-h:active, .sc-anj-alert-h *.sc-anj-alert:focus, .sc-anj-alert-h *.sc-anj-alert:active {\n  outline: none;\n}\n.anj-collapsed.sc-anj-alert-h {\n  max-height: 56px;\n  -webkit-transition: max-height 0.4s ease-out;\n  transition: max-height 0.4s ease-out;\n}\n[context=primary].sc-anj-alert-h {\n  background-color: #e9f1f8;\n}\n[context=danger].sc-anj-alert-h {\n  background-color: #f6ebeb;\n}\n[context=success].sc-anj-alert-h {\n  background-color: #f0f4f0;\n}\n[context=warning].sc-anj-alert-h {\n  background-color: #fff1ec;\n}\n\n.sc-anj-alert-s > p:last-child {\n  margin-bottom: 0;\n}"; }
};

exports.anj_alert = Alert;
