virtual-ui-lib 1.0.10 → 1.0.12

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
@@ -35,6 +35,7 @@ __export(index_exports, {
35
35
  Badge: () => Badge,
36
36
  Button: () => Button,
37
37
  Card: () => Card,
38
+ CopyButton: () => CopyButton,
38
39
  Input: () => Input,
39
40
  Modal: () => Modal,
40
41
  ProgressBar: () => ProgressBar,
@@ -172,27 +173,22 @@ var Input = ({
172
173
  // src/components/Badge/Badge.jsx
173
174
  var import_react4 = __toESM(require("react"));
174
175
  var Badge = ({
175
- text = "Badge",
176
- bg = "#111",
177
- color = "white",
178
- radius = "12px",
179
- padding = "4px 10px",
180
- size = "12px"
176
+ text = "NEW",
177
+ color = "#ffffff",
178
+ bgColor = "#2563eb",
179
+ radius = "12px"
181
180
  }) => {
182
- return /* @__PURE__ */ import_react4.default.createElement(
183
- "span",
184
- {
185
- style: {
186
- background: bg,
187
- color,
188
- padding,
189
- borderRadius: radius,
190
- fontSize: size,
191
- display: "inline-block"
192
- }
193
- },
194
- text
195
- );
181
+ return /* @__PURE__ */ import_react4.default.createElement("div", { style: {
182
+ background: bgColor,
183
+ color,
184
+ borderRadius: radius,
185
+ padding: "8px 12px",
186
+ fontSize: "14px",
187
+ fontWeight: "600",
188
+ display: "inline-block",
189
+ boxShadow: "0 4px 10px rgba(0,0,0,0.2)",
190
+ fontFamily: "system-ui, sans-serif"
191
+ } }, text);
196
192
  };
197
193
 
198
194
  // src/components/Alert/Alert.jsx
@@ -387,6 +383,50 @@ var AnimatedButton = ({
387
383
  loading ? "Loading..." : text
388
384
  );
389
385
  };
386
+
387
+ // src/components/CopyButton/CopyButton.jsx
388
+ var import_react11 = __toESM(require("react"));
389
+ var CopyButton = ({
390
+ text = "Copy",
391
+ copyText = "Hello, World!",
392
+ successMessage = "Copied!",
393
+ bg = "#059669",
394
+ successBg = "#7c3aed",
395
+ color = "white",
396
+ radius = "12px",
397
+ padding = "10px 20px",
398
+ onCopy
399
+ }) => {
400
+ const [copied, setCopied] = (0, import_react11.useState)(false);
401
+ const handleCopy = () => {
402
+ navigator.clipboard.writeText(copyText);
403
+ setCopied(true);
404
+ if (onCopy) onCopy();
405
+ setTimeout(() => setCopied(false), 2e3);
406
+ };
407
+ return /* @__PURE__ */ import_react11.default.createElement(
408
+ "button",
409
+ {
410
+ onClick: handleCopy,
411
+ style: {
412
+ background: copied ? successBg : bg,
413
+ color,
414
+ border: "none",
415
+ borderRadius: radius,
416
+ padding,
417
+ cursor: "pointer",
418
+ fontWeight: "600",
419
+ fontSize: "16px",
420
+ transition: "background 0.3s ease",
421
+ display: "flex",
422
+ alignItems: "center",
423
+ justifyContent: "center",
424
+ filter: copied ? "brightness(0.9)" : "none"
425
+ }
426
+ },
427
+ copied ? successMessage : text
428
+ );
429
+ };
390
430
  // Annotate the CommonJS export names for ESM import in node:
391
431
  0 && (module.exports = {
392
432
  Alert,
@@ -395,6 +435,7 @@ var AnimatedButton = ({
395
435
  Badge,
396
436
  Button,
397
437
  Card,
438
+ CopyButton,
398
439
  Input,
399
440
  Modal,
400
441
  ProgressBar,
package/dist/index.mjs CHANGED
@@ -128,27 +128,22 @@ var Input = ({
128
128
  // src/components/Badge/Badge.jsx
129
129
  import React4 from "react";
130
130
  var Badge = ({
131
- text = "Badge",
132
- bg = "#111",
133
- color = "white",
134
- radius = "12px",
135
- padding = "4px 10px",
136
- size = "12px"
131
+ text = "NEW",
132
+ color = "#ffffff",
133
+ bgColor = "#2563eb",
134
+ radius = "12px"
137
135
  }) => {
138
- return /* @__PURE__ */ React4.createElement(
139
- "span",
140
- {
141
- style: {
142
- background: bg,
143
- color,
144
- padding,
145
- borderRadius: radius,
146
- fontSize: size,
147
- display: "inline-block"
148
- }
149
- },
150
- text
151
- );
136
+ return /* @__PURE__ */ React4.createElement("div", { style: {
137
+ background: bgColor,
138
+ color,
139
+ borderRadius: radius,
140
+ padding: "8px 12px",
141
+ fontSize: "14px",
142
+ fontWeight: "600",
143
+ display: "inline-block",
144
+ boxShadow: "0 4px 10px rgba(0,0,0,0.2)",
145
+ fontFamily: "system-ui, sans-serif"
146
+ } }, text);
152
147
  };
153
148
 
154
149
  // src/components/Alert/Alert.jsx
@@ -343,6 +338,50 @@ var AnimatedButton = ({
343
338
  loading ? "Loading..." : text
344
339
  );
345
340
  };
341
+
342
+ // src/components/CopyButton/CopyButton.jsx
343
+ import React11, { useState } from "react";
344
+ var CopyButton = ({
345
+ text = "Copy",
346
+ copyText = "Hello, World!",
347
+ successMessage = "Copied!",
348
+ bg = "#059669",
349
+ successBg = "#7c3aed",
350
+ color = "white",
351
+ radius = "12px",
352
+ padding = "10px 20px",
353
+ onCopy
354
+ }) => {
355
+ const [copied, setCopied] = useState(false);
356
+ const handleCopy = () => {
357
+ navigator.clipboard.writeText(copyText);
358
+ setCopied(true);
359
+ if (onCopy) onCopy();
360
+ setTimeout(() => setCopied(false), 2e3);
361
+ };
362
+ return /* @__PURE__ */ React11.createElement(
363
+ "button",
364
+ {
365
+ onClick: handleCopy,
366
+ style: {
367
+ background: copied ? successBg : bg,
368
+ color,
369
+ border: "none",
370
+ borderRadius: radius,
371
+ padding,
372
+ cursor: "pointer",
373
+ fontWeight: "600",
374
+ fontSize: "16px",
375
+ transition: "background 0.3s ease",
376
+ display: "flex",
377
+ alignItems: "center",
378
+ justifyContent: "center",
379
+ filter: copied ? "brightness(0.9)" : "none"
380
+ }
381
+ },
382
+ copied ? successMessage : text
383
+ );
384
+ };
346
385
  export {
347
386
  Alert,
348
387
  AnimatedButton,
@@ -350,6 +389,7 @@ export {
350
389
  Badge,
351
390
  Button,
352
391
  Card,
392
+ CopyButton,
353
393
  Input,
354
394
  Modal,
355
395
  ProgressBar,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "virtual-ui-lib",
3
- "version": "1.0.10",
3
+ "version": "1.0.12",
4
4
  "description": "Virtual UI React Component Library",
5
5
  "author": "Ankush",
6
6
  "license": "ISC",