@omnikit-js/ui 0.4.0 → 0.4.4
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/README.md
CHANGED
|
@@ -37,7 +37,7 @@ module.exports = {
|
|
|
37
37
|
|
|
38
38
|
2. Import the component-specific styles:
|
|
39
39
|
```tsx
|
|
40
|
-
import '@omnikit-js/ui/
|
|
40
|
+
import '@omnikit-js/ui/styles.css';
|
|
41
41
|
```
|
|
42
42
|
|
|
43
43
|
**That's it!** The component will use your existing Tailwind configuration plus essential component-specific styles.
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
/* Pricing text styles */
|
|
4
4
|
.omnikit-price-text {
|
|
5
|
-
font-size:
|
|
6
|
-
line-height:
|
|
5
|
+
font-size: 2rem;
|
|
6
|
+
line-height: 1;
|
|
7
7
|
font-weight: 700;
|
|
8
8
|
letter-spacing: -0.025em;
|
|
9
9
|
}
|
|
@@ -38,6 +38,15 @@
|
|
|
38
38
|
cursor: help;
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
+
/* Boolean feature icons */
|
|
42
|
+
.omnikit-feature-value .omnikit-boolean-true {
|
|
43
|
+
color: #22c55e;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.omnikit-feature-value .omnikit-boolean-false {
|
|
47
|
+
color: #ef4444;
|
|
48
|
+
}
|
|
49
|
+
|
|
41
50
|
/* Progress bar specific styles */
|
|
42
51
|
.omnikit-progress-fill-red { background-color: #ef4444; }
|
|
43
52
|
.omnikit-progress-fill-orange { background-color: #f97316; }
|
|
@@ -72,4 +81,7 @@
|
|
|
72
81
|
.omnikit-feature-units { color: #9ca3af; }
|
|
73
82
|
.omnikit-feature-name { color: #9ca3af; }
|
|
74
83
|
.omnikit-price-units { color: #9ca3af; }
|
|
84
|
+
|
|
85
|
+
.omnikit-feature-value .omnikit-boolean-true { color: #4ade80; }
|
|
86
|
+
.omnikit-feature-value .omnikit-boolean-false { color: #f87171; }
|
|
75
87
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@omnikit-js/ui",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.4",
|
|
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",
|
|
@@ -11,14 +11,15 @@
|
|
|
11
11
|
"import": "./src/index.ts",
|
|
12
12
|
"require": "./src/index.ts"
|
|
13
13
|
},
|
|
14
|
-
"./
|
|
14
|
+
"./styles.css": "./dist/styles.css"
|
|
15
15
|
},
|
|
16
16
|
"files": [
|
|
17
17
|
"src",
|
|
18
|
-
"
|
|
18
|
+
"dist/styles.css"
|
|
19
19
|
],
|
|
20
20
|
"scripts": {
|
|
21
|
-
"build": "rollup -c",
|
|
21
|
+
"build": "rollup -c && npm run build:css",
|
|
22
|
+
"build:css": "postcss src/styles/globals.css -o dist/styles.css",
|
|
22
23
|
"dev": "rollup -c -w",
|
|
23
24
|
"test": "echo \"Error: no test specified\" && exit 1",
|
|
24
25
|
"prepublishOnly": "npm run build"
|
|
@@ -78,6 +79,7 @@
|
|
|
78
79
|
"@types/react-dom": "^18.3.0",
|
|
79
80
|
"autoprefixer": "^10.4.19",
|
|
80
81
|
"postcss": "^8.4.38",
|
|
82
|
+
"postcss-cli": "^11.0.1",
|
|
81
83
|
"react": "^18.3.1",
|
|
82
84
|
"react-dom": "^18.3.1",
|
|
83
85
|
"rollup": "^4.17.2",
|
|
@@ -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
|
|
159
|
+
return <span className="omnikit-boolean-true">✓</span>
|
|
160
160
|
}
|
|
161
161
|
if (value === 'false' || value === false) {
|
|
162
|
-
return
|
|
162
|
+
return <span className="omnikit-boolean-false">✗</span>
|
|
163
163
|
}
|
|
164
164
|
// Handle numeric values (both string and number)
|
|
165
165
|
const numValue = typeof value === 'string' ? parseFloat(value) : value
|
|
@@ -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
|
|
52
|
+
return <span className="omnikit-boolean-true">✓</span>
|
|
53
53
|
}
|
|
54
54
|
if (value === 'false' || value === false) {
|
|
55
|
-
return
|
|
55
|
+
return <span className="omnikit-boolean-false">✗</span>
|
|
56
56
|
}
|
|
57
57
|
// Handle numeric values (both string and number)
|
|
58
58
|
const numValue = typeof value === 'string' ? parseFloat(value) : value
|
package/src/styles/globals.css
CHANGED
|
@@ -1,3 +1,87 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
/* Essential component-specific styles only */
|
|
2
|
+
|
|
3
|
+
/* Pricing text styles */
|
|
4
|
+
.omnikit-price-text {
|
|
5
|
+
font-size: 2rem;
|
|
6
|
+
line-height: 1;
|
|
7
|
+
font-weight: 700;
|
|
8
|
+
letter-spacing: -0.025em;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.omnikit-price-units {
|
|
12
|
+
font-size: 0.875rem;
|
|
13
|
+
line-height: 1.25rem;
|
|
14
|
+
color: #6b7280;
|
|
15
|
+
font-weight: 400;
|
|
16
|
+
margin-left: 0.25rem;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/* Feature value styles */
|
|
20
|
+
.omnikit-feature-value {
|
|
21
|
+
font-size: 1.125rem;
|
|
22
|
+
line-height: 1.75rem;
|
|
23
|
+
font-weight: 600;
|
|
24
|
+
color: #111827;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.omnikit-feature-units {
|
|
28
|
+
font-size: 0.875rem;
|
|
29
|
+
color: #6b7280;
|
|
30
|
+
font-weight: 400;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.omnikit-feature-name {
|
|
34
|
+
font-size: 0.75rem;
|
|
35
|
+
line-height: 1rem;
|
|
36
|
+
color: #6b7280;
|
|
37
|
+
margin-top: 0.25rem;
|
|
38
|
+
cursor: help;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/* Boolean feature icons */
|
|
42
|
+
.omnikit-feature-value .omnikit-boolean-true {
|
|
43
|
+
color: #22c55e;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.omnikit-feature-value .omnikit-boolean-false {
|
|
47
|
+
color: #ef4444;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/* Progress bar specific styles */
|
|
51
|
+
.omnikit-progress-fill-red { background-color: #ef4444; }
|
|
52
|
+
.omnikit-progress-fill-orange { background-color: #f97316; }
|
|
53
|
+
.omnikit-progress-fill-yellow { background-color: #eab308; }
|
|
54
|
+
.omnikit-progress-fill-green { background-color: #22c55e; }
|
|
55
|
+
|
|
56
|
+
/* Usage status colors that might not be in standard Tailwind */
|
|
57
|
+
.omnikit-usage-red { color: #dc2626; }
|
|
58
|
+
.omnikit-usage-orange { color: #ea580c; }
|
|
59
|
+
.omnikit-usage-yellow { color: #d97706; }
|
|
60
|
+
.omnikit-usage-green { color: #16a34a; }
|
|
61
|
+
|
|
62
|
+
/* Background colors for usage indicators */
|
|
63
|
+
.omnikit-bg-red-100 { background-color: #fee2e2; }
|
|
64
|
+
.omnikit-bg-orange-100 { background-color: #ffedd5; }
|
|
65
|
+
.omnikit-bg-yellow-100 { background-color: #fef3c7; }
|
|
66
|
+
.omnikit-bg-green-100 { background-color: #dcfce7; }
|
|
67
|
+
|
|
68
|
+
/* Dark mode variants */
|
|
69
|
+
@media (prefers-color-scheme: dark) {
|
|
70
|
+
.omnikit-usage-red { color: #f87171; }
|
|
71
|
+
.omnikit-usage-orange { color: #fb923c; }
|
|
72
|
+
.omnikit-usage-yellow { color: #facc15; }
|
|
73
|
+
.omnikit-usage-green { color: #4ade80; }
|
|
74
|
+
|
|
75
|
+
.omnikit-bg-red-100 { background-color: #450a0a; }
|
|
76
|
+
.omnikit-bg-orange-100 { background-color: #431407; }
|
|
77
|
+
.omnikit-bg-yellow-100 { background-color: #451a03; }
|
|
78
|
+
.omnikit-bg-green-100 { background-color: #14532d; }
|
|
79
|
+
|
|
80
|
+
.omnikit-feature-value { color: #ffffff; }
|
|
81
|
+
.omnikit-feature-units { color: #9ca3af; }
|
|
82
|
+
.omnikit-feature-name { color: #9ca3af; }
|
|
83
|
+
.omnikit-price-units { color: #9ca3af; }
|
|
84
|
+
|
|
85
|
+
.omnikit-feature-value .omnikit-boolean-true { color: #4ade80; }
|
|
86
|
+
.omnikit-feature-value .omnikit-boolean-false { color: #f87171; }
|
|
87
|
+
}
|