@djb25/digit-ui-module-ekyc 1.0.13 → 1.0.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,24 @@
1
+ import React from "react";
2
+ import { ResponsiveContainer, PieChart, Pie, Cell, Tooltip, Legend } from "recharts";
3
+
4
+ const colors = ["#22c55e", "#38bdf8", "#f97316", "#facc15", "#f43f5e"];
5
+
6
+ const ExecutivePieChart = ({ data = [], dataKey = "value", labelKey = "label" }) => {
7
+ return (
8
+ <div className="chart-card" style={{ minHeight: 320 }}>
9
+ <ResponsiveContainer width="100%" height={320}>
10
+ <PieChart>
11
+ <Pie data={data} dataKey={dataKey} nameKey={labelKey} cx="50%" cy="50%" outerRadius={110} innerRadius={60} paddingAngle={3} label={{ fill: "#f8fafc", fontSize: 12 }}>
12
+ {data.map((entry, index) => (
13
+ <Cell key={`cell-${index}`} fill={colors[index % colors.length]} />
14
+ ))}
15
+ </Pie>
16
+ <Tooltip contentStyle={{ background: "#0f172a", border: "none", borderRadius: 14, color: "#f8fafc" }} />
17
+ <Legend verticalAlign="bottom" align="center" iconType="circle" wrapperStyle={{ color: "#cbd5e1", marginTop: 10 }} />
18
+ </PieChart>
19
+ </ResponsiveContainer>
20
+ </div>
21
+ );
22
+ };
23
+
24
+ export default ExecutivePieChart;
@@ -1,8 +1,6 @@
1
1
  import React, { useEffect, useRef } from "react";
2
2
  import { useTranslation } from "react-i18next";
3
- import { Chart, registerables } from "chart.js";
4
-
5
- Chart.register(...registerables);
3
+ import Chart from "chart.js/auto";
6
4
 
7
5
  const TaskStatusChart = ({ data, title }) => {
8
6
  const { t } = useTranslation();
@@ -1,70 +1,50 @@
1
1
  import React from "react";
2
2
  import { useTranslation } from "react-i18next";
3
3
 
4
- /**
5
- * Main structural shell for the Enterprise Dashboard.
6
- */
7
4
  const DashboardLayout = ({ header, filters, children, onNotificationClick, activeRole, onRoleChange }) => {
8
5
  const { t } = useTranslation();
9
6
 
10
7
  const roles = ["CEO", "CLUSTER_MANAGER", "AGENCY_SUPERVISOR"];
11
8
 
12
9
  return (
13
- <div className="enterprise-dashboard-layout" style={{ background: "linear-gradient(135deg, #F8FAFC 0%, #F1F5F9 100%)", minHeight: "100vh" }}>
10
+ <div className="enterprise-dashboard-layout">
11
+ <div className="dashboard-background-glow glow-1" />
12
+ <div className="dashboard-background-glow glow-2" />
13
+
14
14
  {/* Top Navigation / Header */}
15
- <div className="glass-card" style={{ padding: "24px 32px", display: "flex", justifyContent: "space-between", alignItems: "center", borderRadius: "0", borderTop: "none", borderLeft: "none", borderRight: "none" }}>
16
- <div>
17
- <h1 style={{ fontSize: "28px", fontWeight: "900", color: "#1E293B", letterSpacing: "-0.05em" }}>{t(header)}</h1>
18
- <p style={{ fontSize: "14px", color: "#64748B", marginTop: "4px", fontWeight: "500" }}>{t("EKYC_DASHBOARD_SUBTITLE_ALT") || "Operational analytics & performance monitoring."}</p>
15
+ <div className="glass-card dashboard-header">
16
+ <div className="dashboard-header-left">
17
+ <div className="dashboard-chip">LIVE ANALYTICS</div>
18
+
19
+ <h1 className="dashboard-title gradient-text">{t(header)}</h1>
20
+
21
+ <p className="dashboard-subtitle">{t("EKYC_DASHBOARD_SUBTITLE_ALT") || "Operational analytics & performance monitoring."}</p>
19
22
  </div>
20
-
21
- <div style={{ display: "flex", alignItems: "center", gap: "20px" }}>
22
- {/* Role Switcher for Simulation */}
23
- <div style={{ display: "flex", background: "#F3F4F6", padding: "4px", borderRadius: "8px", gap: "4px" }}>
24
- {roles.map(role => (
25
- <button
26
- key={role}
27
- onClick={() => onRoleChange(role)}
28
- style={{
29
- padding: "6px 12px",
30
- borderRadius: "6px",
31
- fontSize: "12px",
32
- fontWeight: "700",
33
- border: "none",
34
- cursor: "pointer",
35
- background: activeRole === role ? "var(--primary-gradient)" : "transparent",
36
- color: activeRole === role ? "#FFFFFF" : "#64748B",
37
- boxShadow: activeRole === role ? "0 4px 12px rgba(99, 102, 241, 0.3)" : "none",
38
- transition: "all 0.3s cubic-bezier(0.4, 0, 0.2, 1)"
39
- }}
40
- >
23
+
24
+ <div className="dashboard-header-actions">
25
+ {/* Role Switcher */}
26
+ <div className="role-switcher">
27
+ {roles.map((role) => (
28
+ <button key={role} onClick={() => onRoleChange(role)} className={`role-switcher-button ${activeRole === role ? "active" : "inactive"}`}>
41
29
  {t(role)}
42
30
  </button>
43
31
  ))}
44
32
  </div>
45
33
 
46
- <button
47
- onClick={onNotificationClick}
48
- style={{ position: "relative", background: "#F3F4F6", border: "none", padding: "10px", borderRadius: "50%", cursor: "pointer" }}
49
- >
50
- <span style={{ fontSize: "20px" }}>🔔</span>
51
- <span style={{ position: "absolute", top: "0", right: "0", width: "10px", height: "10px", background: "#EF4444", borderRadius: "50%", border: "2px solid #FFF" }} />
34
+ {/* Notification */}
35
+ <button onClick={onNotificationClick} className="notification-button">
36
+ <span className="notification-icon">🔔</span>
37
+
38
+ <span className="notification-badge" />
52
39
  </button>
53
40
  </div>
54
41
  </div>
55
42
 
56
- {/* Filter Bar Position */}
57
- {filters}
58
-
59
- {/* Main Content Area */}
60
- <div style={{ padding: "24px", maxWidth: "1600px", margin: "0 auto" }}>
61
- {children}
62
- </div>
43
+ {/* Filter Bar */}
44
+ <div className="dashboard-filter-wrapper">{filters}</div>
63
45
 
64
- {/* Footer Branding */}
65
- <div style={{ padding: "40px 24px", textAlign: "center", color: "#9CA3AF", fontSize: "12px" }}>
66
- {t("EKYC_POWERED_BY_UPYOG")} | {new Date().getFullYear()} © {t("EKYC_GOVT_DJB")}
67
- </div>
46
+ {/* Main Content */}
47
+ <div className="dashboard-content animate-fade-in">{children}</div>
68
48
  </div>
69
49
  );
70
50
  };