@cranberry-money/shared-constants
Version:
Shared constants for Blueberry platform
71 lines • 2.61 kB
JavaScript
export const UNIFIED_STATUS_COLORS = {
pending: 'text-warning-600',
awaiting: 'text-warning-600',
pending_review: 'text-warning-600',
on_hold: 'text-warning-600',
processing: 'text-primary-600',
in_progress: 'text-primary-600',
active: 'text-primary-600',
completed: 'text-success-700',
approved: 'text-success-600',
executed: 'text-success-600',
settled: 'text-success-600',
success: 'text-success-600',
failed: 'text-error-700',
rejected: 'text-error-600',
error: 'text-error-600',
cancelled: 'text-content-subtle',
expired: 'text-content-subtle',
inactive: 'text-content-subtle',
closed: 'text-content-subtle',
default: 'text-content-subtle',
};
export const getStatusColor = (status) => {
const normalizedStatus = status.toLowerCase().replace(/_/g, '_');
return UNIFIED_STATUS_COLORS[normalizedStatus] || UNIFIED_STATUS_COLORS.default;
};
export const UNIFIED_STATUS_BG_COLORS = {
pending: 'bg-warning-50',
awaiting: 'bg-warning-50',
pending_review: 'bg-warning-50',
on_hold: 'bg-warning-50',
processing: 'bg-primary-50',
in_progress: 'bg-primary-50',
active: 'bg-primary-50',
completed: 'bg-success-50',
approved: 'bg-success-50',
executed: 'bg-success-50',
settled: 'bg-success-50',
success: 'bg-success-50',
failed: 'bg-error-50',
rejected: 'bg-error-50',
error: 'bg-error-50',
cancelled: 'bg-gray-50',
expired: 'bg-gray-50',
inactive: 'bg-gray-50',
closed: 'bg-gray-50',
default: 'bg-gray-50',
};
export const UNIFIED_STATUS_BADGE_COLORS = {
pending: 'bg-warning-100 text-warning-700',
awaiting: 'bg-warning-100 text-warning-700',
pending_review: 'bg-warning-100 text-warning-700',
on_hold: 'bg-warning-100 text-warning-700',
processing: 'bg-primary-100 text-primary-700',
in_progress: 'bg-primary-100 text-primary-700',
active: 'bg-primary-100 text-primary-700',
completed: 'bg-success-100 text-success-700',
approved: 'bg-success-100 text-success-700',
executed: 'bg-success-100 text-success-700',
settled: 'bg-success-100 text-success-700',
success: 'bg-success-100 text-success-700',
failed: 'bg-error-100 text-error-700',
rejected: 'bg-error-100 text-error-700',
error: 'bg-error-100 text-error-700',
cancelled: 'bg-gray-100 text-gray-700',
expired: 'bg-gray-100 text-gray-700',
inactive: 'bg-gray-100 text-gray-700',
closed: 'bg-gray-100 text-gray-700',
default: 'bg-gray-100 text-gray-700',
};
//# sourceMappingURL=status-colors-unified.js.map