@omnikit-js/ui 0.3.9 → 0.4.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/README.md CHANGED
@@ -21,8 +21,7 @@ npm install @omnikit-js/ui
21
21
 
22
22
  ### Setup
23
23
 
24
- Since your app already uses Tailwind CSS, just add our component to your `tailwind.config.js`:
25
-
24
+ 1. Add our component to your `tailwind.config.js`:
26
25
  ```js
27
26
  module.exports = {
28
27
  content: [
@@ -36,7 +35,12 @@ module.exports = {
36
35
  }
37
36
  ```
38
37
 
39
- **That's it!** No CSS imports needed. The component will use your existing Tailwind configuration.
38
+ 2. Import the component-specific styles:
39
+ ```tsx
40
+ import '@omnikit-js/ui/component.css';
41
+ ```
42
+
43
+ **That's it!** The component will use your existing Tailwind configuration plus essential component-specific styles.
40
44
 
41
45
  ## Prerequisites
42
46
 
package/component.css ADDED
@@ -0,0 +1,75 @@
1
+ /* Essential component-specific styles only */
2
+
3
+ /* Pricing text styles */
4
+ .omnikit-price-text {
5
+ font-size: 1.875rem;
6
+ line-height: 2.25rem;
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
+ /* Progress bar specific styles */
42
+ .omnikit-progress-fill-red { background-color: #ef4444; }
43
+ .omnikit-progress-fill-orange { background-color: #f97316; }
44
+ .omnikit-progress-fill-yellow { background-color: #eab308; }
45
+ .omnikit-progress-fill-green { background-color: #22c55e; }
46
+
47
+ /* Usage status colors that might not be in standard Tailwind */
48
+ .omnikit-usage-red { color: #dc2626; }
49
+ .omnikit-usage-orange { color: #ea580c; }
50
+ .omnikit-usage-yellow { color: #d97706; }
51
+ .omnikit-usage-green { color: #16a34a; }
52
+
53
+ /* Background colors for usage indicators */
54
+ .omnikit-bg-red-100 { background-color: #fee2e2; }
55
+ .omnikit-bg-orange-100 { background-color: #ffedd5; }
56
+ .omnikit-bg-yellow-100 { background-color: #fef3c7; }
57
+ .omnikit-bg-green-100 { background-color: #dcfce7; }
58
+
59
+ /* Dark mode variants */
60
+ @media (prefers-color-scheme: dark) {
61
+ .omnikit-usage-red { color: #f87171; }
62
+ .omnikit-usage-orange { color: #fb923c; }
63
+ .omnikit-usage-yellow { color: #facc15; }
64
+ .omnikit-usage-green { color: #4ade80; }
65
+
66
+ .omnikit-bg-red-100 { background-color: #450a0a; }
67
+ .omnikit-bg-orange-100 { background-color: #431407; }
68
+ .omnikit-bg-yellow-100 { background-color: #451a03; }
69
+ .omnikit-bg-green-100 { background-color: #14532d; }
70
+
71
+ .omnikit-feature-value { color: #ffffff; }
72
+ .omnikit-feature-units { color: #9ca3af; }
73
+ .omnikit-feature-name { color: #9ca3af; }
74
+ .omnikit-price-units { color: #9ca3af; }
75
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@omnikit-js/ui",
3
- "version": "0.3.9",
3
+ "version": "0.4.0",
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,10 +10,12 @@
10
10
  "types": "./src/index.ts",
11
11
  "import": "./src/index.ts",
12
12
  "require": "./src/index.ts"
13
- }
13
+ },
14
+ "./component.css": "./component.css"
14
15
  },
15
16
  "files": [
16
- "src"
17
+ "src",
18
+ "component.css"
17
19
  ],
18
20
  "scripts": {
19
21
  "build": "rollup -c",
@@ -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 text-red-600 dark:text-red-400" />;
443
+ return <AlertCircle className="h-4 w-4 omnikit-usage-red" />;
444
444
  }
445
445
  if (percent >= 75) {
446
- return <AlertTriangle className="h-4 w-4 text-orange-600 dark:text-orange-400" />;
446
+ return <AlertTriangle className="h-4 w-4 omnikit-usage-orange" />;
447
447
  }
448
448
  if (percent >= 50) {
449
- return <Info className="h-4 w-4 text-yellow-600 dark:text-yellow-400" />;
449
+ return <Info className="h-4 w-4 omnikit-usage-yellow" />;
450
450
  }
451
- return <CheckCircle className="h-4 w-4 text-green-600 dark:text-green-400" />;
451
+ return <CheckCircle className="h-4 w-4 omnikit-usage-green" />;
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="text-3xl font-bold tracking-tight">
535
+ <span className="omnikit-price-text">
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="ml-1 text-sm text-muted-foreground">/month</span>
539
+ <span className="omnikit-price-units">/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="text-lg font-semibold text-foreground">
552
- {formatFeatureValue(feature.value)} <span className="text-sm text-gray-500 font-normal">{feature.units}</span>
551
+ <div className="omnikit-feature-value">
552
+ {formatFeatureValue(feature.value)} <span className="omnikit-feature-units">{feature.units}</span>
553
553
  </div>
554
554
  <TooltipProvider>
555
555
  <Tooltip>
556
556
  <TooltipTrigger asChild>
557
- <div className="text-xs text-gray-500 mt-1 cursor-help">
557
+ <div className="omnikit-feature-name">
558
558
  {feature.name || feature.description}
559
559
  </div>
560
560
  </TooltipTrigger>