@omnikit-js/ui 0.4.5 → 0.4.6
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": "@omnikit-js/ui",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.6",
|
|
4
4
|
"description": "A SaaS billing component for Next.js with Stripe integration",
|
|
5
5
|
"main": "src/index.ts",
|
|
6
6
|
"module": "src/index.ts",
|
|
@@ -10,16 +10,13 @@
|
|
|
10
10
|
"types": "./src/index.ts",
|
|
11
11
|
"import": "./src/index.ts",
|
|
12
12
|
"require": "./src/index.ts"
|
|
13
|
-
}
|
|
14
|
-
"./styles.css": "./dist/styles.css"
|
|
13
|
+
}
|
|
15
14
|
},
|
|
16
15
|
"files": [
|
|
17
|
-
"src"
|
|
18
|
-
"dist/styles.css"
|
|
16
|
+
"src"
|
|
19
17
|
],
|
|
20
18
|
"scripts": {
|
|
21
|
-
"build": "rollup -c
|
|
22
|
-
"build:css": "postcss src/styles/globals.css -o dist/styles.css",
|
|
19
|
+
"build": "rollup -c",
|
|
23
20
|
"dev": "rollup -c -w",
|
|
24
21
|
"test": "echo \"Error: no test specified\" && exit 1",
|
|
25
22
|
"prepublishOnly": "npm run build"
|
|
@@ -156,10 +156,10 @@ export default function BillingClient({ customerData, pricingData, paymentMethod
|
|
|
156
156
|
const formatFeatureValue = (value: any) => {
|
|
157
157
|
// Handle string boolean values
|
|
158
158
|
if (value === 'true' || value === true) {
|
|
159
|
-
return <span className="
|
|
159
|
+
return <span className="text-green-500 font-semibold">✓</span>
|
|
160
160
|
}
|
|
161
161
|
if (value === 'false' || value === false) {
|
|
162
|
-
return <span className="
|
|
162
|
+
return <span className="text-red-500 font-semibold">✗</span>
|
|
163
163
|
}
|
|
164
164
|
// Handle numeric values (both string and number)
|
|
165
165
|
const numValue = typeof value === 'string' ? parseFloat(value) : value
|
|
@@ -440,15 +440,15 @@ export default function BillingClient({ customerData, pricingData, paymentMethod
|
|
|
440
440
|
|
|
441
441
|
const getStatusIcon = (percent: number, withinLimit: boolean) => {
|
|
442
442
|
if (!withinLimit || percent >= 90) {
|
|
443
|
-
return <AlertCircle className="h-4 w-4
|
|
443
|
+
return <AlertCircle className="h-4 w-4 text-red-500" />;
|
|
444
444
|
}
|
|
445
445
|
if (percent >= 75) {
|
|
446
|
-
return <AlertTriangle className="h-4 w-4
|
|
446
|
+
return <AlertTriangle className="h-4 w-4 text-orange-500" />;
|
|
447
447
|
}
|
|
448
448
|
if (percent >= 50) {
|
|
449
|
-
return <Info className="h-4 w-4
|
|
449
|
+
return <Info className="h-4 w-4 text-yellow-500" />;
|
|
450
450
|
}
|
|
451
|
-
return <CheckCircle className="h-4 w-4
|
|
451
|
+
return <CheckCircle className="h-4 w-4 text-green-500" />;
|
|
452
452
|
};
|
|
453
453
|
|
|
454
454
|
return (
|
|
@@ -532,11 +532,11 @@ export default function BillingClient({ customerData, pricingData, paymentMethod
|
|
|
532
532
|
<CardContent className="text-center pb-4 flex-1">
|
|
533
533
|
<div className="mb-4">
|
|
534
534
|
<div className="flex items-baseline justify-center">
|
|
535
|
-
<span className="
|
|
535
|
+
<span className="text-3xl font-bold">
|
|
536
536
|
{parseFloat(price?.unit_amount) === 0 ? 'Free' : `$${parseFloat(price?.unit_amount).toFixed(2).replace(/\.00$/, '')}`}
|
|
537
537
|
</span>
|
|
538
538
|
{parseFloat(price?.unit_amount) > 0 && (
|
|
539
|
-
<span className="
|
|
539
|
+
<span className="text-sm text-muted-foreground font-normal ml-1">/month</span>
|
|
540
540
|
)}
|
|
541
541
|
</div>
|
|
542
542
|
{isCurrentPlan ? (
|
|
@@ -548,13 +548,13 @@ export default function BillingClient({ customerData, pricingData, paymentMethod
|
|
|
548
548
|
<div className="space-y-3 flex-1 flex flex-col justify-between min-h-[300px]">
|
|
549
549
|
{features.map((feature: any) => (
|
|
550
550
|
<div key={feature.id} className="border-t pt-3 first:border-t-0 first:pt-0 flex-1 flex flex-col justify-center">
|
|
551
|
-
<div className="
|
|
552
|
-
{formatFeatureValue(feature.value)} <span className="
|
|
551
|
+
<div className="text-lg font-semibold text-foreground">
|
|
552
|
+
{formatFeatureValue(feature.value)} <span className="text-sm text-muted-foreground font-normal">{feature.units}</span>
|
|
553
553
|
</div>
|
|
554
554
|
<TooltipProvider>
|
|
555
555
|
<Tooltip>
|
|
556
556
|
<TooltipTrigger asChild>
|
|
557
|
-
<div className="
|
|
557
|
+
<div className="text-xs text-muted-foreground mt-1 cursor-help">
|
|
558
558
|
{feature.name || feature.description}
|
|
559
559
|
</div>
|
|
560
560
|
</TooltipTrigger>
|
|
@@ -49,10 +49,10 @@ export default function SubscriptionConfirmModal({
|
|
|
49
49
|
const formatFeatureValue = (value: any) => {
|
|
50
50
|
// Handle string boolean values
|
|
51
51
|
if (value === 'true' || value === true) {
|
|
52
|
-
return <span className="
|
|
52
|
+
return <span className="text-green-500 font-semibold">✓</span>
|
|
53
53
|
}
|
|
54
54
|
if (value === 'false' || value === false) {
|
|
55
|
-
return <span className="
|
|
55
|
+
return <span className="text-red-500 font-semibold">✗</span>
|
|
56
56
|
}
|
|
57
57
|
// Handle numeric values (both string and number)
|
|
58
58
|
const numValue = typeof value === 'string' ? parseFloat(value) : value
|
|
@@ -129,9 +129,9 @@ export default function SubscriptionConfirmModal({
|
|
|
129
129
|
<div className="space-y-4">
|
|
130
130
|
<Card className="p-4">
|
|
131
131
|
<h4 className="font-medium mb-2">{plan.name}</h4>
|
|
132
|
-
<p className="text-
|
|
132
|
+
<p className="text-3xl font-bold mb-2">
|
|
133
133
|
{isFree ? 'Free' : formatCurrency(parseFloat(price.unit_amount) * 100)}
|
|
134
|
-
{!isFree && <span className="text-sm font-normal text-muted-foreground">/month</span>}
|
|
134
|
+
{!isFree && <span className="text-sm font-normal text-muted-foreground ml-1">/month</span>}
|
|
135
135
|
</p>
|
|
136
136
|
<ul className="space-y-1">
|
|
137
137
|
{plan.features?.map((feature: any) => (
|
|
@@ -140,8 +140,8 @@ export default function SubscriptionConfirmModal({
|
|
|
140
140
|
<TooltipProvider>
|
|
141
141
|
<Tooltip>
|
|
142
142
|
<TooltipTrigger asChild>
|
|
143
|
-
<span className="cursor-help">
|
|
144
|
-
{formatFeatureValue(feature.value)} <span className="text-sm text-muted-foreground font-normal">{feature.units}</span> - {feature.name || feature.description}
|
|
143
|
+
<span className="cursor-help text-foreground">
|
|
144
|
+
<span className="font-semibold">{formatFeatureValue(feature.value)}</span> <span className="text-sm text-muted-foreground font-normal">{feature.units}</span> - {feature.name || feature.description}
|
|
145
145
|
</span>
|
|
146
146
|
</TooltipTrigger>
|
|
147
147
|
<TooltipContent>
|
package/src/styles/globals.css
CHANGED
|
@@ -19,8 +19,8 @@ span.omnikit-price-text {
|
|
|
19
19
|
|
|
20
20
|
/* Feature value styles */
|
|
21
21
|
div.omnikit-feature-value {
|
|
22
|
-
font-size:
|
|
23
|
-
line-height: 1.
|
|
22
|
+
font-size: 1rem !important;
|
|
23
|
+
line-height: 1.5rem !important;
|
|
24
24
|
font-weight: 600 !important;
|
|
25
25
|
color: #111827 !important;
|
|
26
26
|
display: block !important;
|
|
@@ -43,12 +43,12 @@ div.omnikit-feature-value {
|
|
|
43
43
|
/* Boolean feature icons */
|
|
44
44
|
div.omnikit-feature-value span.omnikit-boolean-true {
|
|
45
45
|
color: #22c55e !important;
|
|
46
|
-
font-size:
|
|
46
|
+
font-size: 1rem !important;
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
div.omnikit-feature-value span.omnikit-boolean-false {
|
|
50
50
|
color: #ef4444 !important;
|
|
51
|
-
font-size:
|
|
51
|
+
font-size: 1rem !important;
|
|
52
52
|
}
|
|
53
53
|
|
|
54
54
|
/* Progress bar specific styles */
|
package/dist/styles.css
DELETED
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
/* Essential component-specific styles only */
|
|
2
|
-
|
|
3
|
-
/* Pricing text styles */
|
|
4
|
-
span.omnikit-price-text {
|
|
5
|
-
font-size: 2rem !important;
|
|
6
|
-
line-height: 1 !important;
|
|
7
|
-
font-weight: 700 !important;
|
|
8
|
-
letter-spacing: -0.025em !important;
|
|
9
|
-
display: inline-block !important;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
.omnikit-price-units {
|
|
13
|
-
font-size: 0.875rem;
|
|
14
|
-
line-height: 1.25rem;
|
|
15
|
-
color: #6b7280;
|
|
16
|
-
font-weight: 400;
|
|
17
|
-
margin-left: 0.25rem;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
/* Feature value styles */
|
|
21
|
-
div.omnikit-feature-value {
|
|
22
|
-
font-size: 1.125rem !important;
|
|
23
|
-
line-height: 1.75rem !important;
|
|
24
|
-
font-weight: 600 !important;
|
|
25
|
-
color: #111827 !important;
|
|
26
|
-
display: block !important;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
.omnikit-feature-units {
|
|
30
|
-
font-size: 0.875rem;
|
|
31
|
-
color: #6b7280;
|
|
32
|
-
font-weight: 400;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
.omnikit-feature-name {
|
|
36
|
-
font-size: 0.75rem;
|
|
37
|
-
line-height: 1rem;
|
|
38
|
-
color: #6b7280;
|
|
39
|
-
margin-top: 0.25rem;
|
|
40
|
-
cursor: help;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
/* Boolean feature icons */
|
|
44
|
-
div.omnikit-feature-value span.omnikit-boolean-true {
|
|
45
|
-
color: #22c55e !important;
|
|
46
|
-
font-size: 1.125rem !important;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
div.omnikit-feature-value span.omnikit-boolean-false {
|
|
50
|
-
color: #ef4444 !important;
|
|
51
|
-
font-size: 1.125rem !important;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
/* Progress bar specific styles */
|
|
55
|
-
.omnikit-progress-fill-red { background-color: #ef4444; }
|
|
56
|
-
.omnikit-progress-fill-orange { background-color: #f97316; }
|
|
57
|
-
.omnikit-progress-fill-yellow { background-color: #eab308; }
|
|
58
|
-
.omnikit-progress-fill-green { background-color: #22c55e; }
|
|
59
|
-
|
|
60
|
-
/* Usage status colors that might not be in standard Tailwind */
|
|
61
|
-
.omnikit-usage-red { color: #dc2626; }
|
|
62
|
-
.omnikit-usage-orange { color: #ea580c; }
|
|
63
|
-
.omnikit-usage-yellow { color: #d97706; }
|
|
64
|
-
.omnikit-usage-green { color: #16a34a; }
|
|
65
|
-
|
|
66
|
-
/* Background colors for usage indicators */
|
|
67
|
-
.omnikit-bg-red-100 { background-color: #fee2e2; }
|
|
68
|
-
.omnikit-bg-orange-100 { background-color: #ffedd5; }
|
|
69
|
-
.omnikit-bg-yellow-100 { background-color: #fef3c7; }
|
|
70
|
-
.omnikit-bg-green-100 { background-color: #dcfce7; }
|
|
71
|
-
|
|
72
|
-
/* Dark mode variants */
|
|
73
|
-
@media (prefers-color-scheme: dark) {
|
|
74
|
-
.omnikit-usage-red { color: #f87171; }
|
|
75
|
-
.omnikit-usage-orange { color: #fb923c; }
|
|
76
|
-
.omnikit-usage-yellow { color: #facc15; }
|
|
77
|
-
.omnikit-usage-green { color: #4ade80; }
|
|
78
|
-
|
|
79
|
-
.omnikit-bg-red-100 { background-color: #450a0a; }
|
|
80
|
-
.omnikit-bg-orange-100 { background-color: #431407; }
|
|
81
|
-
.omnikit-bg-yellow-100 { background-color: #451a03; }
|
|
82
|
-
.omnikit-bg-green-100 { background-color: #14532d; }
|
|
83
|
-
|
|
84
|
-
.omnikit-feature-value { color: #ffffff; }
|
|
85
|
-
.omnikit-feature-units { color: #9ca3af; }
|
|
86
|
-
.omnikit-feature-name { color: #9ca3af; }
|
|
87
|
-
.omnikit-price-units { color: #9ca3af; }
|
|
88
|
-
|
|
89
|
-
.omnikit-feature-value .omnikit-boolean-true { color: #4ade80; }
|
|
90
|
-
.omnikit-feature-value .omnikit-boolean-false { color: #f87171; }
|
|
91
|
-
}
|