virtual-ui-library-uday 1.0.10 → 1.0.11
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 +58 -94
- package/dist/index.mjs +58 -94
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -35,90 +35,9 @@ __export(index_exports, {
|
|
|
35
35
|
});
|
|
36
36
|
module.exports = __toCommonJS(index_exports);
|
|
37
37
|
|
|
38
|
-
// src/components/
|
|
38
|
+
// src/components/Card/Card.jsx
|
|
39
39
|
var import_react = __toESM(require("react"));
|
|
40
40
|
var import_react2 = require("react");
|
|
41
|
-
var Button = ({
|
|
42
|
-
label = "Click Me",
|
|
43
|
-
onClick = () => {
|
|
44
|
-
},
|
|
45
|
-
backgroundColor = "#6c63ff",
|
|
46
|
-
color = "#ffffff",
|
|
47
|
-
hoverBackgroundColor = "#574fd6",
|
|
48
|
-
hoverColor = "#ffffff",
|
|
49
|
-
fontSize = "15px",
|
|
50
|
-
paddingX = "24px",
|
|
51
|
-
paddingY = "11px",
|
|
52
|
-
borderRadius = "8px",
|
|
53
|
-
border = "none",
|
|
54
|
-
fontFamily = "'Segoe UI', sans-serif",
|
|
55
|
-
fontWeight = "600",
|
|
56
|
-
disabled = false,
|
|
57
|
-
loading = false,
|
|
58
|
-
icon = null
|
|
59
|
-
}) => {
|
|
60
|
-
const [hovered, setHovered] = (0, import_react2.useState)(false);
|
|
61
|
-
const [pressed, setPressed] = (0, import_react2.useState)(false);
|
|
62
|
-
const style = {
|
|
63
|
-
display: "inline-flex",
|
|
64
|
-
alignItems: "center",
|
|
65
|
-
justifyContent: "center",
|
|
66
|
-
gap: "8px",
|
|
67
|
-
padding: `${paddingY} ${paddingX}`,
|
|
68
|
-
backgroundColor: disabled ? "#cccccc" : hovered ? hoverBackgroundColor : backgroundColor,
|
|
69
|
-
color: hovered ? hoverColor : color,
|
|
70
|
-
fontSize,
|
|
71
|
-
fontFamily,
|
|
72
|
-
fontWeight,
|
|
73
|
-
border,
|
|
74
|
-
borderRadius,
|
|
75
|
-
cursor: disabled || loading ? "not-allowed" : "pointer",
|
|
76
|
-
opacity: disabled ? 0.6 : 1,
|
|
77
|
-
transform: pressed && !disabled ? "scale(0.96)" : "scale(1)",
|
|
78
|
-
boxShadow: hovered && !disabled ? "0 6px 20px rgba(108,99,255,0.35)" : "0 2px 8px rgba(0,0,0,0.12)",
|
|
79
|
-
transition: "all 0.2s ease",
|
|
80
|
-
outline: "none",
|
|
81
|
-
userSelect: "none",
|
|
82
|
-
letterSpacing: "0.03em"
|
|
83
|
-
};
|
|
84
|
-
const spinnerStyle = {
|
|
85
|
-
width: "13px",
|
|
86
|
-
height: "13px",
|
|
87
|
-
border: `2px solid ${color}44`,
|
|
88
|
-
borderTop: `2px solid ${color}`,
|
|
89
|
-
borderRadius: "50%",
|
|
90
|
-
animation: "btn-spin 0.65s linear infinite"
|
|
91
|
-
};
|
|
92
|
-
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement("style", null, `
|
|
93
|
-
@keyframes btn-spin {
|
|
94
|
-
to {
|
|
95
|
-
transform: rotate(360deg);
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
`), /* @__PURE__ */ import_react.default.createElement(
|
|
99
|
-
"button",
|
|
100
|
-
{
|
|
101
|
-
style,
|
|
102
|
-
onClick: !disabled && !loading ? onClick : void 0,
|
|
103
|
-
onMouseEnter: () => setHovered(true),
|
|
104
|
-
onMouseLeave: () => {
|
|
105
|
-
setHovered(false);
|
|
106
|
-
setPressed(false);
|
|
107
|
-
},
|
|
108
|
-
onMouseDown: () => setPressed(true),
|
|
109
|
-
onMouseUp: () => setPressed(false),
|
|
110
|
-
disabled,
|
|
111
|
-
"aria-disabled": disabled || loading,
|
|
112
|
-
"aria-label": label
|
|
113
|
-
},
|
|
114
|
-
loading ? /* @__PURE__ */ import_react.default.createElement("span", { style: spinnerStyle }) : icon && /* @__PURE__ */ import_react.default.createElement("span", null, icon),
|
|
115
|
-
loading ? "Loading..." : label
|
|
116
|
-
));
|
|
117
|
-
};
|
|
118
|
-
|
|
119
|
-
// src/components/Card/Card.jsx
|
|
120
|
-
var import_react3 = __toESM(require("react"));
|
|
121
|
-
var import_react4 = require("react");
|
|
122
41
|
var Card = ({
|
|
123
42
|
image = "https://images.unsplash.com/photo-1506905925346-21bda4d32df4?w=600&q=80",
|
|
124
43
|
category = "Travel",
|
|
@@ -138,10 +57,10 @@ var Card = ({
|
|
|
138
57
|
onReadMore = () => {
|
|
139
58
|
}
|
|
140
59
|
}) => {
|
|
141
|
-
const [liked, setLiked] = (0,
|
|
142
|
-
const [likeCount, setLikeCount] = (0,
|
|
143
|
-
const [saved, setSaved] = (0,
|
|
144
|
-
const [imgHovered, setImgHovered] = (0,
|
|
60
|
+
const [liked, setLiked] = (0, import_react2.useState)(false);
|
|
61
|
+
const [likeCount, setLikeCount] = (0, import_react2.useState)(likes);
|
|
62
|
+
const [saved, setSaved] = (0, import_react2.useState)(bookmarked);
|
|
63
|
+
const [imgHovered, setImgHovered] = (0, import_react2.useState)(false);
|
|
145
64
|
const handleLike = () => {
|
|
146
65
|
setLiked(!liked);
|
|
147
66
|
setLikeCount((c) => liked ? c - 1 : c + 1);
|
|
@@ -283,17 +202,17 @@ var Card = ({
|
|
|
283
202
|
transition: "opacity 0.2s ease"
|
|
284
203
|
}
|
|
285
204
|
};
|
|
286
|
-
return /* @__PURE__ */
|
|
205
|
+
return /* @__PURE__ */ import_react.default.createElement("div", { style: styles.card }, /* @__PURE__ */ import_react.default.createElement(
|
|
287
206
|
"div",
|
|
288
207
|
{
|
|
289
208
|
style: styles.imageWrap,
|
|
290
209
|
onMouseEnter: () => setImgHovered(true),
|
|
291
210
|
onMouseLeave: () => setImgHovered(false)
|
|
292
211
|
},
|
|
293
|
-
/* @__PURE__ */
|
|
294
|
-
/* @__PURE__ */
|
|
295
|
-
/* @__PURE__ */
|
|
296
|
-
), /* @__PURE__ */
|
|
212
|
+
/* @__PURE__ */ import_react.default.createElement("img", { src: image, alt: title, style: styles.image }),
|
|
213
|
+
/* @__PURE__ */ import_react.default.createElement("div", { style: styles.imageOverlay }),
|
|
214
|
+
/* @__PURE__ */ import_react.default.createElement("span", { style: styles.category }, category)
|
|
215
|
+
), /* @__PURE__ */ import_react.default.createElement("div", { style: styles.body }, /* @__PURE__ */ import_react.default.createElement("div", { style: styles.title }, title), /* @__PURE__ */ import_react.default.createElement("div", { style: styles.description }, description), /* @__PURE__ */ import_react.default.createElement("div", { style: styles.divider }), /* @__PURE__ */ import_react.default.createElement("div", { style: styles.meta }, /* @__PURE__ */ import_react.default.createElement("img", { src: authorAvatar, alt: author, style: styles.avatar }), /* @__PURE__ */ import_react.default.createElement("div", null, /* @__PURE__ */ import_react.default.createElement("div", { style: styles.authorName }, author)), /* @__PURE__ */ import_react.default.createElement("div", { style: styles.metaRight }, /* @__PURE__ */ import_react.default.createElement("span", { style: styles.metaText }, date), /* @__PURE__ */ import_react.default.createElement("span", { style: styles.metaText }, readTime))), /* @__PURE__ */ import_react.default.createElement("div", { style: styles.actions }, /* @__PURE__ */ import_react.default.createElement("button", { style: styles.iconBtn(liked, "#e74c3c"), onClick: handleLike }, liked ? "\u2665" : "\u2661", " ", likeCount), /* @__PURE__ */ import_react.default.createElement("button", { style: styles.iconBtn(saved, accentColor), onClick: handleBookmark }, saved ? "\u229F" : "\u229E", " ", saved ? "Saved" : "Save"), /* @__PURE__ */ import_react.default.createElement(
|
|
297
216
|
"button",
|
|
298
217
|
{
|
|
299
218
|
style: styles.readBtn,
|
|
@@ -306,7 +225,7 @@ var Card = ({
|
|
|
306
225
|
};
|
|
307
226
|
|
|
308
227
|
// src/components/profilecard/Profilecard.jsx
|
|
309
|
-
var
|
|
228
|
+
var import_react3 = __toESM(require("react"));
|
|
310
229
|
var Profilecard = ({
|
|
311
230
|
name = "Priya Mehta",
|
|
312
231
|
role = "Product Designer",
|
|
@@ -322,7 +241,7 @@ var Profilecard = ({
|
|
|
322
241
|
onMessage = () => {
|
|
323
242
|
}
|
|
324
243
|
}) => {
|
|
325
|
-
const [isFollowing, setIsFollowing] = (0,
|
|
244
|
+
const [isFollowing, setIsFollowing] = (0, import_react3.useState)(false);
|
|
326
245
|
const s = {
|
|
327
246
|
card: {
|
|
328
247
|
width: "300px",
|
|
@@ -455,7 +374,52 @@ var Profilecard = ({
|
|
|
455
374
|
{ num: following, lbl: "Following" },
|
|
456
375
|
{ num: projects, lbl: "Projects" }
|
|
457
376
|
];
|
|
458
|
-
return /* @__PURE__ */
|
|
377
|
+
return /* @__PURE__ */ import_react3.default.createElement("div", { style: s.card }, /* @__PURE__ */ import_react3.default.createElement("div", { style: s.cover }, /* @__PURE__ */ import_react3.default.createElement("div", { style: s.avatarWrap }, /* @__PURE__ */ import_react3.default.createElement("img", { src: avatar, alt: name, style: s.avatar }), /* @__PURE__ */ import_react3.default.createElement("span", { style: s.dot }))), /* @__PURE__ */ import_react3.default.createElement("div", { style: s.info }, /* @__PURE__ */ import_react3.default.createElement("p", { style: s.name }, name), /* @__PURE__ */ import_react3.default.createElement("p", { style: s.role }, role, " \xB7 ", /* @__PURE__ */ import_react3.default.createElement("span", { style: { color: "#aaa" } }, company)), /* @__PURE__ */ import_react3.default.createElement("div", { style: s.location }, /* @__PURE__ */ import_react3.default.createElement("span", null, "\u{1F4CD}"), " ", location)), /* @__PURE__ */ import_react3.default.createElement("div", { style: s.tags }, tags.map((t) => /* @__PURE__ */ import_react3.default.createElement("span", { key: t, style: s.tag }, t))), /* @__PURE__ */ import_react3.default.createElement("div", { style: s.stats }, stats.map((st, i) => /* @__PURE__ */ import_react3.default.createElement("div", { key: st.lbl, style: s.stat(i) }, /* @__PURE__ */ import_react3.default.createElement("div", { style: s.statNum }, st.num), /* @__PURE__ */ import_react3.default.createElement("div", { style: s.statLbl }, st.lbl)))), /* @__PURE__ */ import_react3.default.createElement("div", { style: s.actions }, /* @__PURE__ */ import_react3.default.createElement("button", { style: s.followBtn, onClick: () => setIsFollowing(!isFollowing) }, isFollowing ? "Following \u2713" : "Follow"), /* @__PURE__ */ import_react3.default.createElement("button", { style: s.msgBtn, onClick: onMessage }, "\u{1F4AC}")));
|
|
378
|
+
};
|
|
379
|
+
|
|
380
|
+
// src/components/Button/Button.jsx
|
|
381
|
+
var import_react4 = __toESM(require("react"));
|
|
382
|
+
var alpha = (hex, op) => {
|
|
383
|
+
const r = parseInt(hex.slice(1, 3), 16), g = parseInt(hex.slice(3, 5), 16), b = parseInt(hex.slice(5, 7), 16);
|
|
384
|
+
return "rgba(" + r + "," + g + "," + b + "," + op + ")";
|
|
385
|
+
};
|
|
386
|
+
var Button = ({
|
|
387
|
+
label = "Click me",
|
|
388
|
+
onClick = () => console.log("Button clicked"),
|
|
389
|
+
color = "#4CAF50",
|
|
390
|
+
disabled = false,
|
|
391
|
+
size = "medium"
|
|
392
|
+
}) => {
|
|
393
|
+
const sizes = {
|
|
394
|
+
small: { padding: "6px 12px", fontSize: "12px" },
|
|
395
|
+
medium: { padding: "10px 20px", fontSize: "14px" },
|
|
396
|
+
large: { padding: "14px 28px", fontSize: "16px" }
|
|
397
|
+
};
|
|
398
|
+
const buttonStyle = {
|
|
399
|
+
backgroundColor: disabled ? "#cccccc" : color,
|
|
400
|
+
color: "white",
|
|
401
|
+
border: "none",
|
|
402
|
+
borderRadius: "4px",
|
|
403
|
+
cursor: disabled ? "not-allowed" : "pointer",
|
|
404
|
+
fontWeight: "bold",
|
|
405
|
+
transition: "background-color 0.3s",
|
|
406
|
+
...sizes[size]
|
|
407
|
+
};
|
|
408
|
+
const hoverStyle = {
|
|
409
|
+
backgroundColor: disabled ? "#cccccc" : alpha(color, 0.8)
|
|
410
|
+
};
|
|
411
|
+
const [hover, setHover] = import_react4.default.useState(false);
|
|
412
|
+
return /* @__PURE__ */ import_react4.default.createElement(
|
|
413
|
+
"button",
|
|
414
|
+
{
|
|
415
|
+
onClick: !disabled ? onClick : null,
|
|
416
|
+
style: hover ? { ...buttonStyle, ...hoverStyle } : buttonStyle,
|
|
417
|
+
onMouseEnter: () => setHover(true),
|
|
418
|
+
onMouseLeave: () => setHover(false),
|
|
419
|
+
disabled
|
|
420
|
+
},
|
|
421
|
+
label
|
|
422
|
+
);
|
|
459
423
|
};
|
|
460
424
|
// Annotate the CommonJS export names for ESM import in node:
|
|
461
425
|
0 && (module.exports = {
|
package/dist/index.mjs
CHANGED
|
@@ -1,87 +1,6 @@
|
|
|
1
|
-
// src/components/
|
|
1
|
+
// src/components/Card/Card.jsx
|
|
2
2
|
import React from "react";
|
|
3
3
|
import { useState } from "react";
|
|
4
|
-
var Button = ({
|
|
5
|
-
label = "Click Me",
|
|
6
|
-
onClick = () => {
|
|
7
|
-
},
|
|
8
|
-
backgroundColor = "#6c63ff",
|
|
9
|
-
color = "#ffffff",
|
|
10
|
-
hoverBackgroundColor = "#574fd6",
|
|
11
|
-
hoverColor = "#ffffff",
|
|
12
|
-
fontSize = "15px",
|
|
13
|
-
paddingX = "24px",
|
|
14
|
-
paddingY = "11px",
|
|
15
|
-
borderRadius = "8px",
|
|
16
|
-
border = "none",
|
|
17
|
-
fontFamily = "'Segoe UI', sans-serif",
|
|
18
|
-
fontWeight = "600",
|
|
19
|
-
disabled = false,
|
|
20
|
-
loading = false,
|
|
21
|
-
icon = null
|
|
22
|
-
}) => {
|
|
23
|
-
const [hovered, setHovered] = useState(false);
|
|
24
|
-
const [pressed, setPressed] = useState(false);
|
|
25
|
-
const style = {
|
|
26
|
-
display: "inline-flex",
|
|
27
|
-
alignItems: "center",
|
|
28
|
-
justifyContent: "center",
|
|
29
|
-
gap: "8px",
|
|
30
|
-
padding: `${paddingY} ${paddingX}`,
|
|
31
|
-
backgroundColor: disabled ? "#cccccc" : hovered ? hoverBackgroundColor : backgroundColor,
|
|
32
|
-
color: hovered ? hoverColor : color,
|
|
33
|
-
fontSize,
|
|
34
|
-
fontFamily,
|
|
35
|
-
fontWeight,
|
|
36
|
-
border,
|
|
37
|
-
borderRadius,
|
|
38
|
-
cursor: disabled || loading ? "not-allowed" : "pointer",
|
|
39
|
-
opacity: disabled ? 0.6 : 1,
|
|
40
|
-
transform: pressed && !disabled ? "scale(0.96)" : "scale(1)",
|
|
41
|
-
boxShadow: hovered && !disabled ? "0 6px 20px rgba(108,99,255,0.35)" : "0 2px 8px rgba(0,0,0,0.12)",
|
|
42
|
-
transition: "all 0.2s ease",
|
|
43
|
-
outline: "none",
|
|
44
|
-
userSelect: "none",
|
|
45
|
-
letterSpacing: "0.03em"
|
|
46
|
-
};
|
|
47
|
-
const spinnerStyle = {
|
|
48
|
-
width: "13px",
|
|
49
|
-
height: "13px",
|
|
50
|
-
border: `2px solid ${color}44`,
|
|
51
|
-
borderTop: `2px solid ${color}`,
|
|
52
|
-
borderRadius: "50%",
|
|
53
|
-
animation: "btn-spin 0.65s linear infinite"
|
|
54
|
-
};
|
|
55
|
-
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("style", null, `
|
|
56
|
-
@keyframes btn-spin {
|
|
57
|
-
to {
|
|
58
|
-
transform: rotate(360deg);
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
`), /* @__PURE__ */ React.createElement(
|
|
62
|
-
"button",
|
|
63
|
-
{
|
|
64
|
-
style,
|
|
65
|
-
onClick: !disabled && !loading ? onClick : void 0,
|
|
66
|
-
onMouseEnter: () => setHovered(true),
|
|
67
|
-
onMouseLeave: () => {
|
|
68
|
-
setHovered(false);
|
|
69
|
-
setPressed(false);
|
|
70
|
-
},
|
|
71
|
-
onMouseDown: () => setPressed(true),
|
|
72
|
-
onMouseUp: () => setPressed(false),
|
|
73
|
-
disabled,
|
|
74
|
-
"aria-disabled": disabled || loading,
|
|
75
|
-
"aria-label": label
|
|
76
|
-
},
|
|
77
|
-
loading ? /* @__PURE__ */ React.createElement("span", { style: spinnerStyle }) : icon && /* @__PURE__ */ React.createElement("span", null, icon),
|
|
78
|
-
loading ? "Loading..." : label
|
|
79
|
-
));
|
|
80
|
-
};
|
|
81
|
-
|
|
82
|
-
// src/components/Card/Card.jsx
|
|
83
|
-
import React2 from "react";
|
|
84
|
-
import { useState as useState2 } from "react";
|
|
85
4
|
var Card = ({
|
|
86
5
|
image = "https://images.unsplash.com/photo-1506905925346-21bda4d32df4?w=600&q=80",
|
|
87
6
|
category = "Travel",
|
|
@@ -101,10 +20,10 @@ var Card = ({
|
|
|
101
20
|
onReadMore = () => {
|
|
102
21
|
}
|
|
103
22
|
}) => {
|
|
104
|
-
const [liked, setLiked] =
|
|
105
|
-
const [likeCount, setLikeCount] =
|
|
106
|
-
const [saved, setSaved] =
|
|
107
|
-
const [imgHovered, setImgHovered] =
|
|
23
|
+
const [liked, setLiked] = useState(false);
|
|
24
|
+
const [likeCount, setLikeCount] = useState(likes);
|
|
25
|
+
const [saved, setSaved] = useState(bookmarked);
|
|
26
|
+
const [imgHovered, setImgHovered] = useState(false);
|
|
108
27
|
const handleLike = () => {
|
|
109
28
|
setLiked(!liked);
|
|
110
29
|
setLikeCount((c) => liked ? c - 1 : c + 1);
|
|
@@ -246,17 +165,17 @@ var Card = ({
|
|
|
246
165
|
transition: "opacity 0.2s ease"
|
|
247
166
|
}
|
|
248
167
|
};
|
|
249
|
-
return /* @__PURE__ */
|
|
168
|
+
return /* @__PURE__ */ React.createElement("div", { style: styles.card }, /* @__PURE__ */ React.createElement(
|
|
250
169
|
"div",
|
|
251
170
|
{
|
|
252
171
|
style: styles.imageWrap,
|
|
253
172
|
onMouseEnter: () => setImgHovered(true),
|
|
254
173
|
onMouseLeave: () => setImgHovered(false)
|
|
255
174
|
},
|
|
256
|
-
/* @__PURE__ */
|
|
257
|
-
/* @__PURE__ */
|
|
258
|
-
/* @__PURE__ */
|
|
259
|
-
), /* @__PURE__ */
|
|
175
|
+
/* @__PURE__ */ React.createElement("img", { src: image, alt: title, style: styles.image }),
|
|
176
|
+
/* @__PURE__ */ React.createElement("div", { style: styles.imageOverlay }),
|
|
177
|
+
/* @__PURE__ */ React.createElement("span", { style: styles.category }, category)
|
|
178
|
+
), /* @__PURE__ */ React.createElement("div", { style: styles.body }, /* @__PURE__ */ React.createElement("div", { style: styles.title }, title), /* @__PURE__ */ React.createElement("div", { style: styles.description }, description), /* @__PURE__ */ React.createElement("div", { style: styles.divider }), /* @__PURE__ */ React.createElement("div", { style: styles.meta }, /* @__PURE__ */ React.createElement("img", { src: authorAvatar, alt: author, style: styles.avatar }), /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement("div", { style: styles.authorName }, author)), /* @__PURE__ */ React.createElement("div", { style: styles.metaRight }, /* @__PURE__ */ React.createElement("span", { style: styles.metaText }, date), /* @__PURE__ */ React.createElement("span", { style: styles.metaText }, readTime))), /* @__PURE__ */ React.createElement("div", { style: styles.actions }, /* @__PURE__ */ React.createElement("button", { style: styles.iconBtn(liked, "#e74c3c"), onClick: handleLike }, liked ? "\u2665" : "\u2661", " ", likeCount), /* @__PURE__ */ React.createElement("button", { style: styles.iconBtn(saved, accentColor), onClick: handleBookmark }, saved ? "\u229F" : "\u229E", " ", saved ? "Saved" : "Save"), /* @__PURE__ */ React.createElement(
|
|
260
179
|
"button",
|
|
261
180
|
{
|
|
262
181
|
style: styles.readBtn,
|
|
@@ -269,7 +188,7 @@ var Card = ({
|
|
|
269
188
|
};
|
|
270
189
|
|
|
271
190
|
// src/components/profilecard/Profilecard.jsx
|
|
272
|
-
import
|
|
191
|
+
import React2, { useState as useState2 } from "react";
|
|
273
192
|
var Profilecard = ({
|
|
274
193
|
name = "Priya Mehta",
|
|
275
194
|
role = "Product Designer",
|
|
@@ -285,7 +204,7 @@ var Profilecard = ({
|
|
|
285
204
|
onMessage = () => {
|
|
286
205
|
}
|
|
287
206
|
}) => {
|
|
288
|
-
const [isFollowing, setIsFollowing] =
|
|
207
|
+
const [isFollowing, setIsFollowing] = useState2(false);
|
|
289
208
|
const s = {
|
|
290
209
|
card: {
|
|
291
210
|
width: "300px",
|
|
@@ -418,7 +337,52 @@ var Profilecard = ({
|
|
|
418
337
|
{ num: following, lbl: "Following" },
|
|
419
338
|
{ num: projects, lbl: "Projects" }
|
|
420
339
|
];
|
|
421
|
-
return /* @__PURE__ */
|
|
340
|
+
return /* @__PURE__ */ React2.createElement("div", { style: s.card }, /* @__PURE__ */ React2.createElement("div", { style: s.cover }, /* @__PURE__ */ React2.createElement("div", { style: s.avatarWrap }, /* @__PURE__ */ React2.createElement("img", { src: avatar, alt: name, style: s.avatar }), /* @__PURE__ */ React2.createElement("span", { style: s.dot }))), /* @__PURE__ */ React2.createElement("div", { style: s.info }, /* @__PURE__ */ React2.createElement("p", { style: s.name }, name), /* @__PURE__ */ React2.createElement("p", { style: s.role }, role, " \xB7 ", /* @__PURE__ */ React2.createElement("span", { style: { color: "#aaa" } }, company)), /* @__PURE__ */ React2.createElement("div", { style: s.location }, /* @__PURE__ */ React2.createElement("span", null, "\u{1F4CD}"), " ", location)), /* @__PURE__ */ React2.createElement("div", { style: s.tags }, tags.map((t) => /* @__PURE__ */ React2.createElement("span", { key: t, style: s.tag }, t))), /* @__PURE__ */ React2.createElement("div", { style: s.stats }, stats.map((st, i) => /* @__PURE__ */ React2.createElement("div", { key: st.lbl, style: s.stat(i) }, /* @__PURE__ */ React2.createElement("div", { style: s.statNum }, st.num), /* @__PURE__ */ React2.createElement("div", { style: s.statLbl }, st.lbl)))), /* @__PURE__ */ React2.createElement("div", { style: s.actions }, /* @__PURE__ */ React2.createElement("button", { style: s.followBtn, onClick: () => setIsFollowing(!isFollowing) }, isFollowing ? "Following \u2713" : "Follow"), /* @__PURE__ */ React2.createElement("button", { style: s.msgBtn, onClick: onMessage }, "\u{1F4AC}")));
|
|
341
|
+
};
|
|
342
|
+
|
|
343
|
+
// src/components/Button/Button.jsx
|
|
344
|
+
import React3 from "react";
|
|
345
|
+
var alpha = (hex, op) => {
|
|
346
|
+
const r = parseInt(hex.slice(1, 3), 16), g = parseInt(hex.slice(3, 5), 16), b = parseInt(hex.slice(5, 7), 16);
|
|
347
|
+
return "rgba(" + r + "," + g + "," + b + "," + op + ")";
|
|
348
|
+
};
|
|
349
|
+
var Button = ({
|
|
350
|
+
label = "Click me",
|
|
351
|
+
onClick = () => console.log("Button clicked"),
|
|
352
|
+
color = "#4CAF50",
|
|
353
|
+
disabled = false,
|
|
354
|
+
size = "medium"
|
|
355
|
+
}) => {
|
|
356
|
+
const sizes = {
|
|
357
|
+
small: { padding: "6px 12px", fontSize: "12px" },
|
|
358
|
+
medium: { padding: "10px 20px", fontSize: "14px" },
|
|
359
|
+
large: { padding: "14px 28px", fontSize: "16px" }
|
|
360
|
+
};
|
|
361
|
+
const buttonStyle = {
|
|
362
|
+
backgroundColor: disabled ? "#cccccc" : color,
|
|
363
|
+
color: "white",
|
|
364
|
+
border: "none",
|
|
365
|
+
borderRadius: "4px",
|
|
366
|
+
cursor: disabled ? "not-allowed" : "pointer",
|
|
367
|
+
fontWeight: "bold",
|
|
368
|
+
transition: "background-color 0.3s",
|
|
369
|
+
...sizes[size]
|
|
370
|
+
};
|
|
371
|
+
const hoverStyle = {
|
|
372
|
+
backgroundColor: disabled ? "#cccccc" : alpha(color, 0.8)
|
|
373
|
+
};
|
|
374
|
+
const [hover, setHover] = React3.useState(false);
|
|
375
|
+
return /* @__PURE__ */ React3.createElement(
|
|
376
|
+
"button",
|
|
377
|
+
{
|
|
378
|
+
onClick: !disabled ? onClick : null,
|
|
379
|
+
style: hover ? { ...buttonStyle, ...hoverStyle } : buttonStyle,
|
|
380
|
+
onMouseEnter: () => setHover(true),
|
|
381
|
+
onMouseLeave: () => setHover(false),
|
|
382
|
+
disabled
|
|
383
|
+
},
|
|
384
|
+
label
|
|
385
|
+
);
|
|
422
386
|
};
|
|
423
387
|
export {
|
|
424
388
|
Button,
|