virtuo-ui-library 1.0.1 → 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 CHANGED
@@ -266,89 +266,72 @@ function shadeColor2(hex, percent) {
266
266
  var import_react3 = __toESM(require("react"));
267
267
  var ProfileCard = ({
268
268
  name = "John Doe",
269
- role = "Frontend Developer",
270
- avatar = "https://images.unsplash.com/photo-1500648767791-00dcc994a43e?w=400&q=80",
271
- bio = "Passionate about building modern, scalable, and user-friendly web applications.",
272
- location = "New York, USA",
273
- followers = "12.4K",
274
- following = "480",
275
- posts = "128",
276
- primaryColor = "#2563eb",
277
- buttonText = "Follow",
278
- onButtonClick = () => {
279
- }
269
+ role = "Software Engineer",
270
+ avatarUrl = "https://i.pravatar.cc/150?img=3",
271
+ color = "#4f46e5",
272
+ size = "medium"
280
273
  }) => {
281
- const [hovered, setHovered] = (0, import_react3.useState)(false);
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
+ };
282
324
  return /* @__PURE__ */ import_react3.default.createElement(
283
325
  "div",
284
326
  {
285
- className: `w-full max-w-sm rounded-3xl bg-white shadow-lg overflow-hidden transition-all duration-300 ${hovered ? "scale-[1.02] shadow-2xl" : ""}`,
286
- onMouseEnter: () => setHovered(true),
287
- onMouseLeave: () => setHovered(false),
288
- "aria-label": "Profile Card"
327
+ style: cardStyle,
328
+ onMouseEnter: () => setIsHovered(true),
329
+ onMouseLeave: () => setIsHovered(false)
289
330
  },
290
- /* @__PURE__ */ import_react3.default.createElement(
291
- "div",
292
- {
293
- className: "h-28",
294
- style: {
295
- background: `linear-gradient(135deg, ${primaryColor}, #7c3aed)`
296
- }
297
- }
298
- ),
299
- /* @__PURE__ */ import_react3.default.createElement("div", { className: "relative flex flex-col items-center px-6 pb-6" }, /* @__PURE__ */ import_react3.default.createElement(
300
- "img",
301
- {
302
- src: avatar,
303
- alt: `${name}'s avatar`,
304
- className: "w-28 h-28 rounded-full border-4 border-white object-cover -mt-14 shadow-md"
305
- }
306
- ), /* @__PURE__ */ import_react3.default.createElement("h2", { className: "mt-4 text-2xl font-bold text-gray-900" }, name), /* @__PURE__ */ import_react3.default.createElement(
307
- "p",
308
- {
309
- className: "mt-1 text-sm font-medium",
310
- style: { color: primaryColor }
311
- },
312
- role
313
- ), /* @__PURE__ */ import_react3.default.createElement("p", { className: "mt-3 text-center text-gray-500 text-sm" }, bio), /* @__PURE__ */ import_react3.default.createElement("div", { className: "mt-3 flex items-center gap-2 text-sm text-gray-500" }, /* @__PURE__ */ import_react3.default.createElement(
314
- "svg",
315
- {
316
- xmlns: "http://www.w3.org/2000/svg",
317
- className: "w-4 h-4",
318
- fill: "none",
319
- viewBox: "0 0 24 24",
320
- stroke: "currentColor"
321
- },
322
- /* @__PURE__ */ import_react3.default.createElement(
323
- "path",
324
- {
325
- strokeLinecap: "round",
326
- strokeLinejoin: "round",
327
- strokeWidth: 2,
328
- d: "M17.657 16.657L13.414 20.9a2 2 0 01-2.828 0l-4.243-4.243a8 8 0 1111.314 0z"
329
- }
330
- ),
331
- /* @__PURE__ */ import_react3.default.createElement(
332
- "path",
333
- {
334
- strokeLinecap: "round",
335
- strokeLinejoin: "round",
336
- strokeWidth: 2,
337
- d: "M15 11a3 3 0 11-6 0 3 3 0 016 0z"
338
- }
339
- )
340
- ), location), /* @__PURE__ */ import_react3.default.createElement("div", { className: "mt-6 grid grid-cols-3 w-full text-center border-y border-gray-200 py-4" }, /* @__PURE__ */ import_react3.default.createElement("div", null, /* @__PURE__ */ import_react3.default.createElement("p", { className: "font-bold text-gray-900" }, posts), /* @__PURE__ */ import_react3.default.createElement("p", { className: "text-xs text-gray-500 mt-1" }, "Posts")), /* @__PURE__ */ import_react3.default.createElement("div", null, /* @__PURE__ */ import_react3.default.createElement("p", { className: "font-bold text-gray-900" }, followers), /* @__PURE__ */ import_react3.default.createElement("p", { className: "text-xs text-gray-500 mt-1" }, "Followers")), /* @__PURE__ */ import_react3.default.createElement("div", null, /* @__PURE__ */ import_react3.default.createElement("p", { className: "font-bold text-gray-900" }, following), /* @__PURE__ */ import_react3.default.createElement("p", { className: "text-xs text-gray-500 mt-1" }, "Following"))), /* @__PURE__ */ import_react3.default.createElement(
341
- "button",
342
- {
343
- onClick: onButtonClick,
344
- className: "mt-6 w-full rounded-xl px-5 py-3 text-white font-semibold transition-all duration-300 hover:opacity-90 hover:scale-[1.02] focus:outline-none focus:ring-4",
345
- style: {
346
- backgroundColor: primaryColor,
347
- boxShadow: `0 10px 25px ${primaryColor}33`
348
- }
349
- },
350
- buttonText
351
- ))
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")
352
335
  );
353
336
  };
354
337
  // Annotate the CommonJS export names for ESM import in node:
package/dist/index.mjs CHANGED
@@ -229,89 +229,72 @@ function shadeColor2(hex, percent) {
229
229
  import React3, { useState as useState3 } from "react";
230
230
  var ProfileCard = ({
231
231
  name = "John Doe",
232
- role = "Frontend Developer",
233
- avatar = "https://images.unsplash.com/photo-1500648767791-00dcc994a43e?w=400&q=80",
234
- bio = "Passionate about building modern, scalable, and user-friendly web applications.",
235
- location = "New York, USA",
236
- followers = "12.4K",
237
- following = "480",
238
- posts = "128",
239
- primaryColor = "#2563eb",
240
- buttonText = "Follow",
241
- onButtonClick = () => {
242
- }
232
+ role = "Software Engineer",
233
+ avatarUrl = "https://i.pravatar.cc/150?img=3",
234
+ color = "#4f46e5",
235
+ size = "medium"
243
236
  }) => {
244
- const [hovered, setHovered] = useState3(false);
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
+ };
245
287
  return /* @__PURE__ */ React3.createElement(
246
288
  "div",
247
289
  {
248
- className: `w-full max-w-sm rounded-3xl bg-white shadow-lg overflow-hidden transition-all duration-300 ${hovered ? "scale-[1.02] shadow-2xl" : ""}`,
249
- onMouseEnter: () => setHovered(true),
250
- onMouseLeave: () => setHovered(false),
251
- "aria-label": "Profile Card"
290
+ style: cardStyle,
291
+ onMouseEnter: () => setIsHovered(true),
292
+ onMouseLeave: () => setIsHovered(false)
252
293
  },
253
- /* @__PURE__ */ React3.createElement(
254
- "div",
255
- {
256
- className: "h-28",
257
- style: {
258
- background: `linear-gradient(135deg, ${primaryColor}, #7c3aed)`
259
- }
260
- }
261
- ),
262
- /* @__PURE__ */ React3.createElement("div", { className: "relative flex flex-col items-center px-6 pb-6" }, /* @__PURE__ */ React3.createElement(
263
- "img",
264
- {
265
- src: avatar,
266
- alt: `${name}'s avatar`,
267
- className: "w-28 h-28 rounded-full border-4 border-white object-cover -mt-14 shadow-md"
268
- }
269
- ), /* @__PURE__ */ React3.createElement("h2", { className: "mt-4 text-2xl font-bold text-gray-900" }, name), /* @__PURE__ */ React3.createElement(
270
- "p",
271
- {
272
- className: "mt-1 text-sm font-medium",
273
- style: { color: primaryColor }
274
- },
275
- role
276
- ), /* @__PURE__ */ React3.createElement("p", { className: "mt-3 text-center text-gray-500 text-sm" }, bio), /* @__PURE__ */ React3.createElement("div", { className: "mt-3 flex items-center gap-2 text-sm text-gray-500" }, /* @__PURE__ */ React3.createElement(
277
- "svg",
278
- {
279
- xmlns: "http://www.w3.org/2000/svg",
280
- className: "w-4 h-4",
281
- fill: "none",
282
- viewBox: "0 0 24 24",
283
- stroke: "currentColor"
284
- },
285
- /* @__PURE__ */ React3.createElement(
286
- "path",
287
- {
288
- strokeLinecap: "round",
289
- strokeLinejoin: "round",
290
- strokeWidth: 2,
291
- d: "M17.657 16.657L13.414 20.9a2 2 0 01-2.828 0l-4.243-4.243a8 8 0 1111.314 0z"
292
- }
293
- ),
294
- /* @__PURE__ */ React3.createElement(
295
- "path",
296
- {
297
- strokeLinecap: "round",
298
- strokeLinejoin: "round",
299
- strokeWidth: 2,
300
- d: "M15 11a3 3 0 11-6 0 3 3 0 016 0z"
301
- }
302
- )
303
- ), location), /* @__PURE__ */ React3.createElement("div", { className: "mt-6 grid grid-cols-3 w-full text-center border-y border-gray-200 py-4" }, /* @__PURE__ */ React3.createElement("div", null, /* @__PURE__ */ React3.createElement("p", { className: "font-bold text-gray-900" }, posts), /* @__PURE__ */ React3.createElement("p", { className: "text-xs text-gray-500 mt-1" }, "Posts")), /* @__PURE__ */ React3.createElement("div", null, /* @__PURE__ */ React3.createElement("p", { className: "font-bold text-gray-900" }, followers), /* @__PURE__ */ React3.createElement("p", { className: "text-xs text-gray-500 mt-1" }, "Followers")), /* @__PURE__ */ React3.createElement("div", null, /* @__PURE__ */ React3.createElement("p", { className: "font-bold text-gray-900" }, following), /* @__PURE__ */ React3.createElement("p", { className: "text-xs text-gray-500 mt-1" }, "Following"))), /* @__PURE__ */ React3.createElement(
304
- "button",
305
- {
306
- onClick: onButtonClick,
307
- className: "mt-6 w-full rounded-xl px-5 py-3 text-white font-semibold transition-all duration-300 hover:opacity-90 hover:scale-[1.02] focus:outline-none focus:ring-4",
308
- style: {
309
- backgroundColor: primaryColor,
310
- boxShadow: `0 10px 25px ${primaryColor}33`
311
- }
312
- },
313
- buttonText
314
- ))
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")
315
298
  );
316
299
  };
317
300
  export {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "virtuo-ui-library",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "description": "Virtual UI React Component Library",
5
5
  "license": "ISC",
6
6
  "author": "Ritik Saini",