@moontra/moonui-pro 2.28.11 → 2.29.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/dist/index.mjs CHANGED
@@ -4,7 +4,7 @@ import { twMerge } from 'tailwind-merge';
4
4
  import * as t from 'react';
5
5
  import t__default, { useState, useMemo, useCallback, useRef, useEffect, forwardRef, createContext, useContext, useLayoutEffect, useDebugValue, Component } from 'react';
6
6
  import * as AccordionPrimitive2 from '@radix-ui/react-accordion';
7
- import { Loader2, Play, ExternalLink, ChevronDown, Info, AlertCircle, AlertTriangle, Check, X, MoreHorizontal, Minus, Clock, ChevronUp, Search, Mic, MicOff, Settings, RefreshCw, Zap, ChevronRight, Crown, Circle, ChevronLeft, Plus, Lock, Sparkles, ZoomOut, ZoomIn, Pause, VolumeX, Volume2, Download, Maximize2, Filter, Image as Image$1, Video, RotateCw, Minimize2, BarChart3, Menu, Bell, CheckCheck, CheckCircle, Palette, User, Settings2, LogOut, Edit3, LayoutGrid, Upload, Share2, Save, Phone, Globe, Eye, CheckCircle2, RotateCcw, Copy, Share, Trash2, CreditCard, XCircle, HelpCircle, Bold as Bold$1, Italic as Italic$1, Underline as Underline$1, Strikethrough, AlignLeft, AlignCenter, AlignRight, AlignJustify, List, ListOrdered, Quote, Code as Code$1, Link as Link$1, Undo, Redo, Edit, GripVertical, Type, Heading1, Heading2, Heading3, CheckSquare, Highlighter, Link2, Table as Table$1, Wand2, Maximize, FileText, Briefcase, MessageSquare, Heart, GraduationCap, Languages, Lightbulb, MoreVertical, TrendingUp, Activity, BellOff, Target, ArrowUpRight, ArrowDownRight, CalendarIcon, MapPin, Navigation, ArrowUp, ArrowDown, ArrowUpDown, Calendar as Calendar$1, DollarSign, Users, Map as Map$1, Music, Archive, File, FileSpreadsheet, FileJson, FileDown, ChevronsLeft, ChevronsRight, Star, Shield, Award, Gem, Flame, TrendingDown, Repeat, Move, EyeOff, Timer, Square, Cpu, GitBranch, ArrowRight, Trash, MessageCircle, Paperclip, Printer, Grip, Unlock, Github, Server, Monitor, MemoryStick, HardDrive, Network, Columns, PlusCircle, Pin, Sun, Moon, Home, Send, Tag, Flag, Trophy, Wifi, WifiOff, Thermometer, GitFork, Package, PoundSterling, Euro, Database, ShoppingCart } from 'lucide-react';
7
+ import { Loader2, Play, ExternalLink, ChevronDown, Info, AlertCircle, AlertTriangle, Check, X, MoreHorizontal, Minus, Clock, ChevronUp, Search, Mic, MicOff, Settings, RefreshCw, Zap, ChevronRight, Crown, Circle, ChevronLeft, Plus, Lock, Sparkles, ZoomOut, ZoomIn, Pause, VolumeX, Volume2, Download, Maximize2, Filter, Image as Image$1, Video, RotateCw, Minimize2, BarChart3, Menu, Bell, CheckCheck, CheckCircle, Palette, User, Settings2, LogOut, Edit3, LayoutGrid, Upload, Share2, Save, Phone, Globe, Eye, CheckCircle2, RotateCcw, Copy, Share, Trash2, CreditCard, XCircle, HelpCircle, Bold as Bold$1, Italic as Italic$1, Underline as Underline$1, Strikethrough, AlignLeft, AlignCenter, AlignRight, AlignJustify, List, ListOrdered, Quote, Code as Code$1, Link as Link$1, Undo, Redo, Edit, GripVertical, Type, Heading1, Heading2, Heading3, CheckSquare, Highlighter, Link2, Table as Table$1, Wand2, Maximize, FileText, Briefcase, MessageSquare, Heart, GraduationCap, Languages, Lightbulb, MoreVertical, TrendingUp, Activity, BellOff, Target, ArrowUpRight, ArrowDownRight, CalendarIcon, MapPin, Navigation, ArrowUp, ArrowDown, ArrowUpDown, Calendar as Calendar$1, DollarSign, Users, Map as Map$1, Music, Archive, File, FileSpreadsheet, FileJson, FileDown, ChevronsLeft, ChevronsRight, Star, Shield, Award, Gem, Flame, TrendingDown, Repeat, Move, EyeOff, Timer, Square, Cpu, GitBranch, ArrowRight, Trash, MessageCircle, Paperclip, Printer, Grip, Unlock, Github, Server, Monitor, MemoryStick, HardDrive, Network, Columns, PlusCircle, Pin, Sun, Moon, Home, Send, Tag, Flag, Trophy, ShoppingBag, Wifi, WifiOff, Thermometer, GitFork, Package, PoundSterling, Euro, Database, ShoppingCart } from 'lucide-react';
8
8
  import { cva } from 'class-variance-authority';
9
9
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
10
10
  import * as AvatarPrimitive from '@radix-ui/react-avatar';
@@ -85695,6 +85695,7 @@ function WidgetBase({
85695
85695
  subtitle,
85696
85696
  children,
85697
85697
  variant = "default",
85698
+ backgroundVariant,
85698
85699
  colorScheme = "blue",
85699
85700
  className,
85700
85701
  headerAction,
@@ -85706,6 +85707,7 @@ function WidgetBase({
85706
85707
  gradientDirection = "to-br",
85707
85708
  overlay
85708
85709
  }) {
85710
+ const activeVariant = backgroundVariant || variant;
85709
85711
  const colorSchemeClasses = {
85710
85712
  blue: "from-blue-500/10 via-blue-500/5 to-transparent border-blue-500/20 dark:from-blue-400/10 dark:via-blue-400/5 dark:border-blue-400/20",
85711
85713
  green: "from-green-500/10 via-green-500/5 to-transparent border-green-500/20 dark:from-green-400/10 dark:via-green-400/5 dark:border-green-400/20",
@@ -85790,15 +85792,15 @@ function WidgetBase({
85790
85792
  MoonUICardPro,
85791
85793
  {
85792
85794
  className: cn(
85793
- variantClasses[variant],
85795
+ variantClasses[activeVariant],
85794
85796
  roundedClasses[rounded],
85795
85797
  shadowClasses[shadow],
85796
85798
  "transition-all duration-200 relative",
85797
85799
  className
85798
85800
  ),
85799
- style: variant === "gradient" || variant === "colored" ? gradientDirectionStyles[gradientDirection] : void 0,
85801
+ style: activeVariant === "gradient" || activeVariant === "colored" ? gradientDirectionStyles[gradientDirection] : void 0,
85800
85802
  children: [
85801
- (variant === "overlay" || overlay) && overlay?.pattern && overlay.pattern !== "none" && /* @__PURE__ */ jsx(
85803
+ (activeVariant === "overlay" || overlay) && overlay?.pattern && overlay.pattern !== "none" && /* @__PURE__ */ jsx(
85802
85804
  "div",
85803
85805
  {
85804
85806
  className: "absolute inset-0 pointer-events-none",
@@ -87323,6 +87325,87 @@ function RevenueWidget({
87323
87325
  ] })
87324
87326
  ] });
87325
87327
  };
87328
+ const renderMetrics = () => {
87329
+ if (!data.customerMetrics)
87330
+ return null;
87331
+ const metrics = [
87332
+ {
87333
+ label: "ARPU (Average Revenue Per User)",
87334
+ value: formatCurrency(data.customerMetrics.arpu || 0),
87335
+ icon: /* @__PURE__ */ jsx(Users, { className: "h-4 w-4" }),
87336
+ description: "Average revenue generated per user"
87337
+ },
87338
+ {
87339
+ label: "LTV (Lifetime Value)",
87340
+ value: formatCurrency(data.customerMetrics.ltv || 0),
87341
+ icon: /* @__PURE__ */ jsx(TrendingUp, { className: "h-4 w-4" }),
87342
+ description: "Expected revenue from customer over their lifetime"
87343
+ },
87344
+ {
87345
+ label: "CAC (Customer Acquisition Cost)",
87346
+ value: formatCurrency(data.customerMetrics.cac || 0),
87347
+ icon: /* @__PURE__ */ jsx(ShoppingBag, { className: "h-4 w-4" }),
87348
+ description: "Cost to acquire one new customer"
87349
+ },
87350
+ {
87351
+ label: "Churn Rate",
87352
+ value: `${formatNumber2(data.customerMetrics.churnRate || 0)}%`,
87353
+ icon: /* @__PURE__ */ jsx(TrendingDown, { className: "h-4 w-4" }),
87354
+ description: "Percentage of customers lost per period"
87355
+ },
87356
+ {
87357
+ label: "Retention Rate",
87358
+ value: `${formatNumber2(data.customerMetrics.retentionRate || 0)}%`,
87359
+ icon: /* @__PURE__ */ jsx(Repeat, { className: "h-4 w-4" }),
87360
+ description: "Percentage of customers retained"
87361
+ }
87362
+ ];
87363
+ const ltvCacRatio = (data.customerMetrics.ltv || 0) / (data.customerMetrics.cac || 1);
87364
+ return /* @__PURE__ */ jsxs("div", { className: "space-y-6", children: [
87365
+ /* @__PURE__ */ jsx("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: metrics.map((metric, index2) => /* @__PURE__ */ jsx(MoonUITooltipProviderPro, { children: /* @__PURE__ */ jsxs(MoonUITooltipPro, { children: [
87366
+ /* @__PURE__ */ jsx(MoonUITooltipTriggerPro, { asChild: true, children: /* @__PURE__ */ jsx(
87367
+ motion.div,
87368
+ {
87369
+ className: "p-4 rounded-lg border bg-card hover:bg-muted/50 transition-colors cursor-help",
87370
+ initial: { opacity: 0, y: 20 },
87371
+ animate: { opacity: 1, y: 0 },
87372
+ transition: { delay: index2 * 0.1 },
87373
+ children: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
87374
+ /* @__PURE__ */ jsx("div", { className: "text-muted-foreground", children: metric.icon }),
87375
+ /* @__PURE__ */ jsxs("div", { children: [
87376
+ /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: metric.label }),
87377
+ /* @__PURE__ */ jsx("p", { className: "text-lg font-semibold", children: metric.value })
87378
+ ] })
87379
+ ] })
87380
+ }
87381
+ ) }),
87382
+ /* @__PURE__ */ jsx(MoonUITooltipContentPro, { children: /* @__PURE__ */ jsx("p", { children: metric.description }) })
87383
+ ] }) }, index2)) }),
87384
+ /* @__PURE__ */ jsxs("div", { className: "p-4 rounded-lg border bg-card", children: [
87385
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
87386
+ /* @__PURE__ */ jsxs("div", { children: [
87387
+ /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: "LTV/CAC Ratio" }),
87388
+ /* @__PURE__ */ jsx("p", { className: "text-2xl font-bold", children: formatNumber2(ltvCacRatio) })
87389
+ ] }),
87390
+ /* @__PURE__ */ jsxs("div", { className: "text-right", children: [
87391
+ /* @__PURE__ */ jsx(
87392
+ MoonUIBadgePro,
87393
+ {
87394
+ variant: ltvCacRatio >= 3 ? "primary" : ltvCacRatio >= 2 ? "secondary" : "destructive",
87395
+ className: "text-xs",
87396
+ children: ltvCacRatio >= 3 ? "Excellent" : ltvCacRatio >= 2 ? "Good" : "Needs Improvement"
87397
+ }
87398
+ ),
87399
+ /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground mt-1", children: "Target: 3:1 or higher" })
87400
+ ] })
87401
+ ] }),
87402
+ /* @__PURE__ */ jsxs("div", { className: "mt-3", children: [
87403
+ /* @__PURE__ */ jsx("div", { className: "text-xs text-muted-foreground mb-1", children: "Ratio Progress" }),
87404
+ /* @__PURE__ */ jsx(MoonUIProgressPro, { value: Math.min(100, ltvCacRatio / 5 * 100), className: "h-2" })
87405
+ ] })
87406
+ ] })
87407
+ ] });
87408
+ };
87326
87409
  const renderContent = () => {
87327
87410
  switch (variant) {
87328
87411
  case "compact":
@@ -87339,7 +87422,7 @@ function RevenueWidget({
87339
87422
  showBreakdown && renderBreakdown()
87340
87423
  ] }),
87341
87424
  /* @__PURE__ */ jsx(TabsContent, { value: "streams", className: "space-y-4", children: renderStreams() }),
87342
- /* @__PURE__ */ jsx(TabsContent, { value: "metrics", className: "space-y-4", children: /* @__PURE__ */ jsx("div", { className: "text-center py-8 text-muted-foreground", children: /* @__PURE__ */ jsx("p", { children: "Metrics coming soon" }) }) })
87425
+ /* @__PURE__ */ jsx(TabsContent, { value: "metrics", className: "space-y-4", children: renderMetrics() })
87343
87426
  ] });
87344
87427
  case "dashboard":
87345
87428
  return /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-1 lg:grid-cols-2 gap-6", children: [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moontra/moonui-pro",
3
- "version": "2.28.11",
3
+ "version": "2.29.0",
4
4
  "description": "Premium React components for MoonUI - Advanced UI library with 50+ pro components including performance, interactive, and gesture components",
5
5
  "type": "module",
6
6
  "main": "dist/index.mjs",
@@ -81,7 +81,7 @@
81
81
  "react-dom": ">=18.0.0 || ^19.0.0"
82
82
  },
83
83
  "dependencies": {
84
- "@moontra/moonui-pro": "^2.28.5",
84
+ "@moontra/moonui-pro": "^2.28.12",
85
85
  "@radix-ui/react-accordion": "^1.2.11",
86
86
  "@radix-ui/react-avatar": "^1.1.10",
87
87
  "@radix-ui/react-checkbox": "^1.3.2",