virtual-ui-lib 1.0.13 → 1.0.15
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 +127 -2
- package/dist/index.mjs +124 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -29,7 +29,9 @@ 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,
|
|
34
|
+
Card: () => Card
|
|
33
35
|
});
|
|
34
36
|
module.exports = __toCommonJS(index_exports);
|
|
35
37
|
|
|
@@ -78,7 +80,130 @@ var AlertBanner = ({
|
|
|
78
80
|
fontSize: "16px"
|
|
79
81
|
} }, "\u2715"));
|
|
80
82
|
};
|
|
83
|
+
|
|
84
|
+
// src/components/Button/Button.jsx
|
|
85
|
+
var import_react2 = __toESM(require("react"));
|
|
86
|
+
var Button = ({
|
|
87
|
+
text = "Button",
|
|
88
|
+
variant = "primary",
|
|
89
|
+
color = "white",
|
|
90
|
+
bg = "#2563eb",
|
|
91
|
+
outlineColor = "#2563eb",
|
|
92
|
+
ghostColor = "#2563eb",
|
|
93
|
+
width = "auto",
|
|
94
|
+
radius = "8px",
|
|
95
|
+
weight = "600",
|
|
96
|
+
iconLeft = null,
|
|
97
|
+
iconRight = null,
|
|
98
|
+
onClick,
|
|
99
|
+
loading = false,
|
|
100
|
+
disabled = false
|
|
101
|
+
}) => {
|
|
102
|
+
const variants = {
|
|
103
|
+
primary: { background: bg, color, border: "none" },
|
|
104
|
+
secondary: { background: "#7c3aed", color, border: "none" },
|
|
105
|
+
outline: { background: "transparent", color, border: `2px solid ${outlineColor}` },
|
|
106
|
+
ghost: { background: "transparent", color: ghostColor, border: "none" }
|
|
107
|
+
};
|
|
108
|
+
const { background, border } = variants[variant];
|
|
109
|
+
return /* @__PURE__ */ import_react2.default.createElement(
|
|
110
|
+
"button",
|
|
111
|
+
{
|
|
112
|
+
onClick,
|
|
113
|
+
disabled: disabled || loading,
|
|
114
|
+
style: {
|
|
115
|
+
background,
|
|
116
|
+
color: variants[variant].color,
|
|
117
|
+
width,
|
|
118
|
+
border,
|
|
119
|
+
borderRadius: radius,
|
|
120
|
+
cursor: disabled ? "not-allowed" : "pointer",
|
|
121
|
+
fontWeight: weight,
|
|
122
|
+
padding: "10px 20px",
|
|
123
|
+
opacity: disabled ? 0.6 : 1,
|
|
124
|
+
transition: "transform 0.2s ease, background 0.2s ease"
|
|
125
|
+
},
|
|
126
|
+
onMouseEnter: (e) => e.currentTarget.style.transform = "scale(1.05)",
|
|
127
|
+
onMouseLeave: (e) => e.currentTarget.style.transform = "scale(1)",
|
|
128
|
+
onMouseDown: (e) => e.currentTarget.style.transform = "scale(0.95)",
|
|
129
|
+
onMouseUp: (e) => e.currentTarget.style.transform = "scale(1)"
|
|
130
|
+
},
|
|
131
|
+
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))
|
|
132
|
+
);
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
// src/components/Card/Card.jsx
|
|
136
|
+
var import_react3 = __toESM(require("react"));
|
|
137
|
+
var Card = ({
|
|
138
|
+
image = "https://via.placeholder.com/300x200",
|
|
139
|
+
title = "Card Title",
|
|
140
|
+
description = "This is a description of the card content. It should be concise and informative.",
|
|
141
|
+
onClick,
|
|
142
|
+
loading = false,
|
|
143
|
+
disabled = false,
|
|
144
|
+
bg = "#f9fafb",
|
|
145
|
+
textColor = "#0f172a",
|
|
146
|
+
hoverBg = "#e5e7eb",
|
|
147
|
+
radius = "12px",
|
|
148
|
+
shadow = "0 4px 14px rgba(0,0,0,0.1)",
|
|
149
|
+
hoverShadow = "0 8px 28px rgba(0,0,0,0.2)",
|
|
150
|
+
transition = "transform 0.3s, box-shadow 0.3s"
|
|
151
|
+
}) => {
|
|
152
|
+
return /* @__PURE__ */ import_react3.default.createElement(
|
|
153
|
+
"div",
|
|
154
|
+
{
|
|
155
|
+
style: {
|
|
156
|
+
background: bg,
|
|
157
|
+
borderRadius: radius,
|
|
158
|
+
boxShadow: shadow,
|
|
159
|
+
padding: "16px",
|
|
160
|
+
transition,
|
|
161
|
+
cursor: disabled ? "not-allowed" : "pointer",
|
|
162
|
+
opacity: disabled ? 0.6 : 1,
|
|
163
|
+
position: "relative",
|
|
164
|
+
overflow: "hidden"
|
|
165
|
+
},
|
|
166
|
+
onClick: disabled ? null : onClick,
|
|
167
|
+
onMouseEnter: (e) => {
|
|
168
|
+
e.currentTarget.style.boxShadow = hoverShadow;
|
|
169
|
+
e.currentTarget.style.transform = "translateY(-4px)";
|
|
170
|
+
},
|
|
171
|
+
onMouseLeave: (e) => {
|
|
172
|
+
e.currentTarget.style.boxShadow = shadow;
|
|
173
|
+
e.currentTarget.style.transform = "translateY(0)";
|
|
174
|
+
}
|
|
175
|
+
},
|
|
176
|
+
loading ? /* @__PURE__ */ import_react3.default.createElement("div", { style: {
|
|
177
|
+
background: "#e0e0e0",
|
|
178
|
+
height: "200px",
|
|
179
|
+
borderRadius: radius,
|
|
180
|
+
marginBottom: "12px"
|
|
181
|
+
} }) : /* @__PURE__ */ import_react3.default.createElement("img", { src: image, alt: title, style: { width: "100%", borderRadius: radius } }),
|
|
182
|
+
/* @__PURE__ */ import_react3.default.createElement("h3", { style: { margin: "12px 0 4px", fontSize: "16px", color: textColor } }, title),
|
|
183
|
+
/* @__PURE__ */ import_react3.default.createElement("p", { style: { margin: "0 0 12px", fontSize: "14px", color: "#374151" } }, description),
|
|
184
|
+
/* @__PURE__ */ import_react3.default.createElement(
|
|
185
|
+
"button",
|
|
186
|
+
{
|
|
187
|
+
style: {
|
|
188
|
+
padding: "10px 16px",
|
|
189
|
+
background: "#2563eb",
|
|
190
|
+
color: "white",
|
|
191
|
+
border: "none",
|
|
192
|
+
borderRadius: "8px",
|
|
193
|
+
cursor: "pointer",
|
|
194
|
+
fontWeight: "600",
|
|
195
|
+
transition: "background 0.3s"
|
|
196
|
+
},
|
|
197
|
+
onClick,
|
|
198
|
+
disabled
|
|
199
|
+
},
|
|
200
|
+
"Action"
|
|
201
|
+
)
|
|
202
|
+
);
|
|
203
|
+
};
|
|
81
204
|
// Annotate the CommonJS export names for ESM import in node:
|
|
82
205
|
0 && (module.exports = {
|
|
83
|
-
AlertBanner
|
|
206
|
+
AlertBanner,
|
|
207
|
+
Button,
|
|
208
|
+
Card
|
|
84
209
|
});
|
package/dist/index.mjs
CHANGED
|
@@ -43,6 +43,129 @@ 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
|
+
};
|
|
97
|
+
|
|
98
|
+
// src/components/Card/Card.jsx
|
|
99
|
+
import React3 from "react";
|
|
100
|
+
var Card = ({
|
|
101
|
+
image = "https://via.placeholder.com/300x200",
|
|
102
|
+
title = "Card Title",
|
|
103
|
+
description = "This is a description of the card content. It should be concise and informative.",
|
|
104
|
+
onClick,
|
|
105
|
+
loading = false,
|
|
106
|
+
disabled = false,
|
|
107
|
+
bg = "#f9fafb",
|
|
108
|
+
textColor = "#0f172a",
|
|
109
|
+
hoverBg = "#e5e7eb",
|
|
110
|
+
radius = "12px",
|
|
111
|
+
shadow = "0 4px 14px rgba(0,0,0,0.1)",
|
|
112
|
+
hoverShadow = "0 8px 28px rgba(0,0,0,0.2)",
|
|
113
|
+
transition = "transform 0.3s, box-shadow 0.3s"
|
|
114
|
+
}) => {
|
|
115
|
+
return /* @__PURE__ */ React3.createElement(
|
|
116
|
+
"div",
|
|
117
|
+
{
|
|
118
|
+
style: {
|
|
119
|
+
background: bg,
|
|
120
|
+
borderRadius: radius,
|
|
121
|
+
boxShadow: shadow,
|
|
122
|
+
padding: "16px",
|
|
123
|
+
transition,
|
|
124
|
+
cursor: disabled ? "not-allowed" : "pointer",
|
|
125
|
+
opacity: disabled ? 0.6 : 1,
|
|
126
|
+
position: "relative",
|
|
127
|
+
overflow: "hidden"
|
|
128
|
+
},
|
|
129
|
+
onClick: disabled ? null : onClick,
|
|
130
|
+
onMouseEnter: (e) => {
|
|
131
|
+
e.currentTarget.style.boxShadow = hoverShadow;
|
|
132
|
+
e.currentTarget.style.transform = "translateY(-4px)";
|
|
133
|
+
},
|
|
134
|
+
onMouseLeave: (e) => {
|
|
135
|
+
e.currentTarget.style.boxShadow = shadow;
|
|
136
|
+
e.currentTarget.style.transform = "translateY(0)";
|
|
137
|
+
}
|
|
138
|
+
},
|
|
139
|
+
loading ? /* @__PURE__ */ React3.createElement("div", { style: {
|
|
140
|
+
background: "#e0e0e0",
|
|
141
|
+
height: "200px",
|
|
142
|
+
borderRadius: radius,
|
|
143
|
+
marginBottom: "12px"
|
|
144
|
+
} }) : /* @__PURE__ */ React3.createElement("img", { src: image, alt: title, style: { width: "100%", borderRadius: radius } }),
|
|
145
|
+
/* @__PURE__ */ React3.createElement("h3", { style: { margin: "12px 0 4px", fontSize: "16px", color: textColor } }, title),
|
|
146
|
+
/* @__PURE__ */ React3.createElement("p", { style: { margin: "0 0 12px", fontSize: "14px", color: "#374151" } }, description),
|
|
147
|
+
/* @__PURE__ */ React3.createElement(
|
|
148
|
+
"button",
|
|
149
|
+
{
|
|
150
|
+
style: {
|
|
151
|
+
padding: "10px 16px",
|
|
152
|
+
background: "#2563eb",
|
|
153
|
+
color: "white",
|
|
154
|
+
border: "none",
|
|
155
|
+
borderRadius: "8px",
|
|
156
|
+
cursor: "pointer",
|
|
157
|
+
fontWeight: "600",
|
|
158
|
+
transition: "background 0.3s"
|
|
159
|
+
},
|
|
160
|
+
onClick,
|
|
161
|
+
disabled
|
|
162
|
+
},
|
|
163
|
+
"Action"
|
|
164
|
+
)
|
|
165
|
+
);
|
|
166
|
+
};
|
|
46
167
|
export {
|
|
47
|
-
AlertBanner
|
|
168
|
+
AlertBanner,
|
|
169
|
+
Button,
|
|
170
|
+
Card
|
|
48
171
|
};
|