import { CommonModule } from "@angular/common"; import { Component, ElementRef, HostBinding, Input } from "@angular/core"; import { FocusableElement } from "../shared/focusable-element"; export type BadgeVariant = | "primary" | "secondary" | "success" | "danger" | "warning" | "info" | "notification"; const styles: Record = { primary: ["tw-bg-primary-100", "tw-border-primary-700", "!tw-text-primary-700"], secondary: ["tw-bg-secondary-100", "tw-border-secondary-700", "!tw-text-secondary-700"], success: ["tw-bg-success-100", "tw-border-success-700", "!tw-text-success-700"], danger: ["tw-bg-danger-100", "tw-border-danger-700", "!tw-text-danger-700"], warning: ["tw-bg-warning-100", "tw-border-warning-700", "!tw-text-warning-700"], info: ["tw-bg-info-100", "tw-border-info-700", "!tw-text-info-700"], notification: [ "tw-bg-notification-100", "tw-border-notification-600", "!tw-text-notification-600", ], }; const hoverStyles: Record = { primary: ["hover:tw-bg-primary-600", "hover:tw-border-primary-600", "hover:!tw-text-contrast"], secondary: [ "hover:tw-bg-secondary-600", "hover:tw-border-secondary-600", "hover:!tw-text-contrast", ], success: ["hover:tw-bg-success-600", "hover:tw-border-success-600", "hover:!tw-text-contrast"], danger: ["hover:tw-bg-danger-600", "hover:tw-border-danger-600", "hover:!tw-text-contrast"], warning: ["hover:tw-bg-warning-600", "hover:tw-border-warning-600", "hover:!tw-text-black"], info: ["hover:tw-bg-info-600", "hover:tw-border-info-600", "hover:!tw-text-black"], notification: [ "hover:tw-bg-notification-600", "hover:tw-border-notification-600", "hover:!tw-text-contrast", ], }; /** * Badges are primarily used as labels, counters, and small buttons. * Typically Badges are only used with text set to `text-xs`. If additional sizes are needed, the component configurations may be reviewed and adjusted. * The Badge directive can be used on a `` (non clickable events), or an `` or `