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

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,159 @@
1
+ // import React from "react";
2
+ // import { ResponsiveContainer, LineChart, Line, XAxis, YAxis, Tooltip, CartesianGrid, Legend } from "recharts";
3
+
4
+ // const ExecutiveLineChart = ({ data = [], dataKey = "completed", name = "Value" }) => {
5
+ // return (
6
+ // <div className="chart-card" style={{ minHeight: 320 }}>
7
+ // <ResponsiveContainer width="100%" height={320}>
8
+ // <LineChart data={data} margin={{ top: 12, right: 16, left: 0, bottom: 0 }}>
9
+ // <CartesianGrid stroke="rgba(148, 163, 184, 0.12)" strokeDasharray="4 4" />
10
+ // <XAxis dataKey="label" axisLine={false} tickLine={false} tick={{ fill: "#cbd5e1" }} />
11
+ // <YAxis axisLine={false} tickLine={false} tick={{ fill: "#cbd5e1" }} />
12
+ // <Tooltip contentStyle={{ background: "#0f172a", border: "none", borderRadius: 14, color: "#f8fafc" }} itemStyle={{ color: "#f8fafc" }} />
13
+ // <Legend verticalAlign="top" align="right" iconType="circle" wrapperStyle={{ color: "#cbd5e1" }} />
14
+ // <Line
15
+ // type="monotone"
16
+ // dataKey={dataKey}
17
+ // name={name}
18
+ // stroke="#38bdf8"
19
+ // strokeWidth={3}
20
+ // dot={{ r: 4 }}
21
+ // activeDot={{ r: 6, strokeWidth: 2, fill: "#60a5fa" }}
22
+ // />
23
+ // </LineChart>
24
+ // </ResponsiveContainer>
25
+ // </div>
26
+ // );
27
+ // };
28
+
29
+ // export default ExecutiveLineChart;
30
+
31
+ import React from "react";
32
+ import { ResponsiveContainer, LineChart, Line, XAxis, YAxis, Tooltip, CartesianGrid, Legend } from "recharts";
33
+
34
+ const ExecutiveLineChart = ({ data = [] }) => {
35
+ const formattedData = data.map((item) => ({
36
+ ...item,
37
+
38
+ agencyKyc: item.completed || 0,
39
+
40
+ selfKyc: Math.round((item.completed || 0) * 0.42),
41
+
42
+ totalKyc: (item.completed || 0) + Math.round((item.completed || 0) * 0.42),
43
+ }));
44
+
45
+ return (
46
+ <div className="chart-card executive-line-chart">
47
+ <ResponsiveContainer width="100%" height={340}>
48
+ <LineChart
49
+ data={formattedData}
50
+ margin={{
51
+ top: 20,
52
+ right: 12,
53
+ left: 0,
54
+ bottom: 0,
55
+ }}
56
+ >
57
+ <CartesianGrid stroke="#e2e8f0" strokeDasharray="3 3" vertical={false} />
58
+
59
+ <XAxis
60
+ dataKey="label"
61
+ axisLine={false}
62
+ tickLine={false}
63
+ tick={{
64
+ fill: "#64748b",
65
+ fontSize: 12,
66
+ fontWeight: 600,
67
+ }}
68
+ />
69
+
70
+ <YAxis
71
+ axisLine={false}
72
+ tickLine={false}
73
+ tick={{
74
+ fill: "#64748b",
75
+ fontSize: 12,
76
+ }}
77
+ />
78
+
79
+ <Tooltip
80
+ cursor={{
81
+ stroke: "#cbd5e1",
82
+ strokeWidth: 1,
83
+ }}
84
+ contentStyle={{
85
+ background: "#ffffff",
86
+ border: "1px solid #e2e8f0",
87
+ borderRadius: 18,
88
+ boxShadow: "0 10px 30px rgba(15,23,42,0.08)",
89
+ }}
90
+ labelStyle={{
91
+ color: "#0f172a",
92
+ fontWeight: 700,
93
+ marginBottom: 10,
94
+ }}
95
+ />
96
+
97
+ <Legend
98
+ verticalAlign="top"
99
+ align="right"
100
+ iconType="circle"
101
+ wrapperStyle={{
102
+ paddingBottom: 18,
103
+ color: "#475569",
104
+ fontWeight: 600,
105
+ }}
106
+ />
107
+
108
+ {/* TOTAL */}
109
+
110
+ <Line
111
+ type="monotone"
112
+ dataKey="totalKyc"
113
+ name="Total eKYC"
114
+ stroke="#0f172a"
115
+ strokeWidth={4}
116
+ dot={false}
117
+ activeDot={{
118
+ r: 6,
119
+ }}
120
+ />
121
+
122
+ {/* AGENCY */}
123
+
124
+ <Line
125
+ type="monotone"
126
+ dataKey="agencyKyc"
127
+ name="Agency eKYC"
128
+ stroke="#3b82f6"
129
+ strokeWidth={3}
130
+ dot={{
131
+ r: 3,
132
+ }}
133
+ activeDot={{
134
+ r: 6,
135
+ }}
136
+ />
137
+
138
+ {/* SELF */}
139
+
140
+ <Line
141
+ type="monotone"
142
+ dataKey="selfKyc"
143
+ name="Self eKYC"
144
+ stroke="#10b981"
145
+ strokeWidth={3}
146
+ dot={{
147
+ r: 3,
148
+ }}
149
+ activeDot={{
150
+ r: 6,
151
+ }}
152
+ />
153
+ </LineChart>
154
+ </ResponsiveContainer>
155
+ </div>
156
+ );
157
+ };
158
+
159
+ export default ExecutiveLineChart;
@@ -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
  };