virtuo-ui-library 1.0.0 → 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 +77 -2
- package/dist/index.mjs +75 -1
- package/package.json +5 -4
package/dist/index.js
CHANGED
|
@@ -30,7 +30,8 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
30
30
|
var index_exports = {};
|
|
31
31
|
__export(index_exports, {
|
|
32
32
|
Button: () => Button,
|
|
33
|
-
Card: () => Card
|
|
33
|
+
Card: () => Card,
|
|
34
|
+
ProfileCard: () => ProfileCard
|
|
34
35
|
});
|
|
35
36
|
module.exports = __toCommonJS(index_exports);
|
|
36
37
|
|
|
@@ -260,8 +261,82 @@ function shadeColor2(hex, percent) {
|
|
|
260
261
|
const b = Math.min(255, Math.max(0, (num & 255) + percent));
|
|
261
262
|
return `rgb(${r},${g},${b})`;
|
|
262
263
|
}
|
|
264
|
+
|
|
265
|
+
// src/components/ProfileCard/ProfileCard.jsx
|
|
266
|
+
var import_react3 = __toESM(require("react"));
|
|
267
|
+
var ProfileCard = ({
|
|
268
|
+
name = "John Doe",
|
|
269
|
+
role = "Software Engineer",
|
|
270
|
+
avatarUrl = "https://i.pravatar.cc/150?img=3",
|
|
271
|
+
color = "#4f46e5",
|
|
272
|
+
size = "medium"
|
|
273
|
+
}) => {
|
|
274
|
+
const [isHovered, setIsHovered] = (0, import_react3.useState)(false);
|
|
275
|
+
const [isFollowing, setIsFollowing] = (0, import_react3.useState)(false);
|
|
276
|
+
const sizeMap = {
|
|
277
|
+
small: { width: 220, avatar: 60, fontSize: 14 },
|
|
278
|
+
medium: { width: 280, avatar: 80, fontSize: 16 },
|
|
279
|
+
large: { width: 340, avatar: 100, fontSize: 18 }
|
|
280
|
+
};
|
|
281
|
+
const { width, avatar, fontSize } = sizeMap[size] || sizeMap.medium;
|
|
282
|
+
const cardStyle = {
|
|
283
|
+
width,
|
|
284
|
+
padding: "20px",
|
|
285
|
+
borderRadius: "16px",
|
|
286
|
+
textAlign: "center",
|
|
287
|
+
fontFamily: "Arial, sans-serif",
|
|
288
|
+
backgroundColor: "#ffffff",
|
|
289
|
+
boxShadow: isHovered ? "0 12px 24px rgba(0,0,0,0.15)" : "0 4px 12px rgba(0,0,0,0.08)",
|
|
290
|
+
transform: isHovered ? "translateY(-4px)" : "translateY(0)",
|
|
291
|
+
transition: "all 0.25s ease-in-out",
|
|
292
|
+
border: `1px solid ${color}20`
|
|
293
|
+
};
|
|
294
|
+
const avatarStyle = {
|
|
295
|
+
width: avatar,
|
|
296
|
+
height: avatar,
|
|
297
|
+
borderRadius: "50%",
|
|
298
|
+
objectFit: "cover",
|
|
299
|
+
border: `3px solid ${color}`,
|
|
300
|
+
marginBottom: "12px"
|
|
301
|
+
};
|
|
302
|
+
const nameStyle = {
|
|
303
|
+
margin: 0,
|
|
304
|
+
fontSize: fontSize + 4,
|
|
305
|
+
fontWeight: "bold",
|
|
306
|
+
color: "#1f2937"
|
|
307
|
+
};
|
|
308
|
+
const roleStyle = {
|
|
309
|
+
margin: "4px 0 16px",
|
|
310
|
+
fontSize,
|
|
311
|
+
color: "#6b7280"
|
|
312
|
+
};
|
|
313
|
+
const buttonStyle = {
|
|
314
|
+
padding: "8px 20px",
|
|
315
|
+
borderRadius: "999px",
|
|
316
|
+
cursor: "pointer",
|
|
317
|
+
fontSize,
|
|
318
|
+
fontWeight: 600,
|
|
319
|
+
color: isFollowing ? color : "#ffffff",
|
|
320
|
+
backgroundColor: isFollowing ? "#ffffff" : color,
|
|
321
|
+
border: `2px solid ${color}`,
|
|
322
|
+
transition: "all 0.2s ease-in-out"
|
|
323
|
+
};
|
|
324
|
+
return /* @__PURE__ */ import_react3.default.createElement(
|
|
325
|
+
"div",
|
|
326
|
+
{
|
|
327
|
+
style: cardStyle,
|
|
328
|
+
onMouseEnter: () => setIsHovered(true),
|
|
329
|
+
onMouseLeave: () => setIsHovered(false)
|
|
330
|
+
},
|
|
331
|
+
/* @__PURE__ */ import_react3.default.createElement("img", { src: avatarUrl, alt: name, style: avatarStyle }),
|
|
332
|
+
/* @__PURE__ */ import_react3.default.createElement("h3", { style: nameStyle }, name),
|
|
333
|
+
/* @__PURE__ */ import_react3.default.createElement("p", { style: roleStyle }, role),
|
|
334
|
+
/* @__PURE__ */ import_react3.default.createElement("button", { style: buttonStyle, onClick: () => setIsFollowing(!isFollowing) }, isFollowing ? "Following" : "Follow")
|
|
335
|
+
);
|
|
336
|
+
};
|
|
263
337
|
// Annotate the CommonJS export names for ESM import in node:
|
|
264
338
|
0 && (module.exports = {
|
|
265
339
|
Button,
|
|
266
|
-
Card
|
|
340
|
+
Card,
|
|
341
|
+
ProfileCard
|
|
267
342
|
});
|
package/dist/index.mjs
CHANGED
|
@@ -224,7 +224,81 @@ function shadeColor2(hex, percent) {
|
|
|
224
224
|
const b = Math.min(255, Math.max(0, (num & 255) + percent));
|
|
225
225
|
return `rgb(${r},${g},${b})`;
|
|
226
226
|
}
|
|
227
|
+
|
|
228
|
+
// src/components/ProfileCard/ProfileCard.jsx
|
|
229
|
+
import React3, { useState as useState3 } from "react";
|
|
230
|
+
var ProfileCard = ({
|
|
231
|
+
name = "John Doe",
|
|
232
|
+
role = "Software Engineer",
|
|
233
|
+
avatarUrl = "https://i.pravatar.cc/150?img=3",
|
|
234
|
+
color = "#4f46e5",
|
|
235
|
+
size = "medium"
|
|
236
|
+
}) => {
|
|
237
|
+
const [isHovered, setIsHovered] = useState3(false);
|
|
238
|
+
const [isFollowing, setIsFollowing] = useState3(false);
|
|
239
|
+
const sizeMap = {
|
|
240
|
+
small: { width: 220, avatar: 60, fontSize: 14 },
|
|
241
|
+
medium: { width: 280, avatar: 80, fontSize: 16 },
|
|
242
|
+
large: { width: 340, avatar: 100, fontSize: 18 }
|
|
243
|
+
};
|
|
244
|
+
const { width, avatar, fontSize } = sizeMap[size] || sizeMap.medium;
|
|
245
|
+
const cardStyle = {
|
|
246
|
+
width,
|
|
247
|
+
padding: "20px",
|
|
248
|
+
borderRadius: "16px",
|
|
249
|
+
textAlign: "center",
|
|
250
|
+
fontFamily: "Arial, sans-serif",
|
|
251
|
+
backgroundColor: "#ffffff",
|
|
252
|
+
boxShadow: isHovered ? "0 12px 24px rgba(0,0,0,0.15)" : "0 4px 12px rgba(0,0,0,0.08)",
|
|
253
|
+
transform: isHovered ? "translateY(-4px)" : "translateY(0)",
|
|
254
|
+
transition: "all 0.25s ease-in-out",
|
|
255
|
+
border: `1px solid ${color}20`
|
|
256
|
+
};
|
|
257
|
+
const avatarStyle = {
|
|
258
|
+
width: avatar,
|
|
259
|
+
height: avatar,
|
|
260
|
+
borderRadius: "50%",
|
|
261
|
+
objectFit: "cover",
|
|
262
|
+
border: `3px solid ${color}`,
|
|
263
|
+
marginBottom: "12px"
|
|
264
|
+
};
|
|
265
|
+
const nameStyle = {
|
|
266
|
+
margin: 0,
|
|
267
|
+
fontSize: fontSize + 4,
|
|
268
|
+
fontWeight: "bold",
|
|
269
|
+
color: "#1f2937"
|
|
270
|
+
};
|
|
271
|
+
const roleStyle = {
|
|
272
|
+
margin: "4px 0 16px",
|
|
273
|
+
fontSize,
|
|
274
|
+
color: "#6b7280"
|
|
275
|
+
};
|
|
276
|
+
const buttonStyle = {
|
|
277
|
+
padding: "8px 20px",
|
|
278
|
+
borderRadius: "999px",
|
|
279
|
+
cursor: "pointer",
|
|
280
|
+
fontSize,
|
|
281
|
+
fontWeight: 600,
|
|
282
|
+
color: isFollowing ? color : "#ffffff",
|
|
283
|
+
backgroundColor: isFollowing ? "#ffffff" : color,
|
|
284
|
+
border: `2px solid ${color}`,
|
|
285
|
+
transition: "all 0.2s ease-in-out"
|
|
286
|
+
};
|
|
287
|
+
return /* @__PURE__ */ React3.createElement(
|
|
288
|
+
"div",
|
|
289
|
+
{
|
|
290
|
+
style: cardStyle,
|
|
291
|
+
onMouseEnter: () => setIsHovered(true),
|
|
292
|
+
onMouseLeave: () => setIsHovered(false)
|
|
293
|
+
},
|
|
294
|
+
/* @__PURE__ */ React3.createElement("img", { src: avatarUrl, alt: name, style: avatarStyle }),
|
|
295
|
+
/* @__PURE__ */ React3.createElement("h3", { style: nameStyle }, name),
|
|
296
|
+
/* @__PURE__ */ React3.createElement("p", { style: roleStyle }, role),
|
|
297
|
+
/* @__PURE__ */ React3.createElement("button", { style: buttonStyle, onClick: () => setIsFollowing(!isFollowing) }, isFollowing ? "Following" : "Follow")
|
|
298
|
+
);
|
|
299
|
+
};
|
|
227
300
|
export {
|
|
228
301
|
Button,
|
|
229
|
-
Card
|
|
302
|
+
Card,
|
|
303
|
+
ProfileCard
|
|
230
304
|
};
|
package/package.json
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "virtuo-ui-library",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "Virtual UI React Component Library",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"author": "Ritik Saini",
|
|
7
7
|
"main": "dist/index.js",
|
|
8
|
-
"module"
|
|
9
|
-
"files": [
|
|
10
|
-
|
|
8
|
+
"module": "dist/index.mjs",
|
|
9
|
+
"files": [
|
|
10
|
+
"dist"
|
|
11
|
+
],
|
|
11
12
|
"scripts": {
|
|
12
13
|
"build": "tsup"
|
|
13
14
|
},
|