virtual-ui-lib 1.0.12 → 1.0.13

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.
Files changed (3) hide show
  1. package/dist/index.js +42 -401
  2. package/dist/index.mjs +43 -392
  3. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -29,415 +29,56 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
29
29
  // src/index.js
30
30
  var index_exports = {};
31
31
  __export(index_exports, {
32
- Alert: () => Alert,
33
- AnimatedButton: () => AnimatedButton,
34
- Avatar: () => Avatar,
35
- Badge: () => Badge,
36
- Button: () => Button,
37
- Card: () => Card,
38
- CopyButton: () => CopyButton,
39
- Input: () => Input,
40
- Modal: () => Modal,
41
- ProgressBar: () => ProgressBar,
42
- Spinner: () => Spinner
32
+ AlertBanner: () => AlertBanner
43
33
  });
44
34
  module.exports = __toCommonJS(index_exports);
45
35
 
46
- // src/components/Button/Button.jsx
36
+ // src/components/AlertBanner/AlertBanner.jsx
47
37
  var import_react = __toESM(require("react"));
48
- var Button = ({
49
- text = "Button",
50
- bg = "#2563eb",
51
- color = "white",
52
- size = "md",
53
- width = "auto",
54
- radius = "6px",
55
- border = "none",
56
- weight = "500",
57
- shadow = "none",
58
- disabled = false,
59
- loading = false,
60
- icon = null,
61
- onClick
38
+ var AlertBanner = ({
39
+ message = "This is an alert message.",
40
+ type = "info",
41
+ onDismiss
62
42
  }) => {
63
- const sizes = {
64
- sm: "6px 12px",
65
- md: "8px 16px",
66
- lg: "12px 20px"
43
+ const [visible, setVisible] = (0, import_react.useState)(true);
44
+ const [fade, setFade] = (0, import_react.useState)(false);
45
+ const colors = {
46
+ success: { background: "#059669", color: "white" },
47
+ error: { background: "#dc2626", color: "white" },
48
+ warning: { background: "#f59e0b", color: "black" },
49
+ info: { background: "#2563eb", color: "white" }
67
50
  };
68
- return /* @__PURE__ */ import_react.default.createElement(
69
- "button",
70
- {
71
- onClick,
72
- disabled: disabled || loading,
73
- style: {
74
- background: bg,
75
- color,
76
- padding: sizes[size],
77
- width,
78
- border,
79
- borderRadius: radius,
80
- cursor: disabled ? "not-allowed" : "pointer",
81
- fontWeight: weight,
82
- boxShadow: shadow,
83
- opacity: disabled ? 0.6 : 1,
84
- display: "flex",
85
- alignItems: "center",
86
- gap: "6px",
87
- justifyContent: "center"
88
- }
89
- },
90
- loading ? "Loading..." : /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, icon, text)
91
- );
92
- };
93
-
94
- // src/components/Card/Card.jsx
95
- var import_react2 = __toESM(require("react"));
96
- var Card = ({
97
- title = "Card Title",
98
- text = "Card description",
99
- width = "250px",
100
- bg = "white",
101
- border = "1px solid #eee",
102
- radius = "8px",
103
- padding = "16px",
104
- shadow = "0 2px 6px rgba(0,0,0,0.05)",
105
- titleSize = "18px",
106
- textSize = "14px",
107
- align = "left",
108
- children
109
- }) => {
110
- return /* @__PURE__ */ import_react2.default.createElement(
111
- "div",
112
- {
113
- style: {
114
- width,
115
- background: bg,
116
- border,
117
- borderRadius: radius,
118
- padding,
119
- boxShadow: shadow,
120
- textAlign: align
121
- }
122
- },
123
- /* @__PURE__ */ import_react2.default.createElement("h3", { style: { fontSize: titleSize, marginBottom: "8px" } }, title),
124
- /* @__PURE__ */ import_react2.default.createElement("p", { style: { fontSize: textSize, marginBottom: "10px" } }, text),
125
- children
126
- );
127
- };
128
-
129
- // src/components/Input/Input.jsx
130
- var import_react3 = __toESM(require("react"));
131
- var Input = ({
132
- placeholder = "Enter text",
133
- type = "text",
134
- width = "200px",
135
- bg = "white",
136
- color = "#111",
137
- border = "1px solid #ccc",
138
- radius = "6px",
139
- shadow = "none",
140
- size = "md",
141
- disabled = false,
142
- value,
143
- onChange
144
- }) => {
145
- const sizes = {
146
- sm: "6px",
147
- md: "8px",
148
- lg: "12px"
149
- };
150
- return /* @__PURE__ */ import_react3.default.createElement(
151
- "input",
152
- {
153
- type,
154
- placeholder,
155
- value,
156
- onChange,
157
- disabled,
158
- style: {
159
- width,
160
- padding: sizes[size],
161
- background: bg,
162
- color,
163
- border,
164
- borderRadius: radius,
165
- boxShadow: shadow,
166
- outline: "none",
167
- opacity: disabled ? 0.6 : 1
168
- }
169
- }
170
- );
171
- };
172
-
173
- // src/components/Badge/Badge.jsx
174
- var import_react4 = __toESM(require("react"));
175
- var Badge = ({
176
- text = "NEW",
177
- color = "#ffffff",
178
- bgColor = "#2563eb",
179
- radius = "12px"
180
- }) => {
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);
192
- };
193
-
194
- // src/components/Alert/Alert.jsx
195
- var import_react5 = __toESM(require("react"));
196
- var Alert = ({
197
- text = "Alert message",
198
- bg = "#facc15",
199
- color = "#111",
200
- radius = "6px",
201
- padding = "10px",
202
- width = "auto"
203
- }) => {
204
- return /* @__PURE__ */ import_react5.default.createElement(
205
- "div",
206
- {
207
- style: {
208
- background: bg,
209
- color,
210
- padding,
211
- borderRadius: radius,
212
- width
213
- }
214
- },
215
- text
216
- );
217
- };
218
-
219
- // src/components/Avatar/Avatar.jsx
220
- var import_react6 = __toESM(require("react"));
221
- var Avatar = ({
222
- src = "\u{1F464}",
223
- size = "40px",
224
- radius = "50%"
225
- }) => {
226
- return /* @__PURE__ */ import_react6.default.createElement(
227
- "img",
228
- {
229
- src,
230
- alt: "avatar",
231
- style: {
232
- width: size,
233
- height: size,
234
- borderRadius: radius,
235
- objectFit: "cover"
236
- }
237
- }
238
- );
239
- };
240
-
241
- // src/components/Spinner/Spinner.jsx
242
- var import_react7 = __toESM(require("react"));
243
- var Spinner = ({
244
- size = "30px",
245
- color = "#2563eb",
246
- border = "3px"
247
- }) => {
248
- return /* @__PURE__ */ import_react7.default.createElement(import_react7.default.Fragment, null, /* @__PURE__ */ import_react7.default.createElement("style", null, `
249
- @keyframes vui-spin {
250
- to {
251
- transform: rotate(360deg);
252
- }
253
- }
254
- `), /* @__PURE__ */ import_react7.default.createElement(
255
- "div",
256
- {
257
- style: {
258
- width: size,
259
- height: size,
260
- border: `${border} solid #eee`,
261
- borderTop: `${border} solid ${color}`,
262
- borderRadius: "50%",
263
- animation: "vui-spin 1s linear infinite"
264
- }
51
+ (0, import_react.useEffect)(() => {
52
+ if (!visible) {
53
+ setFade(true);
54
+ const timeout = setTimeout(() => onDismiss && onDismiss(), 300);
55
+ return () => clearTimeout(timeout);
265
56
  }
266
- ));
267
- };
268
-
269
- // src/components/Modal/Modal.jsx
270
- var import_react8 = __toESM(require("react"));
271
- var Modal = ({
272
- open = false,
273
- title = "Modal Title",
274
- children,
275
- width = "300px",
276
- bg = "white",
277
- radius = "8px",
278
- onClose
279
- }) => {
280
- if (!open) return null;
281
- return /* @__PURE__ */ import_react8.default.createElement(
282
- "div",
283
- {
284
- style: {
285
- position: "fixed",
286
- top: 0,
287
- left: 0,
288
- width: "100%",
289
- height: "100%",
290
- background: "rgba(0,0,0,0.3)",
291
- display: "flex",
292
- alignItems: "center",
293
- justifyContent: "center"
294
- }
295
- },
296
- /* @__PURE__ */ import_react8.default.createElement(
297
- "div",
298
- {
299
- style: {
300
- width,
301
- background: bg,
302
- borderRadius: radius,
303
- padding: "20px"
304
- }
305
- },
306
- /* @__PURE__ */ import_react8.default.createElement("h3", null, title),
307
- children,
308
- /* @__PURE__ */ import_react8.default.createElement("button", { onClick: onClose }, "Close")
309
- )
310
- );
311
- };
312
-
313
- // src/components/ProgressBar/ProgressBar.jsx
314
- var import_react9 = __toESM(require("react"));
315
- var ProgressBar = ({
316
- progress = 50,
317
- height = "20px",
318
- bgColor = "#2563eb",
319
- trackColor = "#d1d5db",
320
- radius = "10px",
321
- label = "Progress",
322
- textColor = "#ffffff"
323
- }) => {
324
- return /* @__PURE__ */ import_react9.default.createElement("div", { style: { width: "100%", background: trackColor, borderRadius: radius, overflow: "hidden" } }, /* @__PURE__ */ import_react9.default.createElement("div", { style: {
325
- width: progress + "%",
326
- height,
327
- background: bgColor,
328
- borderRadius: radius,
329
- display: "flex",
330
- alignItems: "center",
331
- justifyContent: "center",
332
- position: "relative"
333
- } }, /* @__PURE__ */ import_react9.default.createElement("span", { style: { color: textColor, fontWeight: "600", fontSize: "14px" } }, label, ": ", progress, "%")));
334
- };
335
-
336
- // src/components/AnimatedButton/AnimatedButton.jsx
337
- var import_react10 = __toESM(require("react"));
338
- var AnimatedButton = ({
339
- text = "Click Me",
340
- gradient = "linear-gradient(45deg, #2563eb, #7c3aed)",
341
- color = "white",
342
- size = "md",
343
- width = "auto",
344
- radius = "12px",
345
- shadow = "0 4px 14px rgba(0, 0, 0, 0.2)",
346
- loading = false,
347
- onClick
348
- }) => {
349
- const sizes = { sm: "8px 16px", md: "12px 24px", lg: "16px 32px" };
350
- const handleMouseEnter = (e) => {
351
- e.target.style.transform = "scale(1.05)";
352
- };
353
- const handleMouseLeave = (e) => {
354
- e.target.style.transform = "scale(1)";
355
- };
356
- return /* @__PURE__ */ import_react10.default.createElement(
357
- "button",
358
- {
359
- onClick,
360
- onMouseEnter: handleMouseEnter,
361
- onMouseLeave: handleMouseLeave,
362
- disabled: loading,
363
- style: {
364
- background: gradient,
365
- color,
366
- padding: sizes[size],
367
- width,
368
- border: "none",
369
- borderRadius: radius,
370
- boxShadow: shadow,
371
- cursor: loading ? "not-allowed" : "pointer",
372
- fontWeight: "600",
373
- fontSize: "15px",
374
- transition: "transform 0.3s, box-shadow 0.3s",
375
- fontFamily: "system-ui, sans-serif",
376
- opacity: loading ? 0.6 : 1,
377
- display: "flex",
378
- alignItems: "center",
379
- justifyContent: "center",
380
- gap: "8px"
381
- }
382
- },
383
- loading ? "Loading..." : text
384
- );
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
- );
57
+ }, [visible, onDismiss]);
58
+ return /* @__PURE__ */ import_react.default.createElement("div", { style: {
59
+ position: "relative",
60
+ width: "100%",
61
+ background: colors[type].background,
62
+ color: colors[type].color,
63
+ padding: "16px 24px",
64
+ borderRadius: "8px",
65
+ boxShadow: "0 2px 10px rgba(0,0,0,0.2)",
66
+ transition: "opacity 0.3s ease, transform 0.3s ease",
67
+ transform: `translateY(${visible ? "0" : "-20px"})`,
68
+ opacity: fade ? 0 : 1,
69
+ zIndex: 1e3
70
+ }, className: visible ? "slide-down" : "fade-out" }, message, /* @__PURE__ */ import_react.default.createElement("button", { onClick: () => setVisible(false), style: {
71
+ position: "absolute",
72
+ top: "10px",
73
+ right: "10px",
74
+ background: "transparent",
75
+ color: "inherit",
76
+ border: "none",
77
+ cursor: "pointer",
78
+ fontSize: "16px"
79
+ } }, "\u2715"));
429
80
  };
430
81
  // Annotate the CommonJS export names for ESM import in node:
431
82
  0 && (module.exports = {
432
- Alert,
433
- AnimatedButton,
434
- Avatar,
435
- Badge,
436
- Button,
437
- Card,
438
- CopyButton,
439
- Input,
440
- Modal,
441
- ProgressBar,
442
- Spinner
83
+ AlertBanner
443
84
  });
package/dist/index.mjs CHANGED
@@ -1,397 +1,48 @@
1
- // src/components/Button/Button.jsx
2
- import React from "react";
3
- var Button = ({
4
- text = "Button",
5
- bg = "#2563eb",
6
- color = "white",
7
- size = "md",
8
- width = "auto",
9
- radius = "6px",
10
- border = "none",
11
- weight = "500",
12
- shadow = "none",
13
- disabled = false,
14
- loading = false,
15
- icon = null,
16
- onClick
17
- }) => {
18
- const sizes = {
19
- sm: "6px 12px",
20
- md: "8px 16px",
21
- lg: "12px 20px"
1
+ // src/components/AlertBanner/AlertBanner.jsx
2
+ import React, { useState, useEffect } from "react";
3
+ var AlertBanner = ({
4
+ message = "This is an alert message.",
5
+ type = "info",
6
+ onDismiss
7
+ }) => {
8
+ const [visible, setVisible] = useState(true);
9
+ const [fade, setFade] = useState(false);
10
+ const colors = {
11
+ success: { background: "#059669", color: "white" },
12
+ error: { background: "#dc2626", color: "white" },
13
+ warning: { background: "#f59e0b", color: "black" },
14
+ info: { background: "#2563eb", color: "white" }
22
15
  };
23
- return /* @__PURE__ */ React.createElement(
24
- "button",
25
- {
26
- onClick,
27
- disabled: disabled || loading,
28
- style: {
29
- background: bg,
30
- color,
31
- padding: sizes[size],
32
- width,
33
- border,
34
- borderRadius: radius,
35
- cursor: disabled ? "not-allowed" : "pointer",
36
- fontWeight: weight,
37
- boxShadow: shadow,
38
- opacity: disabled ? 0.6 : 1,
39
- display: "flex",
40
- alignItems: "center",
41
- gap: "6px",
42
- justifyContent: "center"
43
- }
44
- },
45
- loading ? "Loading..." : /* @__PURE__ */ React.createElement(React.Fragment, null, icon, text)
46
- );
47
- };
48
-
49
- // src/components/Card/Card.jsx
50
- import React2 from "react";
51
- var Card = ({
52
- title = "Card Title",
53
- text = "Card description",
54
- width = "250px",
55
- bg = "white",
56
- border = "1px solid #eee",
57
- radius = "8px",
58
- padding = "16px",
59
- shadow = "0 2px 6px rgba(0,0,0,0.05)",
60
- titleSize = "18px",
61
- textSize = "14px",
62
- align = "left",
63
- children
64
- }) => {
65
- return /* @__PURE__ */ React2.createElement(
66
- "div",
67
- {
68
- style: {
69
- width,
70
- background: bg,
71
- border,
72
- borderRadius: radius,
73
- padding,
74
- boxShadow: shadow,
75
- textAlign: align
76
- }
77
- },
78
- /* @__PURE__ */ React2.createElement("h3", { style: { fontSize: titleSize, marginBottom: "8px" } }, title),
79
- /* @__PURE__ */ React2.createElement("p", { style: { fontSize: textSize, marginBottom: "10px" } }, text),
80
- children
81
- );
82
- };
83
-
84
- // src/components/Input/Input.jsx
85
- import React3 from "react";
86
- var Input = ({
87
- placeholder = "Enter text",
88
- type = "text",
89
- width = "200px",
90
- bg = "white",
91
- color = "#111",
92
- border = "1px solid #ccc",
93
- radius = "6px",
94
- shadow = "none",
95
- size = "md",
96
- disabled = false,
97
- value,
98
- onChange
99
- }) => {
100
- const sizes = {
101
- sm: "6px",
102
- md: "8px",
103
- lg: "12px"
104
- };
105
- return /* @__PURE__ */ React3.createElement(
106
- "input",
107
- {
108
- type,
109
- placeholder,
110
- value,
111
- onChange,
112
- disabled,
113
- style: {
114
- width,
115
- padding: sizes[size],
116
- background: bg,
117
- color,
118
- border,
119
- borderRadius: radius,
120
- boxShadow: shadow,
121
- outline: "none",
122
- opacity: disabled ? 0.6 : 1
123
- }
124
- }
125
- );
126
- };
127
-
128
- // src/components/Badge/Badge.jsx
129
- import React4 from "react";
130
- var Badge = ({
131
- text = "NEW",
132
- color = "#ffffff",
133
- bgColor = "#2563eb",
134
- radius = "12px"
135
- }) => {
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);
147
- };
148
-
149
- // src/components/Alert/Alert.jsx
150
- import React5 from "react";
151
- var Alert = ({
152
- text = "Alert message",
153
- bg = "#facc15",
154
- color = "#111",
155
- radius = "6px",
156
- padding = "10px",
157
- width = "auto"
158
- }) => {
159
- return /* @__PURE__ */ React5.createElement(
160
- "div",
161
- {
162
- style: {
163
- background: bg,
164
- color,
165
- padding,
166
- borderRadius: radius,
167
- width
168
- }
169
- },
170
- text
171
- );
172
- };
173
-
174
- // src/components/Avatar/Avatar.jsx
175
- import React6 from "react";
176
- var Avatar = ({
177
- src = "\u{1F464}",
178
- size = "40px",
179
- radius = "50%"
180
- }) => {
181
- return /* @__PURE__ */ React6.createElement(
182
- "img",
183
- {
184
- src,
185
- alt: "avatar",
186
- style: {
187
- width: size,
188
- height: size,
189
- borderRadius: radius,
190
- objectFit: "cover"
191
- }
16
+ useEffect(() => {
17
+ if (!visible) {
18
+ setFade(true);
19
+ const timeout = setTimeout(() => onDismiss && onDismiss(), 300);
20
+ return () => clearTimeout(timeout);
192
21
  }
193
- );
194
- };
195
-
196
- // src/components/Spinner/Spinner.jsx
197
- import React7 from "react";
198
- var Spinner = ({
199
- size = "30px",
200
- color = "#2563eb",
201
- border = "3px"
202
- }) => {
203
- return /* @__PURE__ */ React7.createElement(React7.Fragment, null, /* @__PURE__ */ React7.createElement("style", null, `
204
- @keyframes vui-spin {
205
- to {
206
- transform: rotate(360deg);
207
- }
208
- }
209
- `), /* @__PURE__ */ React7.createElement(
210
- "div",
211
- {
212
- style: {
213
- width: size,
214
- height: size,
215
- border: `${border} solid #eee`,
216
- borderTop: `${border} solid ${color}`,
217
- borderRadius: "50%",
218
- animation: "vui-spin 1s linear infinite"
219
- }
220
- }
221
- ));
222
- };
223
-
224
- // src/components/Modal/Modal.jsx
225
- import React8 from "react";
226
- var Modal = ({
227
- open = false,
228
- title = "Modal Title",
229
- children,
230
- width = "300px",
231
- bg = "white",
232
- radius = "8px",
233
- onClose
234
- }) => {
235
- if (!open) return null;
236
- return /* @__PURE__ */ React8.createElement(
237
- "div",
238
- {
239
- style: {
240
- position: "fixed",
241
- top: 0,
242
- left: 0,
243
- width: "100%",
244
- height: "100%",
245
- background: "rgba(0,0,0,0.3)",
246
- display: "flex",
247
- alignItems: "center",
248
- justifyContent: "center"
249
- }
250
- },
251
- /* @__PURE__ */ React8.createElement(
252
- "div",
253
- {
254
- style: {
255
- width,
256
- background: bg,
257
- borderRadius: radius,
258
- padding: "20px"
259
- }
260
- },
261
- /* @__PURE__ */ React8.createElement("h3", null, title),
262
- children,
263
- /* @__PURE__ */ React8.createElement("button", { onClick: onClose }, "Close")
264
- )
265
- );
266
- };
267
-
268
- // src/components/ProgressBar/ProgressBar.jsx
269
- import React9 from "react";
270
- var ProgressBar = ({
271
- progress = 50,
272
- height = "20px",
273
- bgColor = "#2563eb",
274
- trackColor = "#d1d5db",
275
- radius = "10px",
276
- label = "Progress",
277
- textColor = "#ffffff"
278
- }) => {
279
- return /* @__PURE__ */ React9.createElement("div", { style: { width: "100%", background: trackColor, borderRadius: radius, overflow: "hidden" } }, /* @__PURE__ */ React9.createElement("div", { style: {
280
- width: progress + "%",
281
- height,
282
- background: bgColor,
283
- borderRadius: radius,
284
- display: "flex",
285
- alignItems: "center",
286
- justifyContent: "center",
287
- position: "relative"
288
- } }, /* @__PURE__ */ React9.createElement("span", { style: { color: textColor, fontWeight: "600", fontSize: "14px" } }, label, ": ", progress, "%")));
289
- };
290
-
291
- // src/components/AnimatedButton/AnimatedButton.jsx
292
- import React10 from "react";
293
- var AnimatedButton = ({
294
- text = "Click Me",
295
- gradient = "linear-gradient(45deg, #2563eb, #7c3aed)",
296
- color = "white",
297
- size = "md",
298
- width = "auto",
299
- radius = "12px",
300
- shadow = "0 4px 14px rgba(0, 0, 0, 0.2)",
301
- loading = false,
302
- onClick
303
- }) => {
304
- const sizes = { sm: "8px 16px", md: "12px 24px", lg: "16px 32px" };
305
- const handleMouseEnter = (e) => {
306
- e.target.style.transform = "scale(1.05)";
307
- };
308
- const handleMouseLeave = (e) => {
309
- e.target.style.transform = "scale(1)";
310
- };
311
- return /* @__PURE__ */ React10.createElement(
312
- "button",
313
- {
314
- onClick,
315
- onMouseEnter: handleMouseEnter,
316
- onMouseLeave: handleMouseLeave,
317
- disabled: loading,
318
- style: {
319
- background: gradient,
320
- color,
321
- padding: sizes[size],
322
- width,
323
- border: "none",
324
- borderRadius: radius,
325
- boxShadow: shadow,
326
- cursor: loading ? "not-allowed" : "pointer",
327
- fontWeight: "600",
328
- fontSize: "15px",
329
- transition: "transform 0.3s, box-shadow 0.3s",
330
- fontFamily: "system-ui, sans-serif",
331
- opacity: loading ? 0.6 : 1,
332
- display: "flex",
333
- alignItems: "center",
334
- justifyContent: "center",
335
- gap: "8px"
336
- }
337
- },
338
- loading ? "Loading..." : text
339
- );
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
- );
22
+ }, [visible, onDismiss]);
23
+ return /* @__PURE__ */ React.createElement("div", { style: {
24
+ position: "relative",
25
+ width: "100%",
26
+ background: colors[type].background,
27
+ color: colors[type].color,
28
+ padding: "16px 24px",
29
+ borderRadius: "8px",
30
+ boxShadow: "0 2px 10px rgba(0,0,0,0.2)",
31
+ transition: "opacity 0.3s ease, transform 0.3s ease",
32
+ transform: `translateY(${visible ? "0" : "-20px"})`,
33
+ opacity: fade ? 0 : 1,
34
+ zIndex: 1e3
35
+ }, className: visible ? "slide-down" : "fade-out" }, message, /* @__PURE__ */ React.createElement("button", { onClick: () => setVisible(false), style: {
36
+ position: "absolute",
37
+ top: "10px",
38
+ right: "10px",
39
+ background: "transparent",
40
+ color: "inherit",
41
+ border: "none",
42
+ cursor: "pointer",
43
+ fontSize: "16px"
44
+ } }, "\u2715"));
384
45
  };
385
46
  export {
386
- Alert,
387
- AnimatedButton,
388
- Avatar,
389
- Badge,
390
- Button,
391
- Card,
392
- CopyButton,
393
- Input,
394
- Modal,
395
- ProgressBar,
396
- Spinner
47
+ AlertBanner
397
48
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "virtual-ui-lib",
3
- "version": "1.0.12",
3
+ "version": "1.0.13",
4
4
  "description": "Virtual UI React Component Library",
5
5
  "author": "Ankush",
6
6
  "license": "ISC",