@moontra/moonui-pro 2.31.0 → 2.31.1

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, ShoppingBag, 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, Lock, ChevronLeft, Plus, 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';
@@ -50,7 +50,14 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
50
50
  var __getOwnPropNames = Object.getOwnPropertyNames;
51
51
  var __getProtoOf = Object.getPrototypeOf;
52
52
  var __hasOwnProp = Object.prototype.hasOwnProperty;
53
- var __commonJS = (cb, mod) => function __require() {
53
+ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
54
+ get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
55
+ }) : x)(function(x) {
56
+ if (typeof require !== "undefined")
57
+ return require.apply(this, arguments);
58
+ throw new Error('Dynamic require of "' + x + '" is not supported');
59
+ });
60
+ var __commonJS = (cb, mod) => function __require2() {
54
61
  return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
55
62
  };
56
63
  var __copyProps = (to, from2, except, desc) => {
@@ -4721,6 +4728,138 @@ var useCollapsibleAnalytics = () => {
4721
4728
  }, []);
4722
4729
  return { analytics, trackOpen, trackClose };
4723
4730
  };
4731
+ var CACHE_KEY = "moonui_license_cache";
4732
+ var CACHE_DURATION = 24 * 60 * 60 * 1e3;
4733
+ var OFFLINE_GRACE_PERIOD = 7 * 24 * 60 * 60 * 1e3;
4734
+ function useSubscription() {
4735
+ const [isLoading, setIsLoading] = useState(true);
4736
+ const [hasProAccess, setHasProAccess] = useState(false);
4737
+ const [isAuthenticated, setIsAuthenticated] = useState(false);
4738
+ useEffect(() => {
4739
+ const checkLicense = async () => {
4740
+ try {
4741
+ const cached = localStorage.getItem(CACHE_KEY);
4742
+ if (cached) {
4743
+ const cacheData = JSON.parse(cached);
4744
+ const now = Date.now();
4745
+ if (now - cacheData.timestamp < CACHE_DURATION) {
4746
+ setHasProAccess(cacheData.valid && cacheData.hasLifetimeAccess);
4747
+ setIsAuthenticated(cacheData.valid);
4748
+ setIsLoading(false);
4749
+ return;
4750
+ }
4751
+ if (now - cacheData.timestamp < OFFLINE_GRACE_PERIOD) {
4752
+ validateLicense().catch(() => {
4753
+ setHasProAccess(cacheData.valid && cacheData.hasLifetimeAccess);
4754
+ setIsAuthenticated(cacheData.valid);
4755
+ });
4756
+ setIsLoading(false);
4757
+ return;
4758
+ }
4759
+ }
4760
+ await validateLicense();
4761
+ } catch (error) {
4762
+ console.error("License check error:", error);
4763
+ setHasProAccess(false);
4764
+ setIsAuthenticated(false);
4765
+ } finally {
4766
+ setIsLoading(false);
4767
+ }
4768
+ };
4769
+ checkLicense();
4770
+ }, []);
4771
+ const getAuthToken = async () => {
4772
+ {
4773
+ if (typeof window !== "undefined") {
4774
+ const browserToken = localStorage.getItem("moonui_auth_token");
4775
+ if (browserToken)
4776
+ return browserToken;
4777
+ }
4778
+ if (typeof window === "undefined") {
4779
+ try {
4780
+ const fs = __require("fs");
4781
+ const path = __require("path");
4782
+ const os2 = __require("os");
4783
+ const authPath = path.join(os2.homedir(), ".moonui", "auth.encrypted");
4784
+ if (fs.existsSync(authPath)) {
4785
+ return "cli-authenticated";
4786
+ }
4787
+ } catch (error) {
4788
+ console.debug("CLI auth check failed:", error);
4789
+ }
4790
+ }
4791
+ }
4792
+ return process.env.NEXT_PUBLIC_MOONUI_AUTH_TOKEN || process.env.MOONUI_LICENSE_KEY || null;
4793
+ };
4794
+ const validateLicense = async () => {
4795
+ const token = await getAuthToken();
4796
+ if (!token) {
4797
+ setHasProAccess(false);
4798
+ setIsAuthenticated(false);
4799
+ return;
4800
+ }
4801
+ if (token === "cli-authenticated") {
4802
+ setHasProAccess(true);
4803
+ setIsAuthenticated(true);
4804
+ if (typeof window !== "undefined") {
4805
+ const cacheData = {
4806
+ valid: true,
4807
+ hasLifetimeAccess: true,
4808
+ timestamp: Date.now()
4809
+ };
4810
+ localStorage.setItem(CACHE_KEY, JSON.stringify(cacheData));
4811
+ }
4812
+ return;
4813
+ }
4814
+ try {
4815
+ const response = await fetch("https://moonui.dev/api/auth/validate", {
4816
+ headers: {
4817
+ "Authorization": `Bearer ${token}`
4818
+ }
4819
+ });
4820
+ if (response.ok) {
4821
+ const data = await response.json();
4822
+ const cacheData = {
4823
+ valid: data.valid,
4824
+ hasLifetimeAccess: data.user?.hasLifetimeAccess || false,
4825
+ timestamp: Date.now(),
4826
+ cacheUntil: data.cacheUntil ? new Date(data.cacheUntil).getTime() : void 0
4827
+ };
4828
+ localStorage.setItem(CACHE_KEY, JSON.stringify(cacheData));
4829
+ setHasProAccess(data.valid && (data.user?.hasLifetimeAccess || data.user?.features?.includes("pro_components")));
4830
+ setIsAuthenticated(data.valid);
4831
+ } else {
4832
+ localStorage.removeItem(CACHE_KEY);
4833
+ setHasProAccess(false);
4834
+ setIsAuthenticated(false);
4835
+ }
4836
+ } catch (error) {
4837
+ const cached = localStorage.getItem(CACHE_KEY);
4838
+ if (cached) {
4839
+ const cacheData = JSON.parse(cached);
4840
+ const now = Date.now();
4841
+ if (now - cacheData.timestamp < OFFLINE_GRACE_PERIOD) {
4842
+ setHasProAccess(cacheData.valid && cacheData.hasLifetimeAccess);
4843
+ setIsAuthenticated(cacheData.valid);
4844
+ return;
4845
+ }
4846
+ }
4847
+ setHasProAccess(false);
4848
+ setIsAuthenticated(false);
4849
+ }
4850
+ };
4851
+ return {
4852
+ isLoading,
4853
+ isAuthenticated,
4854
+ isAdmin: false,
4855
+ hasProAccess,
4856
+ subscriptionPlan: hasProAccess ? "lifetime" : "free",
4857
+ subscription: {
4858
+ status: hasProAccess ? "active" : "inactive",
4859
+ plan: hasProAccess ? "lifetime" : "free"
4860
+ }
4861
+ };
4862
+ }
4724
4863
  var defaultColors = [
4725
4864
  "#000000",
4726
4865
  "#374151",
@@ -4748,6 +4887,7 @@ var MoonUIColorPickerPro = ({
4748
4887
  size: size4 = "default",
4749
4888
  presets = defaultColors
4750
4889
  }) => {
4890
+ const { hasProAccess, isLoading } = useSubscription();
4751
4891
  const [currentColor, setCurrentColor] = useState(value);
4752
4892
  const handleColorChange = (color) => {
4753
4893
  setCurrentColor(color);
@@ -4758,6 +4898,21 @@ var MoonUIColorPickerPro = ({
4758
4898
  default: "w-8 h-8",
4759
4899
  lg: "w-10 h-10"
4760
4900
  };
4901
+ if (!isLoading && !hasProAccess) {
4902
+ return /* @__PURE__ */ jsxs("div", { className: "rounded-lg border-2 border-dashed border-gray-300 dark:border-gray-700 p-8 text-center", children: [
4903
+ /* @__PURE__ */ jsx(Lock, { className: "mx-auto h-12 w-12 text-gray-400 dark:text-gray-600 mb-4" }),
4904
+ /* @__PURE__ */ jsx("h3", { className: "text-lg font-semibold mb-2", children: "Pro Component" }),
4905
+ /* @__PURE__ */ jsx("p", { className: "text-sm text-gray-500 dark:text-gray-400 mb-4", children: "Please login with CLI: moonui login" }),
4906
+ /* @__PURE__ */ jsx(
4907
+ "a",
4908
+ {
4909
+ href: "https://moonui.dev/pricing",
4910
+ className: "text-primary hover:underline text-sm font-medium",
4911
+ children: "Get Pro Access \u2192"
4912
+ }
4913
+ )
4914
+ ] });
4915
+ }
4761
4916
  return /* @__PURE__ */ jsxs("div", { className: cn("flex flex-col gap-2", className), children: [
4762
4917
  showInput && /* @__PURE__ */ jsxs("div", { className: "flex gap-2 items-center", children: [
4763
4918
  /* @__PURE__ */ jsx(
@@ -8102,6 +8257,7 @@ var MoonUITabsPro = t.forwardRef(({
8102
8257
  onValueChange,
8103
8258
  ...props
8104
8259
  }, ref) => {
8260
+ const { hasProAccess, isLoading } = useSubscription();
8105
8261
  const [items, setItems] = t.useState(initialItems);
8106
8262
  const [localValue, setLocalValue] = t.useState(() => {
8107
8263
  if (persistKey && typeof window !== "undefined") {
@@ -8206,6 +8362,21 @@ var MoonUITabsPro = t.forwardRef(({
8206
8362
  scrollRef.current.scrollBy({ left: 200, behavior: "smooth" });
8207
8363
  }
8208
8364
  };
8365
+ if (!isLoading && !hasProAccess) {
8366
+ return /* @__PURE__ */ jsxs("div", { className: "rounded-lg border-2 border-dashed border-gray-300 dark:border-gray-700 p-8 text-center", children: [
8367
+ /* @__PURE__ */ jsx(Lock, { className: "mx-auto h-12 w-12 text-gray-400 dark:text-gray-600 mb-4" }),
8368
+ /* @__PURE__ */ jsx("h3", { className: "text-lg font-semibold mb-2", children: "Pro Component" }),
8369
+ /* @__PURE__ */ jsx("p", { className: "text-sm text-gray-500 dark:text-gray-400 mb-4", children: "Please login with CLI: moonui login" }),
8370
+ /* @__PURE__ */ jsx(
8371
+ "a",
8372
+ {
8373
+ href: "https://moonui.dev/pricing",
8374
+ className: "text-primary hover:underline text-sm font-medium",
8375
+ children: "Get Pro Access \u2192"
8376
+ }
8377
+ )
8378
+ ] });
8379
+ }
8209
8380
  return /* @__PURE__ */ jsxs("div", { className: cn(
8210
8381
  "relative w-full",
8211
8382
  variant === "gradient" && "bg-gradient-to-r from-primary/10 to-secondary/10 rounded-lg p-1",
@@ -12644,102 +12815,6 @@ var NavigationMenuIndicator2 = t.forwardRef(({ className, ...props }, ref) => /*
12644
12815
  }
12645
12816
  ));
12646
12817
  NavigationMenuIndicator2.displayName = Indicator3.displayName;
12647
- var CACHE_KEY = "moonui_license_cache";
12648
- var CACHE_DURATION = 24 * 60 * 60 * 1e3;
12649
- var OFFLINE_GRACE_PERIOD = 7 * 24 * 60 * 60 * 1e3;
12650
- function useSubscription() {
12651
- const [isLoading, setIsLoading] = useState(true);
12652
- const [hasProAccess, setHasProAccess] = useState(true);
12653
- const [isAuthenticated, setIsAuthenticated] = useState(true);
12654
- useEffect(() => {
12655
- const checkLicense = async () => {
12656
- try {
12657
- const cached = localStorage.getItem(CACHE_KEY);
12658
- if (cached) {
12659
- const cacheData = JSON.parse(cached);
12660
- const now = Date.now();
12661
- if (now - cacheData.timestamp < CACHE_DURATION) {
12662
- setHasProAccess(cacheData.valid && cacheData.hasLifetimeAccess);
12663
- setIsAuthenticated(cacheData.valid);
12664
- setIsLoading(false);
12665
- return;
12666
- }
12667
- if (now - cacheData.timestamp < OFFLINE_GRACE_PERIOD) {
12668
- validateLicense().catch(() => {
12669
- setHasProAccess(cacheData.valid && cacheData.hasLifetimeAccess);
12670
- setIsAuthenticated(cacheData.valid);
12671
- });
12672
- setIsLoading(false);
12673
- return;
12674
- }
12675
- }
12676
- await validateLicense();
12677
- } catch (error) {
12678
- console.error("License check error:", error);
12679
- setHasProAccess(true);
12680
- setIsAuthenticated(true);
12681
- } finally {
12682
- setIsLoading(false);
12683
- }
12684
- };
12685
- checkLicense();
12686
- }, []);
12687
- const validateLicense = async () => {
12688
- const token = process.env.NEXT_PUBLIC_MOONUI_AUTH_TOKEN || localStorage.getItem("moonui_auth_token");
12689
- if (!token) {
12690
- setHasProAccess(true);
12691
- setIsAuthenticated(true);
12692
- return;
12693
- }
12694
- try {
12695
- const response = await fetch("https://moonui.dev/api/auth/validate", {
12696
- headers: {
12697
- "Authorization": `Bearer ${token}`
12698
- }
12699
- });
12700
- if (response.ok) {
12701
- const data = await response.json();
12702
- const cacheData = {
12703
- valid: data.valid,
12704
- hasLifetimeAccess: data.user?.hasLifetimeAccess || false,
12705
- timestamp: Date.now(),
12706
- cacheUntil: data.cacheUntil ? new Date(data.cacheUntil).getTime() : void 0
12707
- };
12708
- localStorage.setItem(CACHE_KEY, JSON.stringify(cacheData));
12709
- setHasProAccess(data.valid && (data.user?.hasLifetimeAccess || data.user?.features?.includes("pro_components")));
12710
- setIsAuthenticated(data.valid);
12711
- } else {
12712
- localStorage.removeItem(CACHE_KEY);
12713
- setHasProAccess(false);
12714
- setIsAuthenticated(false);
12715
- }
12716
- } catch (error) {
12717
- const cached = localStorage.getItem(CACHE_KEY);
12718
- if (cached) {
12719
- const cacheData = JSON.parse(cached);
12720
- const now = Date.now();
12721
- if (now - cacheData.timestamp < OFFLINE_GRACE_PERIOD) {
12722
- setHasProAccess(cacheData.valid && cacheData.hasLifetimeAccess);
12723
- setIsAuthenticated(cacheData.valid);
12724
- return;
12725
- }
12726
- }
12727
- setHasProAccess(false);
12728
- setIsAuthenticated(false);
12729
- }
12730
- };
12731
- return {
12732
- isLoading,
12733
- isAuthenticated,
12734
- isAdmin: false,
12735
- hasProAccess,
12736
- subscriptionPlan: hasProAccess ? "lifetime" : "free",
12737
- subscription: {
12738
- status: hasProAccess ? "active" : "inactive",
12739
- plan: hasProAccess ? "lifetime" : "free"
12740
- }
12741
- };
12742
- }
12743
12818
  var gestureDrawerVariants = cva(
12744
12819
  "fixed bg-background shadow-2xl overflow-hidden",
12745
12820
  {
@@ -13150,6 +13225,7 @@ function useLightbox() {
13150
13225
  return context;
13151
13226
  }
13152
13227
  function LightboxProvider({ children, items = [], defaultIndex = 0 }) {
13228
+ const { hasProAccess, isLoading } = useSubscription();
13153
13229
  const [currentIndex, setCurrentIndex] = t.useState(defaultIndex);
13154
13230
  const [isOpen, setIsOpen] = t.useState(false);
13155
13231
  const [zoom, setZoom] = t.useState(1);
@@ -13165,6 +13241,21 @@ function LightboxProvider({ children, items = [], defaultIndex = 0 }) {
13165
13241
  }),
13166
13242
  [items, currentIndex, isOpen, zoom]
13167
13243
  );
13244
+ if (!isLoading && !hasProAccess) {
13245
+ return /* @__PURE__ */ jsxs("div", { className: "rounded-lg border-2 border-dashed border-gray-300 dark:border-gray-700 p-8 text-center", children: [
13246
+ /* @__PURE__ */ jsx(Lock, { className: "mx-auto h-12 w-12 text-gray-400 dark:text-gray-600 mb-4" }),
13247
+ /* @__PURE__ */ jsx("h3", { className: "text-lg font-semibold mb-2", children: "Pro Component" }),
13248
+ /* @__PURE__ */ jsx("p", { className: "text-sm text-gray-500 dark:text-gray-400 mb-4", children: "Please login with CLI: moonui login" }),
13249
+ /* @__PURE__ */ jsx(
13250
+ "a",
13251
+ {
13252
+ href: "https://moonui.dev/pricing",
13253
+ className: "text-primary hover:underline text-sm font-medium",
13254
+ children: "Get Pro Access \u2192"
13255
+ }
13256
+ )
13257
+ ] });
13258
+ }
13168
13259
  return /* @__PURE__ */ jsx(LightboxContext.Provider, { value, children });
13169
13260
  }
13170
13261
  var LightboxTrigger = t.forwardRef(
@@ -13661,6 +13752,7 @@ var MoonUIMediaGalleryPro = t.forwardRef(({
13661
13752
  lightboxProps,
13662
13753
  ...props
13663
13754
  }, ref) => {
13755
+ const { hasProAccess, isLoading } = useSubscription();
13664
13756
  const [activeCategory, setActiveCategory] = t.useState(defaultCategory);
13665
13757
  const [activeSort, setActiveSort] = t.useState(defaultSort);
13666
13758
  const [showFilters, setShowFilters] = t.useState(false);
@@ -13820,6 +13912,21 @@ var MoonUIMediaGalleryPro = t.forwardRef(({
13820
13912
  return itemContent;
13821
13913
  };
13822
13914
  const renderSkeleton = () => /* @__PURE__ */ jsx("div", { className: cn(galleryItemVariants({ variant, aspectRatio })), children: /* @__PURE__ */ jsx("div", { className: "w-full h-full bg-muted animate-pulse" }) });
13915
+ if (!isLoading && !hasProAccess) {
13916
+ return /* @__PURE__ */ jsxs("div", { className: "rounded-lg border-2 border-dashed border-gray-300 dark:border-gray-700 p-8 text-center", children: [
13917
+ /* @__PURE__ */ jsx(Lock, { className: "mx-auto h-12 w-12 text-gray-400 dark:text-gray-600 mb-4" }),
13918
+ /* @__PURE__ */ jsx("h3", { className: "text-lg font-semibold mb-2", children: "Pro Component" }),
13919
+ /* @__PURE__ */ jsx("p", { className: "text-sm text-gray-500 dark:text-gray-400 mb-4", children: "Please login with CLI: moonui login" }),
13920
+ /* @__PURE__ */ jsx(
13921
+ "a",
13922
+ {
13923
+ href: "https://moonui.dev/pricing",
13924
+ className: "text-primary hover:underline text-sm font-medium",
13925
+ children: "Get Pro Access \u2192"
13926
+ }
13927
+ )
13928
+ ] });
13929
+ }
13823
13930
  const galleryContent = /* @__PURE__ */ jsxs(Fragment, { children: [
13824
13931
  (enableFiltering || enableSorting) && /* @__PURE__ */ jsxs("div", { className: "mb-6", children: [
13825
13932
  /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between mb-4", children: [
@@ -13990,6 +14097,7 @@ function DraggableList({
13990
14097
  dragPreviewStyle = "clone",
13991
14098
  hapticFeedback = true
13992
14099
  }) {
14100
+ const { hasProAccess, isLoading } = useSubscription();
13993
14101
  const [draggedIndex, setDraggedIndex] = useState(null);
13994
14102
  const [dropPosition, setDropPosition] = useState(null);
13995
14103
  const [isDragging, setIsDragging] = useState(false);
@@ -14186,6 +14294,21 @@ function DraggableList({
14186
14294
  }
14187
14295
  return null;
14188
14296
  };
14297
+ if (!isLoading && !hasProAccess) {
14298
+ return /* @__PURE__ */ jsxs("div", { className: "rounded-lg border-2 border-dashed border-gray-300 dark:border-gray-700 p-8 text-center", children: [
14299
+ /* @__PURE__ */ jsx(Lock, { className: "mx-auto h-12 w-12 text-gray-400 dark:text-gray-600 mb-4" }),
14300
+ /* @__PURE__ */ jsx("h3", { className: "text-lg font-semibold mb-2", children: "Pro Component" }),
14301
+ /* @__PURE__ */ jsx("p", { className: "text-sm text-gray-500 dark:text-gray-400 mb-4", children: "Please login with CLI: moonui login" }),
14302
+ /* @__PURE__ */ jsx(
14303
+ "a",
14304
+ {
14305
+ href: "https://moonui.dev/pricing",
14306
+ className: "text-primary hover:underline text-sm font-medium",
14307
+ children: "Get Pro Access \u2192"
14308
+ }
14309
+ )
14310
+ ] });
14311
+ }
14189
14312
  return /* @__PURE__ */ jsxs(
14190
14313
  "div",
14191
14314
  {
@@ -85526,6 +85649,7 @@ var MoonUIAvatarPro2 = t.forwardRef(({
85526
85649
  error = false,
85527
85650
  ...props
85528
85651
  }, ref) => {
85652
+ useSubscription();
85529
85653
  const animationClasses = {
85530
85654
  pulse: "animate-pulse",
85531
85655
  bounce: "animate-bounce",
@@ -85623,6 +85747,7 @@ var MoonUIAvatarPro2 = t.forwardRef(({
85623
85747
  });
85624
85748
  MoonUIAvatarPro2.displayName = "MoonUIAvatarPro";
85625
85749
  var MoonUIAvatarGroupPro2 = t.forwardRef(({ children, max: max2 = 4, size: size4 = "md", spacing = "normal", className }, ref) => {
85750
+ const { hasProAccess, isLoading: isCheckingAuth } = useSubscription();
85626
85751
  const childrenArray = t.Children.toArray(children);
85627
85752
  const visibleChildren = childrenArray.slice(0, max2);
85628
85753
  const remainingCount = childrenArray.length - max2;
@@ -85631,6 +85756,21 @@ var MoonUIAvatarGroupPro2 = t.forwardRef(({ children, max: max2 = 4, size: size4
85631
85756
  normal: "-space-x-2",
85632
85757
  loose: "-space-x-1"
85633
85758
  };
85759
+ if (!isCheckingAuth && !hasProAccess) {
85760
+ return /* @__PURE__ */ jsxs("div", { className: "rounded-lg border-2 border-dashed border-gray-300 dark:border-gray-700 p-8 text-center", children: [
85761
+ /* @__PURE__ */ jsx(Lock, { className: "mx-auto h-12 w-12 text-gray-400 dark:text-gray-600 mb-4" }),
85762
+ /* @__PURE__ */ jsx("h3", { className: "text-lg font-semibold mb-2", children: "Pro Component" }),
85763
+ /* @__PURE__ */ jsx("p", { className: "text-sm text-gray-500 dark:text-gray-400 mb-4", children: "Please login with CLI: moonui login" }),
85764
+ /* @__PURE__ */ jsx(
85765
+ "a",
85766
+ {
85767
+ href: "https://moonui.dev/pricing",
85768
+ className: "text-primary hover:underline text-sm font-medium",
85769
+ children: "Get Pro Access \u2192"
85770
+ }
85771
+ )
85772
+ ] });
85773
+ }
85634
85774
  return /* @__PURE__ */ jsxs(
85635
85775
  "div",
85636
85776
  {
@@ -85667,6 +85807,7 @@ var MoonUIAvatarGroupPro2 = t.forwardRef(({ children, max: max2 = 4, size: size4
85667
85807
  });
85668
85808
  MoonUIAvatarGroupPro2.displayName = "MoonUIAvatarGroupPro";
85669
85809
  var MoonUIAsyncAvatarPro = t.forwardRef(({ userId, fetchUser, ...props }, ref) => {
85810
+ const { hasProAccess, isLoading: isCheckingAuth } = useSubscription();
85670
85811
  const [userData, setUserData] = t.useState(null);
85671
85812
  const [isLoading, setIsLoading] = t.useState(false);
85672
85813
  const [hasError, setHasError] = t.useState(false);
@@ -85677,6 +85818,21 @@ var MoonUIAsyncAvatarPro = t.forwardRef(({ userId, fetchUser, ...props }, ref) =
85677
85818
  fetchUser(userId).then(setUserData).catch(() => setHasError(true)).finally(() => setIsLoading(false));
85678
85819
  }
85679
85820
  }, [userId, fetchUser]);
85821
+ if (!isCheckingAuth && !hasProAccess) {
85822
+ return /* @__PURE__ */ jsxs("div", { className: "rounded-lg border-2 border-dashed border-gray-300 dark:border-gray-700 p-8 text-center", children: [
85823
+ /* @__PURE__ */ jsx(Lock, { className: "mx-auto h-12 w-12 text-gray-400 dark:text-gray-600 mb-4" }),
85824
+ /* @__PURE__ */ jsx("h3", { className: "text-lg font-semibold mb-2", children: "Pro Component" }),
85825
+ /* @__PURE__ */ jsx("p", { className: "text-sm text-gray-500 dark:text-gray-400 mb-4", children: "Please login with CLI: moonui login" }),
85826
+ /* @__PURE__ */ jsx(
85827
+ "a",
85828
+ {
85829
+ href: "https://moonui.dev/pricing",
85830
+ className: "text-primary hover:underline text-sm font-medium",
85831
+ children: "Get Pro Access \u2192"
85832
+ }
85833
+ )
85834
+ ] });
85835
+ }
85680
85836
  return /* @__PURE__ */ jsx(
85681
85837
  MoonUIAvatarPro2,
85682
85838
  {
@@ -85859,6 +86015,7 @@ function KPIWidget({
85859
86015
  onKPIClick,
85860
86016
  ...widgetProps
85861
86017
  }) {
86018
+ const { hasProAccess, isLoading } = useSubscription();
85862
86019
  const kpis = Array.isArray(data) ? data : [data];
85863
86020
  const formatValue = (value, unit) => {
85864
86021
  if (typeof value === "string")
@@ -86021,6 +86178,21 @@ function KPIWidget({
86021
86178
  index2
86022
86179
  );
86023
86180
  };
86181
+ if (!isLoading && !hasProAccess) {
86182
+ return /* @__PURE__ */ jsxs("div", { className: "rounded-lg border-2 border-dashed border-gray-300 dark:border-gray-700 p-8 text-center", children: [
86183
+ /* @__PURE__ */ jsx(Lock, { className: "mx-auto h-12 w-12 text-gray-400 dark:text-gray-600 mb-4" }),
86184
+ /* @__PURE__ */ jsx("h3", { className: "text-lg font-semibold mb-2", children: "Pro Component" }),
86185
+ /* @__PURE__ */ jsx("p", { className: "text-sm text-gray-500 dark:text-gray-400 mb-4", children: "Please login with CLI: moonui login" }),
86186
+ /* @__PURE__ */ jsx(
86187
+ "a",
86188
+ {
86189
+ href: "https://moonui.dev/pricing",
86190
+ className: "text-primary hover:underline text-sm font-medium",
86191
+ children: "Get Pro Access \u2192"
86192
+ }
86193
+ )
86194
+ ] });
86195
+ }
86024
86196
  return /* @__PURE__ */ jsx(
86025
86197
  WidgetBase,
86026
86198
  {
@@ -86052,6 +86224,7 @@ function ChartWidget2({
86052
86224
  onDataPointClick,
86053
86225
  ...widgetProps
86054
86226
  }) {
86227
+ const { hasProAccess, isLoading } = useSubscription();
86055
86228
  const [hoveredIndex, setHoveredIndex] = t__default.useState(null);
86056
86229
  const defaultColors2 = [
86057
86230
  "#3b82f6",
@@ -86417,6 +86590,21 @@ function ChartWidget2({
86417
86590
  return renderBarChart();
86418
86591
  }
86419
86592
  };
86593
+ if (!isLoading && !hasProAccess) {
86594
+ return /* @__PURE__ */ jsxs("div", { className: "rounded-lg border-2 border-dashed border-gray-300 dark:border-gray-700 p-8 text-center", children: [
86595
+ /* @__PURE__ */ jsx(Lock, { className: "mx-auto h-12 w-12 text-gray-400 dark:text-gray-600 mb-4" }),
86596
+ /* @__PURE__ */ jsx("h3", { className: "text-lg font-semibold mb-2", children: "Pro Component" }),
86597
+ /* @__PURE__ */ jsx("p", { className: "text-sm text-gray-500 dark:text-gray-400 mb-4", children: "Please login with CLI: moonui login" }),
86598
+ /* @__PURE__ */ jsx(
86599
+ "a",
86600
+ {
86601
+ href: "https://moonui.dev/pricing",
86602
+ className: "text-primary hover:underline text-sm font-medium",
86603
+ children: "Get Pro Access \u2192"
86604
+ }
86605
+ )
86606
+ ] });
86607
+ }
86420
86608
  return /* @__PURE__ */ jsx(
86421
86609
  WidgetBase,
86422
86610
  {
@@ -86469,6 +86657,7 @@ function GaugeWidget({
86469
86657
  onGaugeClick,
86470
86658
  ...widgetProps
86471
86659
  }) {
86660
+ const { hasProAccess, isLoading } = useSubscription();
86472
86661
  const gauges = Array.isArray(data) ? data : [data];
86473
86662
  const sizeConfig = {
86474
86663
  sm: { width: 120, height: 120, fontSize: "text-lg", strokeWidth: 8 },
@@ -86725,6 +86914,21 @@ function GaugeWidget({
86725
86914
  return renderRadialGauge(gauge, index2);
86726
86915
  }
86727
86916
  };
86917
+ if (!isLoading && !hasProAccess) {
86918
+ return /* @__PURE__ */ jsxs("div", { className: "rounded-lg border-2 border-dashed border-gray-300 dark:border-gray-700 p-8 text-center", children: [
86919
+ /* @__PURE__ */ jsx(Lock, { className: "mx-auto h-12 w-12 text-gray-400 dark:text-gray-600 mb-4" }),
86920
+ /* @__PURE__ */ jsx("h3", { className: "text-lg font-semibold mb-2", children: "Pro Component" }),
86921
+ /* @__PURE__ */ jsx("p", { className: "text-sm text-gray-500 dark:text-gray-400 mb-4", children: "Please login with CLI: moonui login" }),
86922
+ /* @__PURE__ */ jsx(
86923
+ "a",
86924
+ {
86925
+ href: "https://moonui.dev/pricing",
86926
+ className: "text-primary hover:underline text-sm font-medium",
86927
+ children: "Get Pro Access \u2192"
86928
+ }
86929
+ )
86930
+ ] });
86931
+ }
86728
86932
  return /* @__PURE__ */ jsx(
86729
86933
  WidgetBase,
86730
86934
  {
@@ -86757,6 +86961,7 @@ function FunnelWidget({
86757
86961
  onStageClick,
86758
86962
  ...widgetProps
86759
86963
  }) {
86964
+ const { hasProAccess, isLoading } = useSubscription();
86760
86965
  const [hoveredStage, setHoveredStage] = t__default.useState(null);
86761
86966
  const formatNumber2 = (value) => {
86762
86967
  if (value % 1 !== 0) {
@@ -87055,6 +87260,21 @@ function FunnelWidget({
87055
87260
  return renderVerticalFunnel();
87056
87261
  }
87057
87262
  };
87263
+ if (!isLoading && !hasProAccess) {
87264
+ return /* @__PURE__ */ jsxs("div", { className: "rounded-lg border-2 border-dashed border-gray-300 dark:border-gray-700 p-8 text-center", children: [
87265
+ /* @__PURE__ */ jsx(Lock, { className: "mx-auto h-12 w-12 text-gray-400 dark:text-gray-600 mb-4" }),
87266
+ /* @__PURE__ */ jsx("h3", { className: "text-lg font-semibold mb-2", children: "Pro Component" }),
87267
+ /* @__PURE__ */ jsx("p", { className: "text-sm text-gray-500 dark:text-gray-400 mb-4", children: "Please login with CLI: moonui login" }),
87268
+ /* @__PURE__ */ jsx(
87269
+ "a",
87270
+ {
87271
+ href: "https://moonui.dev/pricing",
87272
+ className: "text-primary hover:underline text-sm font-medium",
87273
+ children: "Get Pro Access \u2192"
87274
+ }
87275
+ )
87276
+ ] });
87277
+ }
87058
87278
  return /* @__PURE__ */ jsx(
87059
87279
  WidgetBase,
87060
87280
  {
@@ -87105,6 +87325,7 @@ function RevenueWidget({
87105
87325
  onMetricClick,
87106
87326
  ...widgetProps
87107
87327
  }) {
87328
+ const { hasProAccess, isLoading } = useSubscription();
87108
87329
  const [selectedTab, setSelectedTab] = t__default.useState("overview");
87109
87330
  const formatNumber2 = (value) => {
87110
87331
  if (value % 1 !== 0) {
@@ -87514,6 +87735,21 @@ function RevenueWidget({
87514
87735
  ] });
87515
87736
  }
87516
87737
  };
87738
+ if (!isLoading && !hasProAccess) {
87739
+ return /* @__PURE__ */ jsxs("div", { className: "rounded-lg border-2 border-dashed border-gray-300 dark:border-gray-700 p-8 text-center", children: [
87740
+ /* @__PURE__ */ jsx(Lock, { className: "mx-auto h-12 w-12 text-gray-400 dark:text-gray-600 mb-4" }),
87741
+ /* @__PURE__ */ jsx("h3", { className: "text-lg font-semibold mb-2", children: "Pro Component" }),
87742
+ /* @__PURE__ */ jsx("p", { className: "text-sm text-gray-500 dark:text-gray-400 mb-4", children: "Please login with CLI: moonui login" }),
87743
+ /* @__PURE__ */ jsx(
87744
+ "a",
87745
+ {
87746
+ href: "https://moonui.dev/pricing",
87747
+ className: "text-primary hover:underline text-sm font-medium",
87748
+ children: "Get Pro Access \u2192"
87749
+ }
87750
+ )
87751
+ ] });
87752
+ }
87517
87753
  return /* @__PURE__ */ jsx(
87518
87754
  WidgetBase,
87519
87755
  {
@@ -87540,6 +87776,7 @@ function ServerMonitorWidget({
87540
87776
  onAlertClick,
87541
87777
  ...widgetProps
87542
87778
  }) {
87779
+ const { hasProAccess, isLoading } = useSubscription();
87543
87780
  const servers = Array.isArray(data) ? data : [data];
87544
87781
  const [selectedTab, setSelectedTab] = t__default.useState("overview");
87545
87782
  const [liveData, setLiveData] = t__default.useState(servers);
@@ -87893,6 +88130,21 @@ function ServerMonitorWidget({
87893
88130
  return /* @__PURE__ */ jsx("div", { className: "space-y-4", children: liveData.map((server) => /* @__PURE__ */ jsx("div", { children: renderServerCard(server) }, server.id)) });
87894
88131
  }
87895
88132
  };
88133
+ if (!isLoading && !hasProAccess) {
88134
+ return /* @__PURE__ */ jsxs("div", { className: "rounded-lg border-2 border-dashed border-gray-300 dark:border-gray-700 p-8 text-center", children: [
88135
+ /* @__PURE__ */ jsx(Lock, { className: "mx-auto h-12 w-12 text-gray-400 dark:text-gray-600 mb-4" }),
88136
+ /* @__PURE__ */ jsx("h3", { className: "text-lg font-semibold mb-2", children: "Pro Component" }),
88137
+ /* @__PURE__ */ jsx("p", { className: "text-sm text-gray-500 dark:text-gray-400 mb-4", children: "Please login with CLI: moonui login" }),
88138
+ /* @__PURE__ */ jsx(
88139
+ "a",
88140
+ {
88141
+ href: "https://moonui.dev/pricing",
88142
+ className: "text-primary hover:underline text-sm font-medium",
88143
+ children: "Get Pro Access \u2192"
88144
+ }
88145
+ )
88146
+ ] });
88147
+ }
87896
88148
  return /* @__PURE__ */ jsx(
87897
88149
  WidgetBase,
87898
88150
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moontra/moonui-pro",
3
- "version": "2.31.0",
3
+ "version": "2.31.1",
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,6 @@
81
81
  "react-dom": ">=18.0.0 || ^19.0.0"
82
82
  },
83
83
  "dependencies": {
84
- "@moontra/moonui-pro": "^2.28.12",
85
84
  "@radix-ui/react-accordion": "^1.2.11",
86
85
  "@radix-ui/react-avatar": "^1.1.10",
87
86
  "@radix-ui/react-checkbox": "^1.3.2",