import { __decorate } from "tslib";
import { attr } from '@ni/fast-element';
import { applyMixins, ARIAGlobalStatesAndProperties, DesignSystem, FoundationElement } from '@ni/fast-foundation';
import { styles } from './styles';
import { template } from './template';
import { BannerSeverity } from './types';
/**
 * A nimble-styled notification banner for persistent messages.
 */
export class Banner extends FoundationElement {
    constructor() {
        super(...arguments);
        /**
         * @public
         * @description
         * Whether the banner is visible or not
         */
        this.open = false;
        /**
         * @public
         * @description
         * Severity of the banner's message
         */
        this.severity = BannerSeverity.default;
        /**
         * @public
         * @description
         * Whether the banner title is hidden
         */
        this.titleHidden = false;
        /**
         * @public
         * @description
         * Hides the dismiss button
         */
        this.preventDismiss = false;
    }
    /**
     * @internal
     */
    openChanged() {
        const eventDetail = {
            newState: this.open,
            oldState: !this.open
        };
        this.$emit('toggle', eventDetail);
    }
    /**
     * @internal
     */
    dismissBanner() {
        this.open = false;
    }
}
__decorate([
    attr({ mode: 'boolean' })
], Banner.prototype, "open", void 0);
__decorate([
    attr()
], Banner.prototype, "severity", void 0);
__decorate([
    attr({ attribute: 'title-hidden', mode: 'boolean' })
], Banner.prototype, "titleHidden", void 0);
__decorate([
    attr({ attribute: 'prevent-dismiss', mode: 'boolean' })
], Banner.prototype, "preventDismiss", void 0);
applyMixins(Banner, ARIAGlobalStatesAndProperties);
const nimbleBanner = Banner.compose({
    baseName: 'banner',
    template,
    styles
});
DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleBanner());
export const bannerTag = 'nimble-banner';
//# sourceMappingURL=index.js.map