virtual-ui-lib 1.0.66 → 1.0.67

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.js CHANGED
@@ -45,6 +45,7 @@ __export(index_exports, {
45
45
  Navbar: () => Navbar,
46
46
  NotificationToast: () => NotificationToast,
47
47
  OtpInput: () => OtpInput,
48
+ PageLoader: () => PageLoader,
48
49
  PricingCard: () => PricingCard,
49
50
  ResponsiveNavbar: () => ResponsiveNavbar,
50
51
  SearchBar: () => SearchBar,
@@ -2529,6 +2530,175 @@ var BackgoundImageSlider = ({
2529
2530
  }
2530
2531
  )))));
2531
2532
  };
2533
+
2534
+ // src/components/PageLoader/PageLoader.jsx
2535
+ var import_react27 = __toESM(require("react"));
2536
+ var PageLoader = ({
2537
+ logo = "VirtualAI",
2538
+ accent = "#6366f1",
2539
+ bg = "",
2540
+ type = "spinner",
2541
+ loadingText = "Loading...",
2542
+ subText = "",
2543
+ duration = 6e3,
2544
+ onComplete = () => {
2545
+ }
2546
+ }) => {
2547
+ const [progress, setProgress] = (0, import_react27.useState)(0);
2548
+ const [done, setDone] = (0, import_react27.useState)(false);
2549
+ const alpha = (hex, op) => {
2550
+ const r = parseInt(hex.slice(1, 3), 16);
2551
+ const g = parseInt(hex.slice(3, 5), 16);
2552
+ const b = parseInt(hex.slice(5, 7), 16);
2553
+ return `rgba(${r},${g},${b},${op})`;
2554
+ };
2555
+ (0, import_react27.useEffect)(() => {
2556
+ const steps = 100;
2557
+ const interval = duration / steps;
2558
+ let current = 0;
2559
+ const timer = setInterval(() => {
2560
+ current += 1;
2561
+ setProgress(current);
2562
+ if (current >= 100) {
2563
+ clearInterval(timer);
2564
+ setTimeout(() => {
2565
+ setDone(true);
2566
+ onComplete();
2567
+ }, 300);
2568
+ }
2569
+ }, interval);
2570
+ return () => clearInterval(timer);
2571
+ }, [duration]);
2572
+ if (done) return null;
2573
+ return /* @__PURE__ */ import_react27.default.createElement(import_react27.default.Fragment, null, /* @__PURE__ */ import_react27.default.createElement("style", null, `
2574
+ @keyframes pl-spin { to { transform: rotate(360deg); } }
2575
+ @keyframes pl-pulse { 0%,100%{transform:scale(1);opacity:1} 50%{transform:scale(1.15);opacity:0.7} }
2576
+ @keyframes pl-dot { 0%,80%,100%{transform:scale(0.6);opacity:0.3} 40%{transform:scale(1);opacity:1} }
2577
+ @keyframes pl-fade { from{opacity:0;transform:translateY(10px)} to{opacity:1;transform:translateY(0)} }
2578
+ @keyframes pl-bar { 0%{background-position:0% 50%} 100%{background-position:200% 50%} }
2579
+ `), /* @__PURE__ */ import_react27.default.createElement("div", { style: {
2580
+ width: "100%",
2581
+ height: "100%",
2582
+ background: bg,
2583
+ display: "flex",
2584
+ flexDirection: "column",
2585
+ alignItems: "center",
2586
+ justifyContent: "center",
2587
+ gap: "28px",
2588
+ fontFamily: "system-ui, -apple-system, sans-serif",
2589
+ animation: "pl-fade 0.3s ease"
2590
+ } }, /* @__PURE__ */ import_react27.default.createElement("div", { style: {
2591
+ position: "absolute",
2592
+ top: "-100px",
2593
+ left: "-100px",
2594
+ width: "400px",
2595
+ height: "400px",
2596
+ borderRadius: "50%",
2597
+ background: `radial-gradient(circle, ${alpha(accent, 0.12)}, transparent 70%)`,
2598
+ filter: "blur(60px)",
2599
+ pointerEvents: "none"
2600
+ } }), /* @__PURE__ */ import_react27.default.createElement("div", { style: {
2601
+ position: "absolute",
2602
+ bottom: "-100px",
2603
+ right: "-100px",
2604
+ width: "350px",
2605
+ height: "350px",
2606
+ borderRadius: "50%",
2607
+ background: `radial-gradient(circle, ${alpha(accent, 0.08)}, transparent 70%)`,
2608
+ filter: "blur(60px)",
2609
+ pointerEvents: "none"
2610
+ } }), /* @__PURE__ */ import_react27.default.createElement("div", { style: { display: "flex", alignItems: "center", gap: "10px", animation: "pl-fade 0.4s ease" } }, /* @__PURE__ */ import_react27.default.createElement("div", { style: {
2611
+ width: "36px",
2612
+ height: "36px",
2613
+ borderRadius: "10px",
2614
+ background: `linear-gradient(135deg, ${accent}, ${alpha(accent, 0.6)})`,
2615
+ display: "flex",
2616
+ alignItems: "center",
2617
+ justifyContent: "center",
2618
+ fontSize: "16px",
2619
+ fontWeight: "800",
2620
+ color: "#fff",
2621
+ animation: type === "pulse" ? `pl-pulse 1.5s ease infinite` : "none"
2622
+ } }, logo[0]), /* @__PURE__ */ import_react27.default.createElement("span", { style: { fontSize: "20px", fontWeight: "800", color: "#fff", letterSpacing: "-0.5px" } }, logo)), type === "spinner" && /* @__PURE__ */ import_react27.default.createElement("div", { style: { position: "relative", width: "56px", height: "56px" } }, /* @__PURE__ */ import_react27.default.createElement("svg", { width: "56", height: "56", viewBox: "0 0 56 56" }, /* @__PURE__ */ import_react27.default.createElement(
2623
+ "circle",
2624
+ {
2625
+ cx: "28",
2626
+ cy: "28",
2627
+ r: "22",
2628
+ fill: "none",
2629
+ stroke: alpha(accent, 0.12),
2630
+ strokeWidth: "4"
2631
+ }
2632
+ ), /* @__PURE__ */ import_react27.default.createElement(
2633
+ "circle",
2634
+ {
2635
+ cx: "28",
2636
+ cy: "28",
2637
+ r: "22",
2638
+ fill: "none",
2639
+ stroke: accent,
2640
+ strokeWidth: "4",
2641
+ strokeLinecap: "round",
2642
+ strokeDasharray: "34.8 104.4",
2643
+ style: { transformOrigin: "center", animation: "pl-spin 0.9s linear infinite" }
2644
+ }
2645
+ )), /* @__PURE__ */ import_react27.default.createElement("span", { style: {
2646
+ position: "absolute",
2647
+ inset: 0,
2648
+ display: "flex",
2649
+ alignItems: "center",
2650
+ justifyContent: "center",
2651
+ fontSize: "11px",
2652
+ fontWeight: "700",
2653
+ color: accent
2654
+ } }, Math.round(progress), "%")), type === "dots" && /* @__PURE__ */ import_react27.default.createElement("div", { style: { display: "flex", gap: "10px", alignItems: "center" } }, [0, 1, 2].map((i) => /* @__PURE__ */ import_react27.default.createElement("div", { key: i, style: {
2655
+ width: "12px",
2656
+ height: "12px",
2657
+ borderRadius: "50%",
2658
+ background: accent,
2659
+ animation: `pl-dot 1.2s ease infinite`,
2660
+ animationDelay: `${i * 0.2}s`
2661
+ } }))), type === "pulse" && /* @__PURE__ */ import_react27.default.createElement("div", { style: { position: "relative", width: "56px", height: "56px" } }, [0, 1].map((i) => /* @__PURE__ */ import_react27.default.createElement("div", { key: i, style: {
2662
+ position: "absolute",
2663
+ inset: 0,
2664
+ borderRadius: "50%",
2665
+ background: alpha(accent, 0.3),
2666
+ animation: `pl-pulse 1.5s ease infinite`,
2667
+ animationDelay: `${i * 0.4}s`
2668
+ } })), /* @__PURE__ */ import_react27.default.createElement("div", { style: {
2669
+ position: "absolute",
2670
+ inset: "30%",
2671
+ borderRadius: "50%",
2672
+ background: accent
2673
+ } })), type === "ring" && /* @__PURE__ */ import_react27.default.createElement("div", { style: {
2674
+ width: "52px",
2675
+ height: "52px",
2676
+ borderRadius: "50%",
2677
+ border: `4px solid ${alpha(accent, 0.15)}`,
2678
+ borderTop: `4px solid ${accent}`,
2679
+ borderRight: `4px solid ${accent}`,
2680
+ animation: "pl-spin 0.9s linear infinite"
2681
+ } }), type === "bar" && /* @__PURE__ */ import_react27.default.createElement("div", { style: { width: "200px", display: "flex", flexDirection: "column", gap: "8px" } }, /* @__PURE__ */ import_react27.default.createElement("div", { style: {
2682
+ width: "100%",
2683
+ height: "4px",
2684
+ background: alpha(accent, 0.15),
2685
+ borderRadius: "2px",
2686
+ overflow: "hidden"
2687
+ } }, /* @__PURE__ */ import_react27.default.createElement("div", { style: {
2688
+ height: "100%",
2689
+ width: `${progress}%`,
2690
+ borderRadius: "2px",
2691
+ background: `linear-gradient(90deg, ${accent}, ${alpha(accent, 0.6)}, ${accent})`,
2692
+ backgroundSize: "200% 100%",
2693
+ animation: "pl-bar 1.2s linear infinite",
2694
+ transition: "width 0.03s linear"
2695
+ } })), /* @__PURE__ */ import_react27.default.createElement("div", { style: {
2696
+ display: "flex",
2697
+ justifyContent: "space-between",
2698
+ fontSize: "11px",
2699
+ color: "rgba(255,255,255,0.3)"
2700
+ } }, /* @__PURE__ */ import_react27.default.createElement("span", null, loadingText), /* @__PURE__ */ import_react27.default.createElement("span", null, Math.round(progress), "%")), subText && /* @__PURE__ */ import_react27.default.createElement("p", { style: { fontSize: "12px", color: "rgba(255,255,255,0.18)", margin: "4px 0 0", textAlign: "center" } }, subText)), type !== "bar" && /* @__PURE__ */ import_react27.default.createElement("div", { style: { textAlign: "center" } }, /* @__PURE__ */ import_react27.default.createElement("p", { style: { fontSize: "13px", color: "rgba(255,255,255,0.3)", margin: "0 0 4px" } }, loadingText), subText && /* @__PURE__ */ import_react27.default.createElement("p", { style: { fontSize: "12px", color: "rgba(255,255,255,0.15)", margin: 0 } }, subText))));
2701
+ };
2532
2702
  // Annotate the CommonJS export names for ESM import in node:
2533
2703
  0 && (module.exports = {
2534
2704
  Avatar,
@@ -2547,6 +2717,7 @@ var BackgoundImageSlider = ({
2547
2717
  Navbar,
2548
2718
  NotificationToast,
2549
2719
  OtpInput,
2720
+ PageLoader,
2550
2721
  PricingCard,
2551
2722
  ResponsiveNavbar,
2552
2723
  SearchBar,
package/dist/index.mjs CHANGED
@@ -2469,6 +2469,175 @@ var BackgoundImageSlider = ({
2469
2469
  }
2470
2470
  )))));
2471
2471
  };
2472
+
2473
+ // src/components/PageLoader/PageLoader.jsx
2474
+ import React27, { useState as useState20, useEffect as useEffect8 } from "react";
2475
+ var PageLoader = ({
2476
+ logo = "VirtualAI",
2477
+ accent = "#6366f1",
2478
+ bg = "",
2479
+ type = "spinner",
2480
+ loadingText = "Loading...",
2481
+ subText = "",
2482
+ duration = 6e3,
2483
+ onComplete = () => {
2484
+ }
2485
+ }) => {
2486
+ const [progress, setProgress] = useState20(0);
2487
+ const [done, setDone] = useState20(false);
2488
+ const alpha = (hex, op) => {
2489
+ const r = parseInt(hex.slice(1, 3), 16);
2490
+ const g = parseInt(hex.slice(3, 5), 16);
2491
+ const b = parseInt(hex.slice(5, 7), 16);
2492
+ return `rgba(${r},${g},${b},${op})`;
2493
+ };
2494
+ useEffect8(() => {
2495
+ const steps = 100;
2496
+ const interval = duration / steps;
2497
+ let current = 0;
2498
+ const timer = setInterval(() => {
2499
+ current += 1;
2500
+ setProgress(current);
2501
+ if (current >= 100) {
2502
+ clearInterval(timer);
2503
+ setTimeout(() => {
2504
+ setDone(true);
2505
+ onComplete();
2506
+ }, 300);
2507
+ }
2508
+ }, interval);
2509
+ return () => clearInterval(timer);
2510
+ }, [duration]);
2511
+ if (done) return null;
2512
+ return /* @__PURE__ */ React27.createElement(React27.Fragment, null, /* @__PURE__ */ React27.createElement("style", null, `
2513
+ @keyframes pl-spin { to { transform: rotate(360deg); } }
2514
+ @keyframes pl-pulse { 0%,100%{transform:scale(1);opacity:1} 50%{transform:scale(1.15);opacity:0.7} }
2515
+ @keyframes pl-dot { 0%,80%,100%{transform:scale(0.6);opacity:0.3} 40%{transform:scale(1);opacity:1} }
2516
+ @keyframes pl-fade { from{opacity:0;transform:translateY(10px)} to{opacity:1;transform:translateY(0)} }
2517
+ @keyframes pl-bar { 0%{background-position:0% 50%} 100%{background-position:200% 50%} }
2518
+ `), /* @__PURE__ */ React27.createElement("div", { style: {
2519
+ width: "100%",
2520
+ height: "100%",
2521
+ background: bg,
2522
+ display: "flex",
2523
+ flexDirection: "column",
2524
+ alignItems: "center",
2525
+ justifyContent: "center",
2526
+ gap: "28px",
2527
+ fontFamily: "system-ui, -apple-system, sans-serif",
2528
+ animation: "pl-fade 0.3s ease"
2529
+ } }, /* @__PURE__ */ React27.createElement("div", { style: {
2530
+ position: "absolute",
2531
+ top: "-100px",
2532
+ left: "-100px",
2533
+ width: "400px",
2534
+ height: "400px",
2535
+ borderRadius: "50%",
2536
+ background: `radial-gradient(circle, ${alpha(accent, 0.12)}, transparent 70%)`,
2537
+ filter: "blur(60px)",
2538
+ pointerEvents: "none"
2539
+ } }), /* @__PURE__ */ React27.createElement("div", { style: {
2540
+ position: "absolute",
2541
+ bottom: "-100px",
2542
+ right: "-100px",
2543
+ width: "350px",
2544
+ height: "350px",
2545
+ borderRadius: "50%",
2546
+ background: `radial-gradient(circle, ${alpha(accent, 0.08)}, transparent 70%)`,
2547
+ filter: "blur(60px)",
2548
+ pointerEvents: "none"
2549
+ } }), /* @__PURE__ */ React27.createElement("div", { style: { display: "flex", alignItems: "center", gap: "10px", animation: "pl-fade 0.4s ease" } }, /* @__PURE__ */ React27.createElement("div", { style: {
2550
+ width: "36px",
2551
+ height: "36px",
2552
+ borderRadius: "10px",
2553
+ background: `linear-gradient(135deg, ${accent}, ${alpha(accent, 0.6)})`,
2554
+ display: "flex",
2555
+ alignItems: "center",
2556
+ justifyContent: "center",
2557
+ fontSize: "16px",
2558
+ fontWeight: "800",
2559
+ color: "#fff",
2560
+ animation: type === "pulse" ? `pl-pulse 1.5s ease infinite` : "none"
2561
+ } }, logo[0]), /* @__PURE__ */ React27.createElement("span", { style: { fontSize: "20px", fontWeight: "800", color: "#fff", letterSpacing: "-0.5px" } }, logo)), type === "spinner" && /* @__PURE__ */ React27.createElement("div", { style: { position: "relative", width: "56px", height: "56px" } }, /* @__PURE__ */ React27.createElement("svg", { width: "56", height: "56", viewBox: "0 0 56 56" }, /* @__PURE__ */ React27.createElement(
2562
+ "circle",
2563
+ {
2564
+ cx: "28",
2565
+ cy: "28",
2566
+ r: "22",
2567
+ fill: "none",
2568
+ stroke: alpha(accent, 0.12),
2569
+ strokeWidth: "4"
2570
+ }
2571
+ ), /* @__PURE__ */ React27.createElement(
2572
+ "circle",
2573
+ {
2574
+ cx: "28",
2575
+ cy: "28",
2576
+ r: "22",
2577
+ fill: "none",
2578
+ stroke: accent,
2579
+ strokeWidth: "4",
2580
+ strokeLinecap: "round",
2581
+ strokeDasharray: "34.8 104.4",
2582
+ style: { transformOrigin: "center", animation: "pl-spin 0.9s linear infinite" }
2583
+ }
2584
+ )), /* @__PURE__ */ React27.createElement("span", { style: {
2585
+ position: "absolute",
2586
+ inset: 0,
2587
+ display: "flex",
2588
+ alignItems: "center",
2589
+ justifyContent: "center",
2590
+ fontSize: "11px",
2591
+ fontWeight: "700",
2592
+ color: accent
2593
+ } }, Math.round(progress), "%")), type === "dots" && /* @__PURE__ */ React27.createElement("div", { style: { display: "flex", gap: "10px", alignItems: "center" } }, [0, 1, 2].map((i) => /* @__PURE__ */ React27.createElement("div", { key: i, style: {
2594
+ width: "12px",
2595
+ height: "12px",
2596
+ borderRadius: "50%",
2597
+ background: accent,
2598
+ animation: `pl-dot 1.2s ease infinite`,
2599
+ animationDelay: `${i * 0.2}s`
2600
+ } }))), type === "pulse" && /* @__PURE__ */ React27.createElement("div", { style: { position: "relative", width: "56px", height: "56px" } }, [0, 1].map((i) => /* @__PURE__ */ React27.createElement("div", { key: i, style: {
2601
+ position: "absolute",
2602
+ inset: 0,
2603
+ borderRadius: "50%",
2604
+ background: alpha(accent, 0.3),
2605
+ animation: `pl-pulse 1.5s ease infinite`,
2606
+ animationDelay: `${i * 0.4}s`
2607
+ } })), /* @__PURE__ */ React27.createElement("div", { style: {
2608
+ position: "absolute",
2609
+ inset: "30%",
2610
+ borderRadius: "50%",
2611
+ background: accent
2612
+ } })), type === "ring" && /* @__PURE__ */ React27.createElement("div", { style: {
2613
+ width: "52px",
2614
+ height: "52px",
2615
+ borderRadius: "50%",
2616
+ border: `4px solid ${alpha(accent, 0.15)}`,
2617
+ borderTop: `4px solid ${accent}`,
2618
+ borderRight: `4px solid ${accent}`,
2619
+ animation: "pl-spin 0.9s linear infinite"
2620
+ } }), type === "bar" && /* @__PURE__ */ React27.createElement("div", { style: { width: "200px", display: "flex", flexDirection: "column", gap: "8px" } }, /* @__PURE__ */ React27.createElement("div", { style: {
2621
+ width: "100%",
2622
+ height: "4px",
2623
+ background: alpha(accent, 0.15),
2624
+ borderRadius: "2px",
2625
+ overflow: "hidden"
2626
+ } }, /* @__PURE__ */ React27.createElement("div", { style: {
2627
+ height: "100%",
2628
+ width: `${progress}%`,
2629
+ borderRadius: "2px",
2630
+ background: `linear-gradient(90deg, ${accent}, ${alpha(accent, 0.6)}, ${accent})`,
2631
+ backgroundSize: "200% 100%",
2632
+ animation: "pl-bar 1.2s linear infinite",
2633
+ transition: "width 0.03s linear"
2634
+ } })), /* @__PURE__ */ React27.createElement("div", { style: {
2635
+ display: "flex",
2636
+ justifyContent: "space-between",
2637
+ fontSize: "11px",
2638
+ color: "rgba(255,255,255,0.3)"
2639
+ } }, /* @__PURE__ */ React27.createElement("span", null, loadingText), /* @__PURE__ */ React27.createElement("span", null, Math.round(progress), "%")), subText && /* @__PURE__ */ React27.createElement("p", { style: { fontSize: "12px", color: "rgba(255,255,255,0.18)", margin: "4px 0 0", textAlign: "center" } }, subText)), type !== "bar" && /* @__PURE__ */ React27.createElement("div", { style: { textAlign: "center" } }, /* @__PURE__ */ React27.createElement("p", { style: { fontSize: "13px", color: "rgba(255,255,255,0.3)", margin: "0 0 4px" } }, loadingText), subText && /* @__PURE__ */ React27.createElement("p", { style: { fontSize: "12px", color: "rgba(255,255,255,0.15)", margin: 0 } }, subText))));
2640
+ };
2472
2641
  export {
2473
2642
  Avatar,
2474
2643
  AvatarCard,
@@ -2486,6 +2655,7 @@ export {
2486
2655
  Navbar,
2487
2656
  NotificationToast,
2488
2657
  OtpInput,
2658
+ PageLoader,
2489
2659
  PricingCard,
2490
2660
  ResponsiveNavbar,
2491
2661
  SearchBar,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "virtual-ui-lib",
3
- "version": "1.0.66",
3
+ "version": "1.0.67",
4
4
  "description": "Virtual UI React Component Library",
5
5
  "author": "Ankush",
6
6
  "license": "ISC",