import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output } from '@angular/core';
import { IconComponent } from '../icon/icon.component';
import { NgClass } from '@angular/common';
import { ButtonComponent } from '../button/button.component';
import * as i0 from "@angular/core";
/**
 * The alert component is responsible to show alerts for diverse elements. Including `FormErrorComponent` among others.
 */
export class AlertComponent {
    constructor() {
        this.dismissable = false;
        this.fullSize = true;
        this.text = '';
        this.type = 'primary';
        this.variant = 'solid';
        this.size = 'base';
        this.withIcon = true;
        this.dismiss = new EventEmitter();
    }
    get icon() {
        switch (this.type) {
            case 'primary':
            case 'secondary':
            case 'neutral':
                return 'information-circle';
            case 'error':
                return 'exclamation-triangle';
            case 'warning':
                return 'exclamation-circle';
            case 'success':
                return 'check-circle';
            default:
                return '';
        }
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: AlertComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.13", type: AlertComponent, isStandalone: true, selector: "ct-alert", inputs: { dismissable: "dismissable", fullSize: "fullSize", text: "text", type: "type", variant: "variant", size: "size", withIcon: "withIcon" }, outputs: { dismiss: "dismiss" }, ngImport: i0, template: "<div\n  class=\"flex flex-row items-center gap-1 rounded-lg font-primary\"\n  [class.w-fit]=\"!fullSize\"\n  [class.w-full]=\"fullSize\"\n  role=\"alert\"\n  [ngClass]=\"{\n    'text-xs': size === 'xs' || size === 'sm',\n    'text-sm': size === 'base',\n    'text-base': size === 'lg' || size === 'xl',\n    'text-primary dark:text-on-primary-dark': type === 'primary' && variant !== 'solid',\n    'text-neutral dark:text-on-neutral-dark': type === 'neutral' && variant !== 'solid',\n    'text-warning dark:text-warning-variant-dark': type === 'warning' && variant !== 'solid',\n    'text-error dark:text-error-variant-dark': type === 'error' && variant !== 'solid',\n    'text-success dark:texts-success-variant-dark': type === 'success' && variant !== 'solid',\n\n    'bg-primary dark:bg-primary-dark text-on-primary dark:text-on-primary-dark':\n      type === 'primary' && variant === 'solid',\n    'bg-neutral dark:bg-neutral-dark text-on-neutral dark:text-on-neutral-dark':\n      type === 'neutral' && variant === 'solid',\n    'bg-warning dark:bg-warning-dark text-on-warning dark:text-on-warning-dark':\n      type === 'warning' && variant === 'solid',\n    'bg-error dark:bg-error-dark text-on-error dark:text-on-error-dark': type === 'error' && variant === 'solid',\n    'bg-success dark:bg-success-dark text-on-success dark:text-on-success-dark':\n      type === 'success' && variant === 'solid',\n\n    border: variant === 'outline',\n    'border-primary dark:border-primary-dark': type === 'primary' && variant === 'outline',\n    'border-warning dark:border-warning-dark': type === 'warning' && variant === 'outline',\n    'border-error dark:border-error-dark': type === 'error' && variant === 'outline',\n    'border-success dark:border-success-dark': type === 'success' && variant === 'outline',\n    'px-4 py-2': variant !== 'blank'\n  }\">\n  @if (withIcon) {\n    <ct-icon [icon]=\"this.icon\" [size]=\"size\" />\n  }\n  <span class=\"grow font-semibold\">{{ text }}</span>\n  @if (dismissable) {\n    <ct-button\n      icon=\"x-mark\"\n      size=\"sm\"\n      [variant]=\"this.variant === 'solid' ? 'solid' : 'blank'\"\n      [type]=\"type\"\n      (click)=\"dismiss.emit()\" />\n  }\n</div>\n", dependencies: [{ kind: "component", type: IconComponent, selector: "ct-icon", inputs: ["icon", "fill", "strokeWidth", "strokeColor", "size", "variant"] }, { kind: "component", type: ButtonComponent, selector: "ct-button", inputs: ["text", "icon", "iconPosition", "role", "disabled", "fullSize", "size", "type", "variant"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: AlertComponent, decorators: [{
            type: Component,
            args: [{ selector: 'ct-alert', standalone: true, imports: [IconComponent, ButtonComponent, NgClass], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\n  class=\"flex flex-row items-center gap-1 rounded-lg font-primary\"\n  [class.w-fit]=\"!fullSize\"\n  [class.w-full]=\"fullSize\"\n  role=\"alert\"\n  [ngClass]=\"{\n    'text-xs': size === 'xs' || size === 'sm',\n    'text-sm': size === 'base',\n    'text-base': size === 'lg' || size === 'xl',\n    'text-primary dark:text-on-primary-dark': type === 'primary' && variant !== 'solid',\n    'text-neutral dark:text-on-neutral-dark': type === 'neutral' && variant !== 'solid',\n    'text-warning dark:text-warning-variant-dark': type === 'warning' && variant !== 'solid',\n    'text-error dark:text-error-variant-dark': type === 'error' && variant !== 'solid',\n    'text-success dark:texts-success-variant-dark': type === 'success' && variant !== 'solid',\n\n    'bg-primary dark:bg-primary-dark text-on-primary dark:text-on-primary-dark':\n      type === 'primary' && variant === 'solid',\n    'bg-neutral dark:bg-neutral-dark text-on-neutral dark:text-on-neutral-dark':\n      type === 'neutral' && variant === 'solid',\n    'bg-warning dark:bg-warning-dark text-on-warning dark:text-on-warning-dark':\n      type === 'warning' && variant === 'solid',\n    'bg-error dark:bg-error-dark text-on-error dark:text-on-error-dark': type === 'error' && variant === 'solid',\n    'bg-success dark:bg-success-dark text-on-success dark:text-on-success-dark':\n      type === 'success' && variant === 'solid',\n\n    border: variant === 'outline',\n    'border-primary dark:border-primary-dark': type === 'primary' && variant === 'outline',\n    'border-warning dark:border-warning-dark': type === 'warning' && variant === 'outline',\n    'border-error dark:border-error-dark': type === 'error' && variant === 'outline',\n    'border-success dark:border-success-dark': type === 'success' && variant === 'outline',\n    'px-4 py-2': variant !== 'blank'\n  }\">\n  @if (withIcon) {\n    <ct-icon [icon]=\"this.icon\" [size]=\"size\" />\n  }\n  <span class=\"grow font-semibold\">{{ text }}</span>\n  @if (dismissable) {\n    <ct-button\n      icon=\"x-mark\"\n      size=\"sm\"\n      [variant]=\"this.variant === 'solid' ? 'solid' : 'blank'\"\n      [type]=\"type\"\n      (click)=\"dismiss.emit()\" />\n  }\n</div>\n" }]
        }], propDecorators: { dismissable: [{
                type: Input
            }], fullSize: [{
                type: Input
            }], text: [{
                type: Input,
                args: [{ required: true }]
            }], type: [{
                type: Input
            }], variant: [{
                type: Input
            }], size: [{
                type: Input
            }], withIcon: [{
                type: Input
            }], dismiss: [{
                type: Output
            }] } });
//# sourceMappingURL=data:application/json;base64, 