virtual-ui-lib 1.0.13 → 1.0.14

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
@@ -29,7 +29,8 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
29
29
  // src/index.js
30
30
  var index_exports = {};
31
31
  __export(index_exports, {
32
- AlertBanner: () => AlertBanner
32
+ AlertBanner: () => AlertBanner,
33
+ Button: () => Button
33
34
  });
34
35
  module.exports = __toCommonJS(index_exports);
35
36
 
@@ -78,7 +79,59 @@ var AlertBanner = ({
78
79
  fontSize: "16px"
79
80
  } }, "\u2715"));
80
81
  };
82
+
83
+ // src/components/Button/Button.jsx
84
+ var import_react2 = __toESM(require("react"));
85
+ var Button = ({
86
+ text = "Button",
87
+ variant = "primary",
88
+ color = "white",
89
+ bg = "#2563eb",
90
+ outlineColor = "#2563eb",
91
+ ghostColor = "#2563eb",
92
+ width = "auto",
93
+ radius = "8px",
94
+ weight = "600",
95
+ iconLeft = null,
96
+ iconRight = null,
97
+ onClick,
98
+ loading = false,
99
+ disabled = false
100
+ }) => {
101
+ const variants = {
102
+ primary: { background: bg, color, border: "none" },
103
+ secondary: { background: "#7c3aed", color, border: "none" },
104
+ outline: { background: "transparent", color, border: `2px solid ${outlineColor}` },
105
+ ghost: { background: "transparent", color: ghostColor, border: "none" }
106
+ };
107
+ const { background, border } = variants[variant];
108
+ return /* @__PURE__ */ import_react2.default.createElement(
109
+ "button",
110
+ {
111
+ onClick,
112
+ disabled: disabled || loading,
113
+ style: {
114
+ background,
115
+ color: variants[variant].color,
116
+ width,
117
+ border,
118
+ borderRadius: radius,
119
+ cursor: disabled ? "not-allowed" : "pointer",
120
+ fontWeight: weight,
121
+ padding: "10px 20px",
122
+ opacity: disabled ? 0.6 : 1,
123
+ transition: "transform 0.2s ease, background 0.2s ease"
124
+ },
125
+ onMouseEnter: (e) => e.currentTarget.style.transform = "scale(1.05)",
126
+ onMouseLeave: (e) => e.currentTarget.style.transform = "scale(1)",
127
+ onMouseDown: (e) => e.currentTarget.style.transform = "scale(0.95)",
128
+ onMouseUp: (e) => e.currentTarget.style.transform = "scale(1)"
129
+ },
130
+ loading ? "Loading..." : /* @__PURE__ */ import_react2.default.createElement(import_react2.default.Fragment, null, /* @__PURE__ */ import_react2.default.createElement(import_react2.default.Fragment, null, iconLeft, text, iconRight))
131
+ );
132
+ };
81
133
  // Annotate the CommonJS export names for ESM import in node:
82
134
  0 && (module.exports = {
83
- AlertBanner
135
+ AlertBanner,
136
+ Button
84
137
  });
package/dist/index.mjs CHANGED
@@ -43,6 +43,58 @@ var AlertBanner = ({
43
43
  fontSize: "16px"
44
44
  } }, "\u2715"));
45
45
  };
46
+
47
+ // src/components/Button/Button.jsx
48
+ import React2 from "react";
49
+ var Button = ({
50
+ text = "Button",
51
+ variant = "primary",
52
+ color = "white",
53
+ bg = "#2563eb",
54
+ outlineColor = "#2563eb",
55
+ ghostColor = "#2563eb",
56
+ width = "auto",
57
+ radius = "8px",
58
+ weight = "600",
59
+ iconLeft = null,
60
+ iconRight = null,
61
+ onClick,
62
+ loading = false,
63
+ disabled = false
64
+ }) => {
65
+ const variants = {
66
+ primary: { background: bg, color, border: "none" },
67
+ secondary: { background: "#7c3aed", color, border: "none" },
68
+ outline: { background: "transparent", color, border: `2px solid ${outlineColor}` },
69
+ ghost: { background: "transparent", color: ghostColor, border: "none" }
70
+ };
71
+ const { background, border } = variants[variant];
72
+ return /* @__PURE__ */ React2.createElement(
73
+ "button",
74
+ {
75
+ onClick,
76
+ disabled: disabled || loading,
77
+ style: {
78
+ background,
79
+ color: variants[variant].color,
80
+ width,
81
+ border,
82
+ borderRadius: radius,
83
+ cursor: disabled ? "not-allowed" : "pointer",
84
+ fontWeight: weight,
85
+ padding: "10px 20px",
86
+ opacity: disabled ? 0.6 : 1,
87
+ transition: "transform 0.2s ease, background 0.2s ease"
88
+ },
89
+ onMouseEnter: (e) => e.currentTarget.style.transform = "scale(1.05)",
90
+ onMouseLeave: (e) => e.currentTarget.style.transform = "scale(1)",
91
+ onMouseDown: (e) => e.currentTarget.style.transform = "scale(0.95)",
92
+ onMouseUp: (e) => e.currentTarget.style.transform = "scale(1)"
93
+ },
94
+ loading ? "Loading..." : /* @__PURE__ */ React2.createElement(React2.Fragment, null, /* @__PURE__ */ React2.createElement(React2.Fragment, null, iconLeft, text, iconRight))
95
+ );
96
+ };
46
97
  export {
47
- AlertBanner
98
+ AlertBanner,
99
+ Button
48
100
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "virtual-ui-lib",
3
- "version": "1.0.13",
3
+ "version": "1.0.14",
4
4
  "description": "Virtual UI React Component Library",
5
5
  "author": "Ankush",
6
6
  "license": "ISC",