diff --git a/public/index.html b/public/index.html index ba9e963..3b36db9 100644 --- a/public/index.html +++ b/public/index.html @@ -6,7 +6,6 @@ CRM - = (props) => { const { status, color, className = "", icon } = props; + const sanitizeBadgeColor = (c?: string) => { + if (!c) return undefined; + const lower = c.toLowerCase(); + if (["#28a745", "#30bc20ff", "#198754", "#22c55e", "#10b981", "#16a34a"].includes(lower)) return "#8B5CF6"; + if (["#dc3545", "#ea5455", "#e41f07", "#dc2626", "#ef4444", "#ff0e0e", "#e11d48"].includes(lower)) return "#7C3AED"; + if (["#fda700", "#ffc107", "#ffa201", "#f59e0b", "#ff9d0a", "#ff9b04", "#d97706", "#ea580c"].includes(lower)) return "#38BDF8"; + if (["#1ecbe2", "#0d6efd", "#007bff", "#0284c7"].includes(lower)) return "#38BDF8"; + return c; + }; + const getStatusColor = (status: string) => { const lowerStatus = status.toLowerCase().trim(); - // ✅ Added: Active & Inactive support (highest priority) - if (lowerStatus === "active") return "#28a745"; // Bootstrap success green - if (lowerStatus === "inactive") return "#dc3545"; - if (lowerStatus === "contacted") return "#30bc20ff"; // Success Green - if (lowerStatus === "closed") return "#1ecbe2"; // Info Cyan - if (lowerStatus === "lost") return "#EA5455"; // Danger Red - if (lowerStatus === "not_contacted" || lowerStatus === "not contacted") return "#fda700"; // Warning Orange - return undefined; // No default here + if (lowerStatus === "active") return "#8B5CF6"; // Vibrant Purple + if (lowerStatus === "inactive") return "#94A3B8"; // Muted Slate + if (lowerStatus === "contacted") return "#38BDF8"; // Light Blue + if (lowerStatus === "closed") return "#7C3AED"; // Deep Purple + if (lowerStatus === "lost") return "#64748B"; // Slate Gray + if (lowerStatus === "not_contacted" || lowerStatus === "not contacted") return "#38BDF8"; // Light Blue + if (lowerStatus === "pending") return "#38BDF8"; // Light Blue + if (lowerStatus === "sent") return "#8B5CF6"; // Purple + if (lowerStatus === "failed") return "#7C3AED"; // Deep Purple + return "#8B5CF6"; }; const isKnownStatus = (status: string) => { const lower = status.toLowerCase().trim(); - return ["active", "inactive", "contacted", "closed", "lost", "not_contacted", "not contacted"].includes(lower); + return ["active", "inactive", "contacted", "closed", "lost", "not_contacted", "not contacted", "pending", "sent", "failed"].includes(lower); }; - let badgeColor = color; + let badgeColor = sanitizeBadgeColor(color); if (!badgeColor) { if (isKnownStatus(status)) { badgeColor = getStatusColor(status); } else if (!className) { - // Only default to purple if no class is provided - badgeColor = "#7367F0"; + badgeColor = "#8B5CF6"; } } diff --git a/src/core/common/DynamicThemeStyles.tsx b/src/core/common/DynamicThemeStyles.tsx index 4b9e5f9..e60e9e6 100644 --- a/src/core/common/DynamicThemeStyles.tsx +++ b/src/core/common/DynamicThemeStyles.tsx @@ -219,46 +219,278 @@ const DynamicThemeStyles = () => { color: #ffffff !important; } - /* Buttons: Ensure no stale orange/red outlines */ - .btn-outline-warning { + /* Buttons: Complete overhaul of danger, warning, success, primary, info, secondary */ + .btn-danger, + .btn.btn-danger { + background: #7C3AED !important; + background-color: #7C3AED !important; + border-color: #7C3AED !important; + color: #ffffff !important; + } + .btn-danger:hover, + .btn.btn-danger:hover { + background-color: #6D28D9 !important; + border-color: #6D28D9 !important; + color: #ffffff !important; + } + + .btn-outline-danger, + .btn.btn-outline-danger { + border-color: #7C3AED !important; + color: #7C3AED !important; + background-color: transparent !important; + } + .btn-outline-danger:hover, + .btn.btn-outline-danger:hover { + background-color: #7C3AED !important; + border-color: #7C3AED !important; + color: #ffffff !important; + } + + .btn-outline-warning, + .btn.btn-outline-warning { border-color: #38BDF8 !important; color: #0284C7 !important; background-color: transparent !important; } - .btn-outline-warning:hover { + .btn-outline-warning:hover, + .btn.btn-outline-warning:hover { background-color: #38BDF8 !important; border-color: #38BDF8 !important; color: #ffffff !important; } - .btn-outline-info, - .btn-outline-secondary { - border-color: #38BDF8 !important; - color: #0284C7 !important; - } - .btn-outline-info:hover, - .btn-outline-secondary:hover { + .btn-warning, + .btn.btn-warning { background-color: #38BDF8 !important; border-color: #38BDF8 !important; color: #ffffff !important; } + .btn-warning:hover, + .btn.btn-warning:hover { + background-color: #0EA5E9 !important; + border-color: #0EA5E9 !important; + color: #ffffff !important; + } - .btn-outline-primary { + .btn-outline-success, + .btn.btn-outline-success { border-color: #8B5CF6 !important; color: #8B5CF6 !important; + background-color: transparent !important; } - .btn-outline-primary:hover { + .btn-outline-success:hover, + .btn.btn-outline-success:hover { background-color: #8B5CF6 !important; border-color: #8B5CF6 !important; color: #ffffff !important; } - .btn-primary { + .btn-success, + .btn.btn-success { + background-color: #8B5CF6 !important; + border-color: #8B5CF6 !important; + color: #ffffff !important; + } + .btn-success:hover, + .btn.btn-success:hover { + background-color: #7C3AED !important; + border-color: #7C3AED !important; + color: #ffffff !important; + } + + .btn-outline-info, + .btn-outline-secondary, + .btn.btn-outline-info, + .btn.btn-outline-secondary { + border-color: #38BDF8 !important; + color: #0284C7 !important; + background-color: transparent !important; + } + .btn-outline-info:hover, + .btn-outline-secondary:hover, + .btn.btn-outline-info:hover, + .btn.btn-outline-secondary:hover { + background-color: #38BDF8 !important; + border-color: #38BDF8 !important; + color: #ffffff !important; + } + + .btn-outline-primary, + .btn.btn-outline-primary { + border-color: #8B5CF6 !important; + color: #8B5CF6 !important; + background-color: transparent !important; + } + .btn-outline-primary:hover, + .btn.btn-outline-primary:hover { + background-color: #8B5CF6 !important; + border-color: #8B5CF6 !important; + color: #ffffff !important; + } + + .btn-primary, + .btn.btn-primary { background: linear-gradient(135deg, #8B5CF6 0%, #7C3AED 100%) !important; border-color: #7C3AED !important; color: #ffffff !important; } + .btn-save { + background: #8B5CF6 !important; + color: #ffffff !important; + } + + /* Widgets & KPI Cards */ + .card { + border-color: #f1f5f9 !important; + } + .kpi-icon.bg-warning, + .kpi-icon.bg-warning-subtle { + background-color: #E0F2FE !important; + color: #0284C7 !important; + } + .kpi-icon.bg-success, + .kpi-icon.bg-success-subtle { + background-color: #F3E8FF !important; + color: #8B5CF6 !important; + } + .kpi-icon.bg-danger, + .kpi-icon.bg-danger-subtle { + background-color: #F3E8FF !important; + color: #7C3AED !important; + } + + .kpi-accent-success .kpi-icon-badge, + .kpi-accent-info .kpi-icon-badge, + .kpi-accent-peach .kpi-icon-badge { + background: #E0F2FE !important; + color: #0284C7 !important; + } + .kpi-accent-warning .kpi-icon-badge, + .kpi-accent-danger .kpi-icon-badge, + .kpi-accent-primary .kpi-icon-badge, + .kpi-accent-secondary .kpi-icon-badge { + background: #F3E8FF !important; + color: #8B5CF6 !important; + } + + /* Badges & Tags across all tables and widgets */ + .badge.bg-warning, + .badge.bg-warning-subtle, + .badge-soft-warning, + .badge-warning { + background-color: #E0F2FE !important; + color: #0284C7 !important; + border: 1px solid #BAE6FD !important; + } + .badge.bg-success, + .badge.bg-success-subtle, + .badge-soft-success, + .badge-success { + background-color: #F3E8FF !important; + color: #8B5CF6 !important; + border: 1px solid #DDD6FE !important; + } + .badge.bg-danger, + .badge.bg-danger-subtle, + .badge-soft-danger, + .badge-danger { + background-color: #F3E8FF !important; + color: #7C3AED !important; + border: 1px solid #DDD6FE !important; + } + .badge.bg-info, + .badge.bg-info-subtle, + .badge-soft-info, + .badge-info { + background-color: #E0F2FE !important; + color: #0284C7 !important; + border: 1px solid #BAE6FD !important; + } + + /* Text and Background Utility Overrides */ + .bg-danger, + .bg-danger-subtle, + .bg-light-danger { + background-color: #F3E8FF !important; + color: #7C3AED !important; + } + .bg-warning, + .bg-warning-subtle, + .bg-light-warning { + background-color: #E0F2FE !important; + color: #0284C7 !important; + } + .bg-success, + .bg-success-subtle, + .bg-light-success { + background-color: #F3E8FF !important; + color: #8B5CF6 !important; + } + .text-danger { + color: #7C3AED !important; + } + .text-warning { + color: #0284C7 !important; + } + .text-success { + color: #8B5CF6 !important; + } + .text-info { + color: #0284C7 !important; + } + + /* Alerts */ + .alert-danger { + background-color: #FAF5FF !important; + border-color: #DDD6FE !important; + color: #7C3AED !important; + } + .alert-warning { + background-color: #F0F9FF !important; + border-color: #BAE6FD !important; + color: #0284C7 !important; + } + .alert-success { + background-color: #FAF5FF !important; + border-color: #DDD6FE !important; + color: #8B5CF6 !important; + } + + /* Modals */ + .modal-header .btn-close, + .modal-header .close { + color: #8B5CF6 !important; + opacity: 0.8 !important; + } + .modal-header { + border-bottom: 1px solid #F1F5F9 !important; + } + .modal-content { + border-radius: 12px !important; + border: 1px solid #E2E8F0 !important; + } + .modal-footer { + border-top: 1px solid #F1F5F9 !important; + } + + /* Form controls focus */ + .form-control:focus, + .form-select:focus { + border-color: #8B5CF6 !important; + box-shadow: 0 0 0 0.25rem rgba(139, 92, 246, 0.2) !important; + } + .form-check-input:checked { + background-color: #8B5CF6 !important; + border-color: #8B5CF6 !important; + } + + /* Schedule Dots */ + .dot.red { background-color: #7C3AED !important; } + .dot.yellow { background-color: #38BDF8 !important; } + .dot.green { background-color: #8B5CF6 !important; } + /* Pagination and Active Tabs */ .page-item.active .page-link, .pagination .active .page-link { @@ -280,6 +512,31 @@ const DynamicThemeStyles = () => { .breadcrumb-item a:hover { color: #8B5CF6 !important; } + + /* SVG / ApexCharts overrides for old palette */ + .apexcharts-series path[stroke="#f59e0b"], + .apexcharts-series path[fill="#f59e0b"], + .apexcharts-series path[fill="#F59E0B"], + .apexcharts-series path[stroke="#F59E0B"] { + fill: #38BDF8 !important; + stroke: #38BDF8 !important; + } + .apexcharts-series path[stroke="#ef4444"], + .apexcharts-series path[fill="#ef4444"], + .apexcharts-series path[fill="#EF4444"], + .apexcharts-series path[stroke="#EF4444"] { + fill: #7C3AED !important; + stroke: #7C3AED !important; + } + .apexcharts-series path[stroke="#10b981"], + .apexcharts-series path[fill="#10b981"], + .apexcharts-series path[fill="#10B981"], + .apexcharts-series path[stroke="#10B981"], + .apexcharts-series path[stroke="#22c55e"], + .apexcharts-series path[fill="#22c55e"] { + fill: #8B5CF6 !important; + stroke: #8B5CF6 !important; + } `; return () => { diff --git a/src/core/common/KPIcard.tsx b/src/core/common/KPIcard.tsx index 2387ce0..2b49f74 100644 --- a/src/core/common/KPIcard.tsx +++ b/src/core/common/KPIcard.tsx @@ -87,12 +87,29 @@ const KpiCard: React.FC = ({ tooltip, style, percentage, - percentageColor = "success", + percentageColor = "primary", percentageIcon, }) => { + const normalizedColor = + color === "danger" || color === "warning" || color === "peach" || color === "primary" + ? "primary" + : "secondary"; + + const normalizedPercentageColor = + percentageColor === "danger" ? "primary" : percentageColor === "warning" ? "secondary" : "secondary"; + return ( -
-
+
+
{/* LEFT CONTENT */}
@@ -102,13 +119,16 @@ const KpiCard: React.FC = ({ )}
-
{title1}
-

+ {title1 &&

{title1}
} +

{suffix}

@@ -119,10 +139,11 @@ const KpiCard: React.FC = ({ {/* Reserve space for percentage line on ALL cards */}
- {" "} - {/* min-h-20 = min-height: 20px */} {percentage !== undefined ? ( - + {percentageIcon && } {Math.abs(parseFloat(percentage))}% @@ -136,8 +157,22 @@ const KpiCard: React.FC = ({
{/* RIGHT ICON */} -
- +
+
diff --git a/src/feature-module/crm/contacts/contactList.tsx b/src/feature-module/crm/contacts/contactList.tsx index abec474..16ca4b4 100644 --- a/src/feature-module/crm/contacts/contactList.tsx +++ b/src/feature-module/crm/contacts/contactList.tsx @@ -4077,7 +4077,7 @@ if (assignOnCreate && selectedUserForCreate && createdContactId) {