virtual-ui-lib 1.0.21 → 1.0.22

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,6 +32,7 @@ __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,
@@ -555,11 +556,53 @@ var ImageUploadPreview = ({
555
556
  transition: "background 0.3s"
556
557
  }, 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
558
  };
559
+
560
+ // src/components/CopyButton/CopyButton.jsx
561
+ var import_react10 = __toESM(require("react"));
562
+ var CopyButton = ({
563
+ text = "Copy",
564
+ bg = "#2563eb",
565
+ color = "white",
566
+ radius = "8px",
567
+ icon = /* @__PURE__ */ import_react10.default.createElement("span", { role: "img", "aria-label": "copy" }, "\u{1F4CB}"),
568
+ padding = "10px 15px",
569
+ shadow = "0 4px 14px rgba(37,99,235,0.4)"
570
+ }) => {
571
+ const [copied, setCopied] = (0, import_react10.useState)(false);
572
+ const handleCopy = () => {
573
+ navigator.clipboard.writeText(text);
574
+ setCopied(true);
575
+ setTimeout(() => setCopied(false), 2e3);
576
+ };
577
+ return /* @__PURE__ */ import_react10.default.createElement(
578
+ "button",
579
+ {
580
+ onClick: handleCopy,
581
+ style: {
582
+ background: bg,
583
+ color,
584
+ border: "none",
585
+ borderRadius: radius,
586
+ padding,
587
+ cursor: "pointer",
588
+ fontWeight: "600",
589
+ boxShadow: shadow,
590
+ display: "flex",
591
+ alignItems: "center",
592
+ gap: "8px",
593
+ transition: "background 0.3s"
594
+ }
595
+ },
596
+ icon,
597
+ copied ? "Copied!" : text
598
+ );
599
+ };
558
600
  // Annotate the CommonJS export names for ESM import in node:
559
601
  0 && (module.exports = {
560
602
  AlertBanner,
561
603
  Button,
562
604
  Card,
605
+ CopyButton,
563
606
  Dropdown,
564
607
  EmptyState,
565
608
  FormInput,
package/dist/index.mjs CHANGED
@@ -512,10 +512,52 @@ 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
+ };
515
556
  export {
516
557
  AlertBanner,
517
558
  Button,
518
559
  Card,
560
+ CopyButton,
519
561
  Dropdown,
520
562
  EmptyState,
521
563
  FormInput,
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.22",
4
4
  "description": "Virtual UI React Component Library",
5
5
  "author": "Ankush",
6
6
  "license": "ISC",