@umituz/web-dashboard 2.4.0 → 2.5.0
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
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Billing Constants
|
|
3
|
+
*
|
|
4
|
+
* Centralized constants for billing domain to avoid hardcoded strings
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Subscription status constants
|
|
9
|
+
*/
|
|
10
|
+
export const SUBSCRIPTION_STATUS = {
|
|
11
|
+
ACTIVE: "active",
|
|
12
|
+
TRIALING: "trialing",
|
|
13
|
+
PAST_DUE: "past_due",
|
|
14
|
+
CANCELED: "canceled",
|
|
15
|
+
UNPAID: "unpaid",
|
|
16
|
+
INCOMPLETE: "incomplete",
|
|
17
|
+
REVOKED: "revoked",
|
|
18
|
+
} as const;
|
|
19
|
+
|
|
20
|
+
export type SubscriptionStatus = typeof SUBSCRIPTION_STATUS[keyof typeof SUBSCRIPTION_STATUS];
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Invoice status constants
|
|
24
|
+
*/
|
|
25
|
+
export const INVOICE_STATUS = {
|
|
26
|
+
DRAFT: "draft",
|
|
27
|
+
OPEN: "open",
|
|
28
|
+
PAID: "paid",
|
|
29
|
+
VOID: "void",
|
|
30
|
+
UNCOLLECTIBLE: "uncollectible",
|
|
31
|
+
REFUNDED: "refunded",
|
|
32
|
+
} as const;
|
|
33
|
+
|
|
34
|
+
export type InvoiceStatus = typeof INVOICE_STATUS[keyof typeof INVOICE_STATUS];
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Billing cycle constants
|
|
38
|
+
*/
|
|
39
|
+
export const BILLING_CYCLE = {
|
|
40
|
+
MONTHLY: "monthly",
|
|
41
|
+
YEARLY: "yearly",
|
|
42
|
+
} as const;
|
|
43
|
+
|
|
44
|
+
export type BillingCycle = typeof BILLING_CYCLE[keyof typeof BILLING_CYCLE];
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Currency constants
|
|
48
|
+
*/
|
|
49
|
+
export const CURRENCY = {
|
|
50
|
+
USD: "USD",
|
|
51
|
+
EUR: "EUR",
|
|
52
|
+
GBP: "GBP",
|
|
53
|
+
TRY: "TRY",
|
|
54
|
+
JPY: "JPY",
|
|
55
|
+
} as const;
|
|
56
|
+
|
|
57
|
+
export type Currency = typeof CURRENCY[keyof typeof CURRENCY];
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Plan type constants
|
|
61
|
+
*/
|
|
62
|
+
export const PLAN_TYPE = {
|
|
63
|
+
STANDARD: "standard",
|
|
64
|
+
PRO: "pro",
|
|
65
|
+
BUSINESS: "business",
|
|
66
|
+
ENTERPRISE: "enterprise",
|
|
67
|
+
} as const;
|
|
68
|
+
|
|
69
|
+
export type PlanType = typeof PLAN_TYPE[keyof typeof PLAN_TYPE];
|
|
@@ -5,22 +5,22 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import type { ComponentType, ReactElement } from "react";
|
|
8
|
+
import { SUBSCRIPTION_STATUS, INVOICE_STATUS, BILLING_CYCLE, CURRENCY } from "../constants/billing";
|
|
8
9
|
|
|
9
10
|
/**
|
|
10
11
|
* Billing cycle
|
|
11
12
|
*/
|
|
12
|
-
export type BillingCycle =
|
|
13
|
+
export type BillingCycle = typeof BILLING_CYCLE[keyof typeof BILLING_CYCLE];
|
|
13
14
|
|
|
14
15
|
/**
|
|
15
16
|
* Subscription status
|
|
16
17
|
*/
|
|
17
|
-
export type SubscriptionStatus =
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
| "incomplete";
|
|
18
|
+
export type SubscriptionStatus = typeof SUBSCRIPTION_STATUS[keyof typeof SUBSCRIPTION_STATUS];
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Invoice status
|
|
22
|
+
*/
|
|
23
|
+
export type InvoiceStatus = typeof INVOICE_STATUS[keyof typeof INVOICE_STATUS];
|
|
24
24
|
|
|
25
25
|
/**
|
|
26
26
|
* Plan type
|
|
@@ -30,7 +30,7 @@ export type PlanType = "free" | "basic" | "pro" | "enterprise" | "custom";
|
|
|
30
30
|
/**
|
|
31
31
|
* Currency
|
|
32
32
|
*/
|
|
33
|
-
export type Currency =
|
|
33
|
+
export type Currency = typeof CURRENCY[keyof typeof CURRENCY];
|
|
34
34
|
|
|
35
35
|
/**
|
|
36
36
|
* Plan pricing tier
|
|
@@ -133,11 +133,6 @@ export interface PaymentMethod {
|
|
|
133
133
|
createdAt: string;
|
|
134
134
|
}
|
|
135
135
|
|
|
136
|
-
/**
|
|
137
|
-
* Invoice status
|
|
138
|
-
*/
|
|
139
|
-
export type InvoiceStatus = "draft" | "open" | "paid" | "void" | "uncollectible";
|
|
140
|
-
|
|
141
136
|
/**
|
|
142
137
|
* Invoice item
|
|
143
138
|
*/
|
|
@@ -97,16 +97,18 @@ export const DashboardSidebar = ({
|
|
|
97
97
|
{!collapsed && (
|
|
98
98
|
<button
|
|
99
99
|
onClick={() => toggleGroup(group.title)}
|
|
100
|
-
className="w-full flex items-center justify-between px-3
|
|
100
|
+
className="w-full flex items-center justify-between px-3 py-2 mb-1 rounded-lg hover:bg-sidebar-accent/30 transition-all duration-200 group/header"
|
|
101
101
|
>
|
|
102
102
|
<span className="text-[10px] font-bold uppercase tracking-widest text-sidebar-foreground/40 group-hover/header:text-sidebar-foreground/70 transition-colors">
|
|
103
103
|
{group.title === "sidebar.ai" ? `${brandName} AI` : t(group.title)}
|
|
104
104
|
</span>
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
105
|
+
<div className="flex-shrink-0">
|
|
106
|
+
{isGroupCollapsed ? (
|
|
107
|
+
<ChevronRight className="h-3.5 w-3.5 text-sidebar-foreground/30 transition-transform duration-200 group-hover/header:text-sidebar-foreground/50" />
|
|
108
|
+
) : (
|
|
109
|
+
<ChevronDown className="h-3.5 w-3.5 text-sidebar-foreground/30 transition-transform duration-200 group-hover/header:text-sidebar-foreground/50" />
|
|
110
|
+
)}
|
|
111
|
+
</div>
|
|
110
112
|
</button>
|
|
111
113
|
)}
|
|
112
114
|
|
|
@@ -116,14 +118,14 @@ export const DashboardSidebar = ({
|
|
|
116
118
|
<Link
|
|
117
119
|
key={item.path}
|
|
118
120
|
to={item.path}
|
|
119
|
-
className={`flex items-center gap-3 rounded-lg px-3 py-2 text-sm font-medium transition-all duration-200 ${
|
|
121
|
+
className={`flex items-center gap-3 rounded-lg px-3 py-2.5 text-sm font-medium transition-all duration-200 ${
|
|
120
122
|
active
|
|
121
123
|
? "bg-sidebar-accent text-sidebar-accent-foreground shadow-sm"
|
|
122
124
|
: "text-sidebar-foreground/70 hover:bg-sidebar-accent/40 hover:text-sidebar-foreground"
|
|
123
125
|
} ${collapsed ? "justify-center" : ""}`}
|
|
124
126
|
title={collapsed ? t(item.label) : undefined}
|
|
125
127
|
>
|
|
126
|
-
<item.icon className={`h-4 w-4 shrink-0 transition-transform ${active && "scale-110"}`} />
|
|
128
|
+
<item.icon className={`h-4 w-4 shrink-0 transition-transform duration-200 ${active && "scale-110"}`} />
|
|
127
129
|
{!collapsed && <span>{t(item.label)}</span>}
|
|
128
130
|
</Link>
|
|
129
131
|
);
|