forked from baron/baron-sso
- Added missing i18n keys for import results in both root and common locales. - Fixed TypeScript type errors and implicit 'any' types in TenantListPage. - Added 'destructive' variant to common Badge component. - Updated Playwright tests with refined locators and enhanced API mocks to match the new reporting structure. - Restored quick summary message in Tenant Registry for backward compatibility.
29 lines
1.2 KiB
TypeScript
29 lines
1.2 KiB
TypeScript
export const commonBadgeBaseClass =
|
|
"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2";
|
|
|
|
export const commonBadgeVariantClasses = {
|
|
default:
|
|
"border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/90",
|
|
secondary:
|
|
"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
|
outline: "text-foreground",
|
|
muted: "border-border bg-secondary/60 text-muted-foreground",
|
|
success:
|
|
"border-transparent bg-emerald-100 text-emerald-700 dark:bg-emerald-900/40 dark:text-emerald-300",
|
|
warning:
|
|
"border-transparent bg-amber-100 text-amber-700 dark:bg-amber-900/40 dark:text-amber-200",
|
|
destructive:
|
|
"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",
|
|
info: "border-transparent bg-blue-500 text-white hover:bg-blue-500/90",
|
|
} as const;
|
|
|
|
export type CommonBadgeVariant = keyof typeof commonBadgeVariantClasses;
|
|
|
|
export function getCommonBadgeClasses({
|
|
variant = "default",
|
|
}: {
|
|
variant?: CommonBadgeVariant;
|
|
}) {
|
|
return [commonBadgeBaseClass, commonBadgeVariantClasses[variant]].join(" ");
|
|
}
|