@divyanshinigam/virtualui-lib 0.0.0-stage → 1.0.2
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 +262 -0
- package/dist/index.mjs +224 -0
- package/package.json +23 -6
- package/README.md +0 -3
package/dist/index.js
ADDED
|
@@ -0,0 +1,262 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
|
|
29
|
+
// src/index.js
|
|
30
|
+
var index_exports = {};
|
|
31
|
+
__export(index_exports, {
|
|
32
|
+
Button: () => Button,
|
|
33
|
+
Card: () => Card,
|
|
34
|
+
ProductCard: () => ProductCard
|
|
35
|
+
});
|
|
36
|
+
module.exports = __toCommonJS(index_exports);
|
|
37
|
+
|
|
38
|
+
// src/components/Button/Button.jsx
|
|
39
|
+
var import_react = __toESM(require("react"));
|
|
40
|
+
var Button = ({
|
|
41
|
+
text = "Click me",
|
|
42
|
+
onClick = () => {
|
|
43
|
+
},
|
|
44
|
+
bgColor = "#4F46E5",
|
|
45
|
+
hoverColor = "#4338CA",
|
|
46
|
+
textColor = "#FFFFFF",
|
|
47
|
+
size = "medium",
|
|
48
|
+
disabled = false
|
|
49
|
+
}) => {
|
|
50
|
+
const [isHovered, setIsHovered] = (0, import_react.useState)(false);
|
|
51
|
+
const sizeStyles = {
|
|
52
|
+
small: { padding: "6px 14px", fontSize: "13px" },
|
|
53
|
+
medium: { padding: "10px 20px", fontSize: "15px" },
|
|
54
|
+
large: { padding: "14px 28px", fontSize: "17px" }
|
|
55
|
+
};
|
|
56
|
+
const style = {
|
|
57
|
+
backgroundColor: disabled ? "#A1A1AA" : isHovered ? hoverColor : bgColor,
|
|
58
|
+
color: textColor,
|
|
59
|
+
border: "none",
|
|
60
|
+
borderRadius: "8px",
|
|
61
|
+
fontWeight: 500,
|
|
62
|
+
cursor: disabled ? "not-allowed" : "pointer",
|
|
63
|
+
transition: "background-color 0.2s ease, transform 0.1s ease",
|
|
64
|
+
transform: isHovered && !disabled ? "scale(1.03)" : "scale(1)",
|
|
65
|
+
...sizeStyles[size]
|
|
66
|
+
};
|
|
67
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
68
|
+
"button",
|
|
69
|
+
{
|
|
70
|
+
style,
|
|
71
|
+
disabled,
|
|
72
|
+
onClick,
|
|
73
|
+
onMouseEnter: () => setIsHovered(true),
|
|
74
|
+
onMouseLeave: () => setIsHovered(false)
|
|
75
|
+
},
|
|
76
|
+
text
|
|
77
|
+
);
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
// src/components/Card/Card.jsx
|
|
81
|
+
var import_react2 = __toESM(require("react"));
|
|
82
|
+
var Card = ({
|
|
83
|
+
title = "Card title",
|
|
84
|
+
description = "This is a short description of the card content.",
|
|
85
|
+
imageUrl = "https://via.placeholder.com/300x160",
|
|
86
|
+
bgColor = "#FFFFFF",
|
|
87
|
+
textColor = "#111827",
|
|
88
|
+
accentColor = "#4F46E5",
|
|
89
|
+
width = "300px"
|
|
90
|
+
}) => {
|
|
91
|
+
const [isHovered, setIsHovered] = (0, import_react2.useState)(false);
|
|
92
|
+
const cardStyle = {
|
|
93
|
+
width,
|
|
94
|
+
backgroundColor: bgColor,
|
|
95
|
+
borderRadius: "12px",
|
|
96
|
+
overflow: "hidden",
|
|
97
|
+
boxShadow: isHovered ? "0 8px 20px rgba(0,0,0,0.15)" : "0 2px 8px rgba(0,0,0,0.08)",
|
|
98
|
+
transform: isHovered ? "translateY(-4px)" : "translateY(0)",
|
|
99
|
+
transition: "box-shadow 0.2s ease, transform 0.2s ease",
|
|
100
|
+
fontFamily: "sans-serif",
|
|
101
|
+
cursor: "pointer"
|
|
102
|
+
};
|
|
103
|
+
const imgStyle = {
|
|
104
|
+
width: "100%",
|
|
105
|
+
height: "160px",
|
|
106
|
+
objectFit: "cover",
|
|
107
|
+
display: "block"
|
|
108
|
+
};
|
|
109
|
+
const bodyStyle = {
|
|
110
|
+
padding: "16px"
|
|
111
|
+
};
|
|
112
|
+
const titleStyle = {
|
|
113
|
+
margin: "0 0 8px 0",
|
|
114
|
+
fontSize: "18px",
|
|
115
|
+
fontWeight: 600,
|
|
116
|
+
color: textColor
|
|
117
|
+
};
|
|
118
|
+
const descStyle = {
|
|
119
|
+
margin: "0 0 12px 0",
|
|
120
|
+
fontSize: "14px",
|
|
121
|
+
lineHeight: 1.5,
|
|
122
|
+
color: "#6B7280"
|
|
123
|
+
};
|
|
124
|
+
const buttonStyle = {
|
|
125
|
+
border: "none",
|
|
126
|
+
background: "none",
|
|
127
|
+
padding: 0,
|
|
128
|
+
fontSize: "14px",
|
|
129
|
+
fontWeight: 600,
|
|
130
|
+
color: accentColor,
|
|
131
|
+
cursor: "pointer"
|
|
132
|
+
};
|
|
133
|
+
return /* @__PURE__ */ import_react2.default.createElement(
|
|
134
|
+
"div",
|
|
135
|
+
{
|
|
136
|
+
style: cardStyle,
|
|
137
|
+
onMouseEnter: () => setIsHovered(true),
|
|
138
|
+
onMouseLeave: () => setIsHovered(false)
|
|
139
|
+
},
|
|
140
|
+
/* @__PURE__ */ import_react2.default.createElement("img", { src: imageUrl, alt: title, style: imgStyle }),
|
|
141
|
+
/* @__PURE__ */ import_react2.default.createElement("div", { style: bodyStyle }, /* @__PURE__ */ import_react2.default.createElement("h3", { style: titleStyle }, title), /* @__PURE__ */ import_react2.default.createElement("p", { style: descStyle }, description), /* @__PURE__ */ import_react2.default.createElement("button", { style: buttonStyle }, "Learn more \u2192"))
|
|
142
|
+
);
|
|
143
|
+
};
|
|
144
|
+
|
|
145
|
+
// src/components/ProductCard/ProductCard.jsx
|
|
146
|
+
var import_react3 = __toESM(require("react"));
|
|
147
|
+
var ProductCard = ({
|
|
148
|
+
title = "Wireless Headphones",
|
|
149
|
+
description = "Premium noise cancelling with 30hr battery life",
|
|
150
|
+
price = 199.99,
|
|
151
|
+
currency = "$",
|
|
152
|
+
image = "https://images.unsplash.com/photo-1505740420928-5e560c06d30e?w=600&q=80",
|
|
153
|
+
rating = 4.5,
|
|
154
|
+
accent = "#6366f1",
|
|
155
|
+
bg = "#0f172a",
|
|
156
|
+
onAddToCart = () => {
|
|
157
|
+
},
|
|
158
|
+
onViewDetails = () => {
|
|
159
|
+
}
|
|
160
|
+
}) => {
|
|
161
|
+
const [hovered, setHovered] = (0, import_react3.useState)(false);
|
|
162
|
+
const alpha = (hex, op) => {
|
|
163
|
+
const r = parseInt(hex.slice(1, 3), 16), g = parseInt(hex.slice(3, 5), 16), b = parseInt(hex.slice(5, 7), 16);
|
|
164
|
+
return "rgba(" + r + "," + g + "," + b + "," + op + ")";
|
|
165
|
+
};
|
|
166
|
+
return /* @__PURE__ */ import_react3.default.createElement(
|
|
167
|
+
"div",
|
|
168
|
+
{
|
|
169
|
+
onMouseEnter: () => setHovered(true),
|
|
170
|
+
onMouseLeave: () => setHovered(false),
|
|
171
|
+
style: {
|
|
172
|
+
background: bg,
|
|
173
|
+
borderRadius: "16px",
|
|
174
|
+
overflow: "hidden",
|
|
175
|
+
width: "280px",
|
|
176
|
+
border: "1px solid " + (hovered ? alpha(accent, 0.3) : "rgba(255,255,255,0.07)"),
|
|
177
|
+
fontFamily: "system-ui,sans-serif",
|
|
178
|
+
transition: "transform 0.25s, box-shadow 0.25s",
|
|
179
|
+
transform: hovered ? "translateY(-4px)" : "translateY(0px)",
|
|
180
|
+
boxShadow: hovered ? "0 16px 40px rgba(0,0,0,0.5)" : "0 4px 20px rgba(0,0,0,0.3)"
|
|
181
|
+
}
|
|
182
|
+
},
|
|
183
|
+
/* @__PURE__ */ import_react3.default.createElement("div", { style: { position: "relative", width: "100%", height: "200px", overflow: "hidden" } }, /* @__PURE__ */ import_react3.default.createElement(
|
|
184
|
+
"img",
|
|
185
|
+
{
|
|
186
|
+
src: image,
|
|
187
|
+
alt: title,
|
|
188
|
+
style: {
|
|
189
|
+
width: "100%",
|
|
190
|
+
height: "100%",
|
|
191
|
+
objectFit: "cover",
|
|
192
|
+
transform: hovered ? "scale(1.05)" : "scale(1)",
|
|
193
|
+
transition: "transform 0.4s ease"
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
), /* @__PURE__ */ import_react3.default.createElement("div", { style: {
|
|
197
|
+
position: "absolute",
|
|
198
|
+
bottom: "12px",
|
|
199
|
+
left: "12px",
|
|
200
|
+
padding: "4px 8px",
|
|
201
|
+
borderRadius: "4px",
|
|
202
|
+
background: "rgba(0,0,0,0.7)",
|
|
203
|
+
color: "#fff",
|
|
204
|
+
fontSize: "12px",
|
|
205
|
+
fontWeight: "700",
|
|
206
|
+
display: "flex",
|
|
207
|
+
alignItems: "center",
|
|
208
|
+
gap: "4px"
|
|
209
|
+
} }, /* @__PURE__ */ import_react3.default.createElement("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "#ffd700", stroke: "none" }, /* @__PURE__ */ import_react3.default.createElement("polygon", { points: "12,2 15.09,8.26 22,9.27 17,14.14 18.18,21.02 12,17.77 5.82,21.02 7,14.14 2,9.27 8.91,8.26" })), rating)),
|
|
210
|
+
/* @__PURE__ */ import_react3.default.createElement("div", { style: { padding: "18px" } }, /* @__PURE__ */ import_react3.default.createElement("h3", { style: { fontSize: "16px", fontWeight: "700", color: "#fff", margin: "0 0 8px" } }, title), /* @__PURE__ */ import_react3.default.createElement("p", { style: { fontSize: "13px", color: "rgba(255,255,255,0.45)", lineHeight: 1.5, margin: "0 0 12px" } }, description), /* @__PURE__ */ import_react3.default.createElement("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", marginBottom: "16px" } }, /* @__PURE__ */ import_react3.default.createElement("div", { style: { fontSize: "20px", fontWeight: "800", color: accent } }, currency, price.toFixed(2)), /* @__PURE__ */ import_react3.default.createElement("div", { style: {
|
|
211
|
+
padding: "4px 10px",
|
|
212
|
+
borderRadius: "6px",
|
|
213
|
+
background: alpha(accent, 0.1),
|
|
214
|
+
color: accent,
|
|
215
|
+
fontSize: "11px",
|
|
216
|
+
fontWeight: "700",
|
|
217
|
+
border: "1px solid " + alpha(accent, 0.3)
|
|
218
|
+
} }, "In Stock")), /* @__PURE__ */ import_react3.default.createElement("div", { style: { display: "flex", gap: "8px" } }, /* @__PURE__ */ import_react3.default.createElement(
|
|
219
|
+
"button",
|
|
220
|
+
{
|
|
221
|
+
onClick: onAddToCart,
|
|
222
|
+
style: {
|
|
223
|
+
flex: 1,
|
|
224
|
+
padding: "10px",
|
|
225
|
+
borderRadius: "8px",
|
|
226
|
+
border: "none",
|
|
227
|
+
background: accent,
|
|
228
|
+
color: "#fff",
|
|
229
|
+
fontSize: "13px",
|
|
230
|
+
fontWeight: "700",
|
|
231
|
+
cursor: "pointer",
|
|
232
|
+
fontFamily: "inherit"
|
|
233
|
+
}
|
|
234
|
+
},
|
|
235
|
+
"Add to Cart"
|
|
236
|
+
), /* @__PURE__ */ import_react3.default.createElement(
|
|
237
|
+
"button",
|
|
238
|
+
{
|
|
239
|
+
onClick: onViewDetails,
|
|
240
|
+
style: {
|
|
241
|
+
flex: 1,
|
|
242
|
+
padding: "10px",
|
|
243
|
+
borderRadius: "8px",
|
|
244
|
+
border: "1px solid " + alpha(accent, 0.3),
|
|
245
|
+
background: "transparent",
|
|
246
|
+
color: accent,
|
|
247
|
+
fontSize: "13px",
|
|
248
|
+
fontWeight: "600",
|
|
249
|
+
cursor: "pointer",
|
|
250
|
+
fontFamily: "inherit"
|
|
251
|
+
}
|
|
252
|
+
},
|
|
253
|
+
"View Details"
|
|
254
|
+
)))
|
|
255
|
+
);
|
|
256
|
+
};
|
|
257
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
258
|
+
0 && (module.exports = {
|
|
259
|
+
Button,
|
|
260
|
+
Card,
|
|
261
|
+
ProductCard
|
|
262
|
+
});
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
// src/components/Button/Button.jsx
|
|
2
|
+
import React, { useState } from "react";
|
|
3
|
+
var Button = ({
|
|
4
|
+
text = "Click me",
|
|
5
|
+
onClick = () => {
|
|
6
|
+
},
|
|
7
|
+
bgColor = "#4F46E5",
|
|
8
|
+
hoverColor = "#4338CA",
|
|
9
|
+
textColor = "#FFFFFF",
|
|
10
|
+
size = "medium",
|
|
11
|
+
disabled = false
|
|
12
|
+
}) => {
|
|
13
|
+
const [isHovered, setIsHovered] = useState(false);
|
|
14
|
+
const sizeStyles = {
|
|
15
|
+
small: { padding: "6px 14px", fontSize: "13px" },
|
|
16
|
+
medium: { padding: "10px 20px", fontSize: "15px" },
|
|
17
|
+
large: { padding: "14px 28px", fontSize: "17px" }
|
|
18
|
+
};
|
|
19
|
+
const style = {
|
|
20
|
+
backgroundColor: disabled ? "#A1A1AA" : isHovered ? hoverColor : bgColor,
|
|
21
|
+
color: textColor,
|
|
22
|
+
border: "none",
|
|
23
|
+
borderRadius: "8px",
|
|
24
|
+
fontWeight: 500,
|
|
25
|
+
cursor: disabled ? "not-allowed" : "pointer",
|
|
26
|
+
transition: "background-color 0.2s ease, transform 0.1s ease",
|
|
27
|
+
transform: isHovered && !disabled ? "scale(1.03)" : "scale(1)",
|
|
28
|
+
...sizeStyles[size]
|
|
29
|
+
};
|
|
30
|
+
return /* @__PURE__ */ React.createElement(
|
|
31
|
+
"button",
|
|
32
|
+
{
|
|
33
|
+
style,
|
|
34
|
+
disabled,
|
|
35
|
+
onClick,
|
|
36
|
+
onMouseEnter: () => setIsHovered(true),
|
|
37
|
+
onMouseLeave: () => setIsHovered(false)
|
|
38
|
+
},
|
|
39
|
+
text
|
|
40
|
+
);
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
// src/components/Card/Card.jsx
|
|
44
|
+
import React2, { useState as useState2 } from "react";
|
|
45
|
+
var Card = ({
|
|
46
|
+
title = "Card title",
|
|
47
|
+
description = "This is a short description of the card content.",
|
|
48
|
+
imageUrl = "https://via.placeholder.com/300x160",
|
|
49
|
+
bgColor = "#FFFFFF",
|
|
50
|
+
textColor = "#111827",
|
|
51
|
+
accentColor = "#4F46E5",
|
|
52
|
+
width = "300px"
|
|
53
|
+
}) => {
|
|
54
|
+
const [isHovered, setIsHovered] = useState2(false);
|
|
55
|
+
const cardStyle = {
|
|
56
|
+
width,
|
|
57
|
+
backgroundColor: bgColor,
|
|
58
|
+
borderRadius: "12px",
|
|
59
|
+
overflow: "hidden",
|
|
60
|
+
boxShadow: isHovered ? "0 8px 20px rgba(0,0,0,0.15)" : "0 2px 8px rgba(0,0,0,0.08)",
|
|
61
|
+
transform: isHovered ? "translateY(-4px)" : "translateY(0)",
|
|
62
|
+
transition: "box-shadow 0.2s ease, transform 0.2s ease",
|
|
63
|
+
fontFamily: "sans-serif",
|
|
64
|
+
cursor: "pointer"
|
|
65
|
+
};
|
|
66
|
+
const imgStyle = {
|
|
67
|
+
width: "100%",
|
|
68
|
+
height: "160px",
|
|
69
|
+
objectFit: "cover",
|
|
70
|
+
display: "block"
|
|
71
|
+
};
|
|
72
|
+
const bodyStyle = {
|
|
73
|
+
padding: "16px"
|
|
74
|
+
};
|
|
75
|
+
const titleStyle = {
|
|
76
|
+
margin: "0 0 8px 0",
|
|
77
|
+
fontSize: "18px",
|
|
78
|
+
fontWeight: 600,
|
|
79
|
+
color: textColor
|
|
80
|
+
};
|
|
81
|
+
const descStyle = {
|
|
82
|
+
margin: "0 0 12px 0",
|
|
83
|
+
fontSize: "14px",
|
|
84
|
+
lineHeight: 1.5,
|
|
85
|
+
color: "#6B7280"
|
|
86
|
+
};
|
|
87
|
+
const buttonStyle = {
|
|
88
|
+
border: "none",
|
|
89
|
+
background: "none",
|
|
90
|
+
padding: 0,
|
|
91
|
+
fontSize: "14px",
|
|
92
|
+
fontWeight: 600,
|
|
93
|
+
color: accentColor,
|
|
94
|
+
cursor: "pointer"
|
|
95
|
+
};
|
|
96
|
+
return /* @__PURE__ */ React2.createElement(
|
|
97
|
+
"div",
|
|
98
|
+
{
|
|
99
|
+
style: cardStyle,
|
|
100
|
+
onMouseEnter: () => setIsHovered(true),
|
|
101
|
+
onMouseLeave: () => setIsHovered(false)
|
|
102
|
+
},
|
|
103
|
+
/* @__PURE__ */ React2.createElement("img", { src: imageUrl, alt: title, style: imgStyle }),
|
|
104
|
+
/* @__PURE__ */ React2.createElement("div", { style: bodyStyle }, /* @__PURE__ */ React2.createElement("h3", { style: titleStyle }, title), /* @__PURE__ */ React2.createElement("p", { style: descStyle }, description), /* @__PURE__ */ React2.createElement("button", { style: buttonStyle }, "Learn more \u2192"))
|
|
105
|
+
);
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
// src/components/ProductCard/ProductCard.jsx
|
|
109
|
+
import React3, { useState as useState3 } from "react";
|
|
110
|
+
var ProductCard = ({
|
|
111
|
+
title = "Wireless Headphones",
|
|
112
|
+
description = "Premium noise cancelling with 30hr battery life",
|
|
113
|
+
price = 199.99,
|
|
114
|
+
currency = "$",
|
|
115
|
+
image = "https://images.unsplash.com/photo-1505740420928-5e560c06d30e?w=600&q=80",
|
|
116
|
+
rating = 4.5,
|
|
117
|
+
accent = "#6366f1",
|
|
118
|
+
bg = "#0f172a",
|
|
119
|
+
onAddToCart = () => {
|
|
120
|
+
},
|
|
121
|
+
onViewDetails = () => {
|
|
122
|
+
}
|
|
123
|
+
}) => {
|
|
124
|
+
const [hovered, setHovered] = useState3(false);
|
|
125
|
+
const alpha = (hex, op) => {
|
|
126
|
+
const r = parseInt(hex.slice(1, 3), 16), g = parseInt(hex.slice(3, 5), 16), b = parseInt(hex.slice(5, 7), 16);
|
|
127
|
+
return "rgba(" + r + "," + g + "," + b + "," + op + ")";
|
|
128
|
+
};
|
|
129
|
+
return /* @__PURE__ */ React3.createElement(
|
|
130
|
+
"div",
|
|
131
|
+
{
|
|
132
|
+
onMouseEnter: () => setHovered(true),
|
|
133
|
+
onMouseLeave: () => setHovered(false),
|
|
134
|
+
style: {
|
|
135
|
+
background: bg,
|
|
136
|
+
borderRadius: "16px",
|
|
137
|
+
overflow: "hidden",
|
|
138
|
+
width: "280px",
|
|
139
|
+
border: "1px solid " + (hovered ? alpha(accent, 0.3) : "rgba(255,255,255,0.07)"),
|
|
140
|
+
fontFamily: "system-ui,sans-serif",
|
|
141
|
+
transition: "transform 0.25s, box-shadow 0.25s",
|
|
142
|
+
transform: hovered ? "translateY(-4px)" : "translateY(0px)",
|
|
143
|
+
boxShadow: hovered ? "0 16px 40px rgba(0,0,0,0.5)" : "0 4px 20px rgba(0,0,0,0.3)"
|
|
144
|
+
}
|
|
145
|
+
},
|
|
146
|
+
/* @__PURE__ */ React3.createElement("div", { style: { position: "relative", width: "100%", height: "200px", overflow: "hidden" } }, /* @__PURE__ */ React3.createElement(
|
|
147
|
+
"img",
|
|
148
|
+
{
|
|
149
|
+
src: image,
|
|
150
|
+
alt: title,
|
|
151
|
+
style: {
|
|
152
|
+
width: "100%",
|
|
153
|
+
height: "100%",
|
|
154
|
+
objectFit: "cover",
|
|
155
|
+
transform: hovered ? "scale(1.05)" : "scale(1)",
|
|
156
|
+
transition: "transform 0.4s ease"
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
), /* @__PURE__ */ React3.createElement("div", { style: {
|
|
160
|
+
position: "absolute",
|
|
161
|
+
bottom: "12px",
|
|
162
|
+
left: "12px",
|
|
163
|
+
padding: "4px 8px",
|
|
164
|
+
borderRadius: "4px",
|
|
165
|
+
background: "rgba(0,0,0,0.7)",
|
|
166
|
+
color: "#fff",
|
|
167
|
+
fontSize: "12px",
|
|
168
|
+
fontWeight: "700",
|
|
169
|
+
display: "flex",
|
|
170
|
+
alignItems: "center",
|
|
171
|
+
gap: "4px"
|
|
172
|
+
} }, /* @__PURE__ */ React3.createElement("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "#ffd700", stroke: "none" }, /* @__PURE__ */ React3.createElement("polygon", { points: "12,2 15.09,8.26 22,9.27 17,14.14 18.18,21.02 12,17.77 5.82,21.02 7,14.14 2,9.27 8.91,8.26" })), rating)),
|
|
173
|
+
/* @__PURE__ */ React3.createElement("div", { style: { padding: "18px" } }, /* @__PURE__ */ React3.createElement("h3", { style: { fontSize: "16px", fontWeight: "700", color: "#fff", margin: "0 0 8px" } }, title), /* @__PURE__ */ React3.createElement("p", { style: { fontSize: "13px", color: "rgba(255,255,255,0.45)", lineHeight: 1.5, margin: "0 0 12px" } }, description), /* @__PURE__ */ React3.createElement("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", marginBottom: "16px" } }, /* @__PURE__ */ React3.createElement("div", { style: { fontSize: "20px", fontWeight: "800", color: accent } }, currency, price.toFixed(2)), /* @__PURE__ */ React3.createElement("div", { style: {
|
|
174
|
+
padding: "4px 10px",
|
|
175
|
+
borderRadius: "6px",
|
|
176
|
+
background: alpha(accent, 0.1),
|
|
177
|
+
color: accent,
|
|
178
|
+
fontSize: "11px",
|
|
179
|
+
fontWeight: "700",
|
|
180
|
+
border: "1px solid " + alpha(accent, 0.3)
|
|
181
|
+
} }, "In Stock")), /* @__PURE__ */ React3.createElement("div", { style: { display: "flex", gap: "8px" } }, /* @__PURE__ */ React3.createElement(
|
|
182
|
+
"button",
|
|
183
|
+
{
|
|
184
|
+
onClick: onAddToCart,
|
|
185
|
+
style: {
|
|
186
|
+
flex: 1,
|
|
187
|
+
padding: "10px",
|
|
188
|
+
borderRadius: "8px",
|
|
189
|
+
border: "none",
|
|
190
|
+
background: accent,
|
|
191
|
+
color: "#fff",
|
|
192
|
+
fontSize: "13px",
|
|
193
|
+
fontWeight: "700",
|
|
194
|
+
cursor: "pointer",
|
|
195
|
+
fontFamily: "inherit"
|
|
196
|
+
}
|
|
197
|
+
},
|
|
198
|
+
"Add to Cart"
|
|
199
|
+
), /* @__PURE__ */ React3.createElement(
|
|
200
|
+
"button",
|
|
201
|
+
{
|
|
202
|
+
onClick: onViewDetails,
|
|
203
|
+
style: {
|
|
204
|
+
flex: 1,
|
|
205
|
+
padding: "10px",
|
|
206
|
+
borderRadius: "8px",
|
|
207
|
+
border: "1px solid " + alpha(accent, 0.3),
|
|
208
|
+
background: "transparent",
|
|
209
|
+
color: accent,
|
|
210
|
+
fontSize: "13px",
|
|
211
|
+
fontWeight: "600",
|
|
212
|
+
cursor: "pointer",
|
|
213
|
+
fontFamily: "inherit"
|
|
214
|
+
}
|
|
215
|
+
},
|
|
216
|
+
"View Details"
|
|
217
|
+
)))
|
|
218
|
+
);
|
|
219
|
+
};
|
|
220
|
+
export {
|
|
221
|
+
Button,
|
|
222
|
+
Card,
|
|
223
|
+
ProductCard
|
|
224
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,23 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@divyanshinigam/virtualui-lib",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "@divyanshinigam/virtualui-lib",
|
|
3
|
+
"version": "1.0.2",
|
|
4
|
+
"description": "Virtual UI React Component Library",
|
|
5
|
+
"license": "ISC",
|
|
6
|
+
"author": "Capstone Team",
|
|
7
|
+
"type": "commonjs",
|
|
8
|
+
"main": "dist/index.js",
|
|
9
|
+
"module": "dist/index.mjs",
|
|
10
|
+
"files": [
|
|
11
|
+
"dist"
|
|
12
|
+
],
|
|
13
|
+
"scripts": {
|
|
14
|
+
"build": "tsup"
|
|
15
|
+
},
|
|
16
|
+
"peerDependencies": {
|
|
17
|
+
"react": ">=18"
|
|
18
|
+
},
|
|
19
|
+
"devDependencies": {
|
|
20
|
+
"tsup": "^8.5.1",
|
|
21
|
+
"typescript": "^7.0.2"
|
|
22
|
+
}
|
|
23
|
+
}
|
package/README.md
DELETED