import * as i0 from '@angular/core';
import { EventEmitter, input, Component, Input, Output, HostListener, NgModule } from '@angular/core';
import { RouterModule } from '@angular/router';
import { NgClass } from '@angular/common';
import * as i1 from '@seniorsistemas/angular-components/info-sign';
import { InfoSignModule } from '@seniorsistemas/angular-components/info-sign';
import { TooltipDirective } from '@seniorsistemas/angular-components/tooltip';

/**
 * @description Componente de badge (etiqueta) para exibir rótulos coloridos e clicáveis,
 * com suporte a ícones, variantes visuais (pill, tag) e estado selecionável.
 *
 * @example
 * ```html
 * <s-badge color="blue" type="pill" text="Ativo" />
 * ```
 *
 * @category Feedback
 */
class BadgeComponent {
    /** @description Variante visual do badge. @default 'pill' */
    type = 'pill';
    /** @description Cor do badge. @default 'blue' */
    color = 'blue';
    /** @description Texto de título exibido no badge. */
    title;
    /** @description Texto principal exibido dentro do badge. */
    text;
    /** @description Habilita o modo selecionável, emitindo o evento `selected` ao clicar. @default false */
    selectable = false;
    /** @description Classe CSS do ícone exibido no badge (ex.: `'fa fa-check'`). */
    iconClass;
    /** @description Posição do ícone em relação ao texto. @default 'left' */
    iconPosition = 'left';
    /** @description Configuração do info-sign exibido no badge, com texto e tempo de exibição opcional. */
    infoSign;
    /** @description Emitido ao clicar no badge, enviando o valor de `text`. */
    selected = new EventEmitter();
    onClick() {
        this.selected.emit(this.text);
    }
    enableTruncateText = input(false);
    static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: BadgeComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
    static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: BadgeComponent, isStandalone: true, selector: "s-badge", inputs: { type: { classPropertyName: "type", publicName: "type", isSignal: false, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: false, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: false, isRequired: false, transformFunction: null }, text: { classPropertyName: "text", publicName: "text", isSignal: false, isRequired: false, transformFunction: null }, selectable: { classPropertyName: "selectable", publicName: "selectable", isSignal: false, isRequired: false, transformFunction: null }, iconClass: { classPropertyName: "iconClass", publicName: "iconClass", isSignal: false, isRequired: false, transformFunction: null }, iconPosition: { classPropertyName: "iconPosition", publicName: "iconPosition", isSignal: false, isRequired: false, transformFunction: null }, infoSign: { classPropertyName: "infoSign", publicName: "infoSign", isSignal: false, isRequired: false, transformFunction: null }, enableTruncateText: { classPropertyName: "enableTruncateText", publicName: "enableTruncateText", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { selected: "selected" }, host: { listeners: { "click": "onClick()" } }, ngImport: i0, template: "<span\n    class=\"badge inline-flex max-w-full min-h-5 min-w-5 items-center justify-center gap-2 px-2 overflow-hidden border\"\n    [ngClass]=\"{\n        'badge--pill': type === 'pill',\n        'badge--chip': type === 'chip',\n        'badge--red': color === 'red',\n        'badge--orange': color === 'orange',\n        'badge--yellow': color === 'yellow',\n        'badge--blue': color === 'blue',\n        'badge--green': color === 'green',\n        'badge--gray': color === 'gray',\n        'badge--selectable': selectable,\n        'rounded-[10px]': type === 'pill',\n        'rounded-medium': type === 'chip',\n        'bg-sunset-orange-100 border-criticality-red': color === 'red',\n        'bg-buttercup-100 border-criticality-orange': color === 'orange',\n        'bg-buttercup-50 border-criticality-yellow': color === 'yellow',\n        'bg-hippie-blue-100 border-criticality-blue': color === 'blue',\n        'bg-lime-100 border-criticality-green': color === 'green',\n        'bg-grayscale-10 border-grayscale-60': color === 'gray',\n        'cursor-pointer select-none': selectable,\n    }\"\n>\n    @if (infoSign) {\n        <span *sInfoSign=\"infoSign.text; displayTime: infoSign.displayTime ?? 0\"></span>\n    }\n    @if (iconClass) {\n        <span\n            [class]=\"'badge-icon inline-flex items-center justify-center text-[10px] text-grayscale-90 ' + iconClass\"\n            [ngClass]=\"{\n                'badge-icon--left': iconPosition === 'left' && text,\n                'badge-icon--right': iconPosition === 'right' && text,\n                'order-2': iconPosition === 'right' && text,\n            }\"\n        >\n        </span>\n    }\n    @if (title) {\n        <span class=\"badge-title font-open-sans mr-0.5 text-xs font-bold leading-[150%] text-grayscale-90\">{{ title }}:</span>\n    }\n    @if (text) {\n        <span\n            class=\"badge-text font-open-sans text-xs font-normal leading-[150%] text-grayscale-90\"\n            [class.badge-text-truncated]=\"enableTruncateText()\"\n            [class.line-clamp-1]=\"enableTruncateText()\"\n            [sTooltip]=\"text\"\n            [visible]=\"enableTruncateText()\"\n            [checkTruncatedText]=\"enableTruncateText()\"\n        >{{text}}</span>\n    }\n</span>\n\n", styles: ["::ng-deep .info-sign .info-sign__icon{padding:0!important}\n"], dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: InfoSignModule }, { kind: "directive", type: i1.InfoSignDirective, selector: "[sInfoSign]", inputs: ["sInfoSign", "sInfoSignDisplayTime", "sInfoSignFocusedInputRef", "sInfoSignUseFocusedInputRef"] }, { kind: "directive", type: TooltipDirective, selector: "[sTooltip]", inputs: ["sTooltip", "tooltipPosition", "showDelay", "displayTime", "tooltipEvent", "escape", "visible", "mobileBehavior", "focusedInputRef", "checkTruncatedText"] }] });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: BadgeComponent, decorators: [{
            type: Component,
            args: [{ selector: 's-badge', standalone: true, imports: [NgClass, InfoSignModule, TooltipDirective], template: "<span\n    class=\"badge inline-flex max-w-full min-h-5 min-w-5 items-center justify-center gap-2 px-2 overflow-hidden border\"\n    [ngClass]=\"{\n        'badge--pill': type === 'pill',\n        'badge--chip': type === 'chip',\n        'badge--red': color === 'red',\n        'badge--orange': color === 'orange',\n        'badge--yellow': color === 'yellow',\n        'badge--blue': color === 'blue',\n        'badge--green': color === 'green',\n        'badge--gray': color === 'gray',\n        'badge--selectable': selectable,\n        'rounded-[10px]': type === 'pill',\n        'rounded-medium': type === 'chip',\n        'bg-sunset-orange-100 border-criticality-red': color === 'red',\n        'bg-buttercup-100 border-criticality-orange': color === 'orange',\n        'bg-buttercup-50 border-criticality-yellow': color === 'yellow',\n        'bg-hippie-blue-100 border-criticality-blue': color === 'blue',\n        'bg-lime-100 border-criticality-green': color === 'green',\n        'bg-grayscale-10 border-grayscale-60': color === 'gray',\n        'cursor-pointer select-none': selectable,\n    }\"\n>\n    @if (infoSign) {\n        <span *sInfoSign=\"infoSign.text; displayTime: infoSign.displayTime ?? 0\"></span>\n    }\n    @if (iconClass) {\n        <span\n            [class]=\"'badge-icon inline-flex items-center justify-center text-[10px] text-grayscale-90 ' + iconClass\"\n            [ngClass]=\"{\n                'badge-icon--left': iconPosition === 'left' && text,\n                'badge-icon--right': iconPosition === 'right' && text,\n                'order-2': iconPosition === 'right' && text,\n            }\"\n        >\n        </span>\n    }\n    @if (title) {\n        <span class=\"badge-title font-open-sans mr-0.5 text-xs font-bold leading-[150%] text-grayscale-90\">{{ title }}:</span>\n    }\n    @if (text) {\n        <span\n            class=\"badge-text font-open-sans text-xs font-normal leading-[150%] text-grayscale-90\"\n            [class.badge-text-truncated]=\"enableTruncateText()\"\n            [class.line-clamp-1]=\"enableTruncateText()\"\n            [sTooltip]=\"text\"\n            [visible]=\"enableTruncateText()\"\n            [checkTruncatedText]=\"enableTruncateText()\"\n        >{{text}}</span>\n    }\n</span>\n\n", styles: ["::ng-deep .info-sign .info-sign__icon{padding:0!important}\n"] }]
        }], propDecorators: { type: [{
                type: Input
            }], color: [{
                type: Input
            }], title: [{
                type: Input
            }], text: [{
                type: Input
            }], selectable: [{
                type: Input
            }], iconClass: [{
                type: Input
            }], iconPosition: [{
                type: Input
            }], infoSign: [{
                type: Input
            }], selected: [{
                type: Output
            }], onClick: [{
                type: HostListener,
                args: ['click']
            }] } });

class BadgeModule {
    static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: BadgeModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
    static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.14", ngImport: i0, type: BadgeModule, imports: [RouterModule, BadgeComponent], exports: [BadgeComponent, RouterModule] });
    static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: BadgeModule, imports: [RouterModule, BadgeComponent, RouterModule] });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: BadgeModule, decorators: [{
            type: NgModule,
            args: [{
                    imports: [RouterModule, BadgeComponent],
                    exports: [BadgeComponent, RouterModule],
                }]
        }] });

/**
 * Generated bundle index. Do not edit.
 */

export { BadgeComponent, BadgeModule };
//# sourceMappingURL=seniorsistemas-angular-components-badge.mjs.map
