virtual-ui-lib 1.0.21 → 1.0.23

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
@@ -32,11 +32,13 @@ __export(index_exports, {
32
32
  AlertBanner: () => AlertBanner,
33
33
  Button: () => Button,
34
34
  Card: () => Card,
35
+ CopyButton: () => CopyButton,
35
36
  Dropdown: () => Dropdown,
36
37
  EmptyState: () => EmptyState,
37
38
  FormInput: () => FormInput,
38
39
  GridLayout: () => GridLayout,
39
40
  ImageUploadPreview: () => ImageUploadPreview,
41
+ Loader: () => Loader,
40
42
  Navbar: () => Navbar
41
43
  });
42
44
  module.exports = __toCommonJS(index_exports);
@@ -555,15 +557,107 @@ var ImageUploadPreview = ({
555
557
  transition: "background 0.3s"
556
558
  }, onMouseEnter: (e) => e.currentTarget.style.background = "rgba(255,255,255,1)", onMouseLeave: (e) => e.currentTarget.style.background = "rgba(255,255,255,0.8)" }, "\xD7"));
557
559
  };
560
+
561
+ // src/components/CopyButton/CopyButton.jsx
562
+ var import_react10 = __toESM(require("react"));
563
+ var CopyButton = ({
564
+ text = "Copy",
565
+ bg = "#2563eb",
566
+ color = "white",
567
+ radius = "8px",
568
+ icon = /* @__PURE__ */ import_react10.default.createElement("span", { role: "img", "aria-label": "copy" }, "\u{1F4CB}"),
569
+ padding = "10px 15px",
570
+ shadow = "0 4px 14px rgba(37,99,235,0.4)"
571
+ }) => {
572
+ const [copied, setCopied] = (0, import_react10.useState)(false);
573
+ const handleCopy = () => {
574
+ navigator.clipboard.writeText(text);
575
+ setCopied(true);
576
+ setTimeout(() => setCopied(false), 2e3);
577
+ };
578
+ return /* @__PURE__ */ import_react10.default.createElement(
579
+ "button",
580
+ {
581
+ onClick: handleCopy,
582
+ style: {
583
+ background: bg,
584
+ color,
585
+ border: "none",
586
+ borderRadius: radius,
587
+ padding,
588
+ cursor: "pointer",
589
+ fontWeight: "600",
590
+ boxShadow: shadow,
591
+ display: "flex",
592
+ alignItems: "center",
593
+ gap: "8px",
594
+ transition: "background 0.3s"
595
+ }
596
+ },
597
+ icon,
598
+ copied ? "Copied!" : text
599
+ );
600
+ };
601
+
602
+ // src/components/Loader/Loader.jsx
603
+ var import_react11 = __toESM(require("react"));
604
+ var Loader = ({
605
+ size = "medium",
606
+ fullScreen = false,
607
+ color = "#7c3aed",
608
+ backgroundColor = "#0f172a",
609
+ duration = "1s"
610
+ }) => {
611
+ const sizes = { small: "40px", medium: "60px", large: "80px" };
612
+ const [fadeIn, setFadeIn] = (0, import_react11.useState)(false);
613
+ (0, import_react11.useEffect)(() => {
614
+ setFadeIn(true);
615
+ }, []);
616
+ return /* @__PURE__ */ import_react11.default.createElement(
617
+ "div",
618
+ {
619
+ style: {
620
+ display: "flex",
621
+ justifyContent: "center",
622
+ alignItems: "center",
623
+ height: fullScreen ? "100vh" : "auto",
624
+ background: fullScreen ? backgroundColor : "transparent",
625
+ transition: "opacity 0.5s",
626
+ opacity: fadeIn ? 1 : 0
627
+ }
628
+ },
629
+ /* @__PURE__ */ import_react11.default.createElement(
630
+ "div",
631
+ {
632
+ style: {
633
+ width: sizes[size],
634
+ height: sizes[size],
635
+ border: `8px solid ${color}`,
636
+ borderTop: `8px solid transparent`,
637
+ borderRadius: "50%",
638
+ animation: `spin ${duration} linear infinite`
639
+ }
640
+ }
641
+ ),
642
+ /* @__PURE__ */ import_react11.default.createElement("style", null, `
643
+ @keyframes spin {
644
+ 0% { transform: rotate(0deg); }
645
+ 100% { transform: rotate(360deg); }
646
+ }
647
+ `)
648
+ );
649
+ };
558
650
  // Annotate the CommonJS export names for ESM import in node:
559
651
  0 && (module.exports = {
560
652
  AlertBanner,
561
653
  Button,
562
654
  Card,
655
+ CopyButton,
563
656
  Dropdown,
564
657
  EmptyState,
565
658
  FormInput,
566
659
  GridLayout,
567
660
  ImageUploadPreview,
661
+ Loader,
568
662
  Navbar
569
663
  });
package/dist/index.mjs CHANGED
@@ -512,14 +512,106 @@ var ImageUploadPreview = ({
512
512
  transition: "background 0.3s"
513
513
  }, onMouseEnter: (e) => e.currentTarget.style.background = "rgba(255,255,255,1)", onMouseLeave: (e) => e.currentTarget.style.background = "rgba(255,255,255,0.8)" }, "\xD7"));
514
514
  };
515
+
516
+ // src/components/CopyButton/CopyButton.jsx
517
+ import React10, { useState as useState7 } from "react";
518
+ var CopyButton = ({
519
+ text = "Copy",
520
+ bg = "#2563eb",
521
+ color = "white",
522
+ radius = "8px",
523
+ icon = /* @__PURE__ */ React10.createElement("span", { role: "img", "aria-label": "copy" }, "\u{1F4CB}"),
524
+ padding = "10px 15px",
525
+ shadow = "0 4px 14px rgba(37,99,235,0.4)"
526
+ }) => {
527
+ const [copied, setCopied] = useState7(false);
528
+ const handleCopy = () => {
529
+ navigator.clipboard.writeText(text);
530
+ setCopied(true);
531
+ setTimeout(() => setCopied(false), 2e3);
532
+ };
533
+ return /* @__PURE__ */ React10.createElement(
534
+ "button",
535
+ {
536
+ onClick: handleCopy,
537
+ style: {
538
+ background: bg,
539
+ color,
540
+ border: "none",
541
+ borderRadius: radius,
542
+ padding,
543
+ cursor: "pointer",
544
+ fontWeight: "600",
545
+ boxShadow: shadow,
546
+ display: "flex",
547
+ alignItems: "center",
548
+ gap: "8px",
549
+ transition: "background 0.3s"
550
+ }
551
+ },
552
+ icon,
553
+ copied ? "Copied!" : text
554
+ );
555
+ };
556
+
557
+ // src/components/Loader/Loader.jsx
558
+ import React11, { useEffect as useEffect5, useState as useState8 } from "react";
559
+ var Loader = ({
560
+ size = "medium",
561
+ fullScreen = false,
562
+ color = "#7c3aed",
563
+ backgroundColor = "#0f172a",
564
+ duration = "1s"
565
+ }) => {
566
+ const sizes = { small: "40px", medium: "60px", large: "80px" };
567
+ const [fadeIn, setFadeIn] = useState8(false);
568
+ useEffect5(() => {
569
+ setFadeIn(true);
570
+ }, []);
571
+ return /* @__PURE__ */ React11.createElement(
572
+ "div",
573
+ {
574
+ style: {
575
+ display: "flex",
576
+ justifyContent: "center",
577
+ alignItems: "center",
578
+ height: fullScreen ? "100vh" : "auto",
579
+ background: fullScreen ? backgroundColor : "transparent",
580
+ transition: "opacity 0.5s",
581
+ opacity: fadeIn ? 1 : 0
582
+ }
583
+ },
584
+ /* @__PURE__ */ React11.createElement(
585
+ "div",
586
+ {
587
+ style: {
588
+ width: sizes[size],
589
+ height: sizes[size],
590
+ border: `8px solid ${color}`,
591
+ borderTop: `8px solid transparent`,
592
+ borderRadius: "50%",
593
+ animation: `spin ${duration} linear infinite`
594
+ }
595
+ }
596
+ ),
597
+ /* @__PURE__ */ React11.createElement("style", null, `
598
+ @keyframes spin {
599
+ 0% { transform: rotate(0deg); }
600
+ 100% { transform: rotate(360deg); }
601
+ }
602
+ `)
603
+ );
604
+ };
515
605
  export {
516
606
  AlertBanner,
517
607
  Button,
518
608
  Card,
609
+ CopyButton,
519
610
  Dropdown,
520
611
  EmptyState,
521
612
  FormInput,
522
613
  GridLayout,
523
614
  ImageUploadPreview,
615
+ Loader,
524
616
  Navbar
525
617
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "virtual-ui-lib",
3
- "version": "1.0.21",
3
+ "version": "1.0.23",
4
4
  "description": "Virtual UI React Component Library",
5
5
  "author": "Ankush",
6
6
  "license": "ISC",