@umituz/web-dashboard 3.1.4 → 3.1.5

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umituz/web-dashboard",
3
- "version": "3.1.4",
3
+ "version": "3.1.5",
4
4
  "description": "Dashboard Layout System - Comprehensive analytics, calendar, customizable layouts, and config-based architecture",
5
5
  "main": "./src/index.ts",
6
6
  "types": "./src/index.ts",
@@ -61,7 +61,9 @@
61
61
  "peerDependencies": {
62
62
  "react": "^18.0.0 || ^19.0.0",
63
63
  "react-dom": "^18.0.0 || ^19.0.0",
64
- "react-router-dom": "^7.0.0"
64
+ "react-router-dom": "^6.0.0 || ^7.0.0",
65
+ "firebase": "^10.0.0 || ^11.0.0 || ^12.0.0",
66
+ "@umituz/web-firebase": "^3.0.0"
65
67
  },
66
68
  "dependencies": {
67
69
  "class-variance-authority": "^0.7.1",
@@ -76,7 +78,9 @@
76
78
  "@typescript-eslint/eslint-plugin": "^8.57.2",
77
79
  "@typescript-eslint/parser": "^8.57.2",
78
80
  "@umituz/web-design-system": "^3.1.11",
81
+ "@umituz/web-firebase": "^3.6.0",
79
82
  "eslint": "^10.0.2",
83
+ "firebase": "^12.0.0",
80
84
  "react-i18next": "^16.5.4",
81
85
  "react-router-dom": "^7.13.1",
82
86
  "typescript": "^5.9.3"
@@ -145,7 +145,7 @@ export const AnalyticsChart = ({ config, className, height }: AnalyticsChartProp
145
145
  innerRadius={config.type === "donut" ? 40 : 0}
146
146
  dataKey="value"
147
147
  >
148
- {config.data.map((entry: Record<string, unknown>, index: number) => (
148
+ {config.data.map((entry, index: number) => (
149
149
  <Cell key={`cell-${index}`} fill={colors[index % colors.length]} />
150
150
  ))}
151
151
  </Pie>
@@ -189,7 +189,7 @@ export function useAnalytics(options: UseAnalyticsOptions = {}) {
189
189
 
190
190
  // Advanced analytics methods
191
191
  const calculateRetention = useCallback(
192
- (userData: unknown[]) => {
192
+ (userData: import("../services/AnalyticsEngineService").UserData[]) => {
193
193
  try {
194
194
  return analyticsEngineService.calculateRetention(userData);
195
195
  } catch (err) {
@@ -201,7 +201,7 @@ export function useAnalytics(options: UseAnalyticsOptions = {}) {
201
201
  );
202
202
 
203
203
  const calculateFunnel = useCallback(
204
- (data: unknown[], steps: string[]) => {
204
+ (data: import("../services/AnalyticsEngineService").FunnelItem[], steps: string[]) => {
205
205
  try {
206
206
  return analyticsEngineService.calculateFunnel(data, steps);
207
207
  } catch (err) {
@@ -213,7 +213,7 @@ export function useAnalytics(options: UseAnalyticsOptions = {}) {
213
213
  );
214
214
 
215
215
  const segmentUsers = useCallback(
216
- (userData: unknown[]) => {
216
+ (userData: import("../services/AnalyticsEngineService").UserData[]) => {
217
217
  try {
218
218
  return analyticsEngineService.segmentUsers(userData);
219
219
  } catch (err) {
@@ -225,7 +225,7 @@ export function useAnalytics(options: UseAnalyticsOptions = {}) {
225
225
  );
226
226
 
227
227
  const predictUserBehavior = useCallback(
228
- (user: Record<string, unknown>, historicalData: unknown[]) => {
228
+ (user: Record<string, unknown>, historicalData: import("../services/AnalyticsEngineService").UserData[]) => {
229
229
  try {
230
230
  return analyticsEngineService.predictUserBehavior(user, historicalData);
231
231
  } catch (err) {
@@ -246,7 +246,7 @@ export function useAnalytics(options: UseAnalyticsOptions = {}) {
246
246
  }, [onError]);
247
247
 
248
248
  const getRealtimeMetrics = useCallback(
249
- (previous?: Record<string, unknown>) => {
249
+ (previous?: import("../services/PerformanceService").RealtimeMetrics) => {
250
250
  try {
251
251
  return performanceService.simulateRealtimeMetrics(previous);
252
252
  } catch (err) {
@@ -244,13 +244,14 @@ export function aggregateByPeriod(
244
244
  });
245
245
 
246
246
  return Array.from(grouped.entries()).map(([date, items]) => {
247
- const aggregated: Record<string, string | number> = { date };
247
+ const aggregated: { date: string; [key: string]: string | number } = { date };
248
248
 
249
249
  // Sum all numeric fields
250
250
  items.forEach((item) => {
251
251
  Object.entries(item).forEach(([key, value]) => {
252
252
  if (key !== "date" && typeof value === "number") {
253
- aggregated[key] = (aggregated[key] || 0) + value;
253
+ const currentValue = aggregated[key];
254
+ aggregated[key] = typeof currentValue === "number" ? currentValue + value : value;
254
255
  }
255
256
  });
256
257
  });
@@ -24,6 +24,8 @@ export interface RegisterData {
24
24
  email: string;
25
25
  /** Password */
26
26
  password: string;
27
+ /** Password confirmation */
28
+ confirmPassword?: string;
27
29
  /** Full name */
28
30
  name?: string;
29
31
  /** Additional user data */
@@ -91,9 +93,9 @@ export interface User {
91
93
  */
92
94
  export interface AuthActions {
93
95
  /** Login with email/password */
94
- login: (credentials: LoginCredentials) => Promise<void>;
96
+ login: (credentials: LoginCredentials) => Promise<User>;
95
97
  /** Register new account */
96
- register: (data: RegisterData) => Promise<void>;
98
+ register: (data: RegisterData) => Promise<User>;
97
99
  /** Logout current user */
98
100
  logout: () => Promise<void>;
99
101
  /** Send password reset email */
@@ -103,7 +105,7 @@ export interface AuthActions {
103
105
  /** Update user profile */
104
106
  updateProfile: (data: Partial<User>) => Promise<void>;
105
107
  /** Refresh authentication session */
106
- refresh: () => Promise<void>;
108
+ refresh: () => Promise<User | null>;
107
109
  }
108
110
 
109
111
  /**
@@ -195,7 +195,7 @@ export function isEmailVerified(user: User | null): boolean {
195
195
  * @returns Formatted date string or empty string
196
196
  */
197
197
  export function formatUserCreatedAt(user: User | null, locale: string = "en-US"): string {
198
- if (!user.createdAt) return "";
198
+ if (!user || !user.createdAt) return "";
199
199
  return new Date(user.createdAt).toLocaleDateString(locale, {
200
200
  year: "numeric",
201
201
  month: "long",
@@ -135,6 +135,7 @@ export function getStatusColor(status: SubscriptionStatus): string {
135
135
  canceled: "text-gray-600 dark:text-gray-500",
136
136
  unpaid: "text-red-600 dark:text-red-500",
137
137
  incomplete: "text-yellow-600 dark:text-yellow-500",
138
+ revoked: "text-purple-600 dark:text-purple-500",
138
139
  };
139
140
 
140
141
  return colorMap[status] || "text-gray-600";
@@ -154,6 +155,7 @@ export function getStatusLabel(status: SubscriptionStatus): string {
154
155
  canceled: "Canceled",
155
156
  unpaid: "Unpaid",
156
157
  incomplete: "Incomplete",
158
+ revoked: "Revoked",
157
159
  };
158
160
 
159
161
  return labelMap[status] || status;