virtual-ui-library-uday 1.0.9
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 +310 -0
- package/dist/index.mjs +273 -0
- package/package.json +22 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,310 @@
|
|
|
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
|
+
});
|
|
35
|
+
module.exports = __toCommonJS(index_exports);
|
|
36
|
+
|
|
37
|
+
// src/components/Buttons/Button.jsx
|
|
38
|
+
var import_react = __toESM(require("react"));
|
|
39
|
+
var import_react2 = require("react");
|
|
40
|
+
var Button = ({
|
|
41
|
+
label = "Click Me",
|
|
42
|
+
onClick = () => {
|
|
43
|
+
},
|
|
44
|
+
backgroundColor = "#6c63ff",
|
|
45
|
+
color = "#ffffff",
|
|
46
|
+
hoverBackgroundColor = "#574fd6",
|
|
47
|
+
hoverColor = "#ffffff",
|
|
48
|
+
fontSize = "15px",
|
|
49
|
+
paddingX = "24px",
|
|
50
|
+
paddingY = "11px",
|
|
51
|
+
borderRadius = "8px",
|
|
52
|
+
border = "none",
|
|
53
|
+
fontFamily = "'Segoe UI', sans-serif",
|
|
54
|
+
fontWeight = "600",
|
|
55
|
+
disabled = false,
|
|
56
|
+
loading = false,
|
|
57
|
+
icon = null
|
|
58
|
+
}) => {
|
|
59
|
+
const [hovered, setHovered] = (0, import_react2.useState)(false);
|
|
60
|
+
const [pressed, setPressed] = (0, import_react2.useState)(false);
|
|
61
|
+
const style = {
|
|
62
|
+
display: "inline-flex",
|
|
63
|
+
alignItems: "center",
|
|
64
|
+
justifyContent: "center",
|
|
65
|
+
gap: "8px",
|
|
66
|
+
padding: `${paddingY} ${paddingX}`,
|
|
67
|
+
backgroundColor: disabled ? "#cccccc" : hovered ? hoverBackgroundColor : backgroundColor,
|
|
68
|
+
color: hovered ? hoverColor : color,
|
|
69
|
+
fontSize,
|
|
70
|
+
fontFamily,
|
|
71
|
+
fontWeight,
|
|
72
|
+
border,
|
|
73
|
+
borderRadius,
|
|
74
|
+
cursor: disabled || loading ? "not-allowed" : "pointer",
|
|
75
|
+
opacity: disabled ? 0.6 : 1,
|
|
76
|
+
transform: pressed && !disabled ? "scale(0.96)" : "scale(1)",
|
|
77
|
+
boxShadow: hovered && !disabled ? "0 6px 20px rgba(108,99,255,0.35)" : "0 2px 8px rgba(0,0,0,0.12)",
|
|
78
|
+
transition: "all 0.2s ease",
|
|
79
|
+
outline: "none",
|
|
80
|
+
userSelect: "none",
|
|
81
|
+
letterSpacing: "0.03em"
|
|
82
|
+
};
|
|
83
|
+
const spinnerStyle = {
|
|
84
|
+
width: "13px",
|
|
85
|
+
height: "13px",
|
|
86
|
+
border: `2px solid ${color}44`,
|
|
87
|
+
borderTop: `2px solid ${color}`,
|
|
88
|
+
borderRadius: "50%",
|
|
89
|
+
animation: "btn-spin 0.65s linear infinite"
|
|
90
|
+
};
|
|
91
|
+
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement("style", null, `
|
|
92
|
+
@keyframes btn-spin {
|
|
93
|
+
to {
|
|
94
|
+
transform: rotate(360deg);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
`), /* @__PURE__ */ import_react.default.createElement(
|
|
98
|
+
"button",
|
|
99
|
+
{
|
|
100
|
+
style,
|
|
101
|
+
onClick: !disabled && !loading ? onClick : void 0,
|
|
102
|
+
onMouseEnter: () => setHovered(true),
|
|
103
|
+
onMouseLeave: () => {
|
|
104
|
+
setHovered(false);
|
|
105
|
+
setPressed(false);
|
|
106
|
+
},
|
|
107
|
+
onMouseDown: () => setPressed(true),
|
|
108
|
+
onMouseUp: () => setPressed(false),
|
|
109
|
+
disabled,
|
|
110
|
+
"aria-disabled": disabled || loading,
|
|
111
|
+
"aria-label": label
|
|
112
|
+
},
|
|
113
|
+
loading ? /* @__PURE__ */ import_react.default.createElement("span", { style: spinnerStyle }) : icon && /* @__PURE__ */ import_react.default.createElement("span", null, icon),
|
|
114
|
+
loading ? "Loading..." : label
|
|
115
|
+
));
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
// src/components/Card/Card.jsx
|
|
119
|
+
var import_react3 = __toESM(require("react"));
|
|
120
|
+
var import_react4 = require("react");
|
|
121
|
+
var Card = ({
|
|
122
|
+
image = "https://images.unsplash.com/photo-1506905925346-21bda4d32df4?w=600&q=80",
|
|
123
|
+
category = "Travel",
|
|
124
|
+
title = "Into the Wild Mountains",
|
|
125
|
+
description = "A breathtaking journey through untouched alpine landscapes, where every step reveals a new perspective on the world below.",
|
|
126
|
+
author = "Elena Vasquez",
|
|
127
|
+
authorAvatar = "https://i.pravatar.cc/40?img=47",
|
|
128
|
+
date = "Apr 24, 2026",
|
|
129
|
+
readTime = "5 min read",
|
|
130
|
+
likes = 128,
|
|
131
|
+
bookmarked = false,
|
|
132
|
+
accentColor = "#ff6b35",
|
|
133
|
+
onLike = () => {
|
|
134
|
+
},
|
|
135
|
+
onBookmark = () => {
|
|
136
|
+
},
|
|
137
|
+
onReadMore = () => {
|
|
138
|
+
}
|
|
139
|
+
}) => {
|
|
140
|
+
const [liked, setLiked] = (0, import_react4.useState)(false);
|
|
141
|
+
const [likeCount, setLikeCount] = (0, import_react4.useState)(likes);
|
|
142
|
+
const [saved, setSaved] = (0, import_react4.useState)(bookmarked);
|
|
143
|
+
const [imgHovered, setImgHovered] = (0, import_react4.useState)(false);
|
|
144
|
+
const handleLike = () => {
|
|
145
|
+
setLiked(!liked);
|
|
146
|
+
setLikeCount((c) => liked ? c - 1 : c + 1);
|
|
147
|
+
onLike();
|
|
148
|
+
};
|
|
149
|
+
const handleBookmark = () => {
|
|
150
|
+
setSaved(!saved);
|
|
151
|
+
onBookmark();
|
|
152
|
+
};
|
|
153
|
+
const styles = {
|
|
154
|
+
card: {
|
|
155
|
+
width: "360px",
|
|
156
|
+
borderRadius: "20px",
|
|
157
|
+
overflow: "hidden",
|
|
158
|
+
background: "#0d0d0d",
|
|
159
|
+
boxShadow: "0 24px 60px rgba(0,0,0,0.5)",
|
|
160
|
+
fontFamily: "'Georgia', 'Times New Roman', serif",
|
|
161
|
+
position: "relative",
|
|
162
|
+
transition: "transform 0.3s ease, box-shadow 0.3s ease"
|
|
163
|
+
},
|
|
164
|
+
imageWrap: {
|
|
165
|
+
position: "relative",
|
|
166
|
+
height: "220px",
|
|
167
|
+
overflow: "hidden",
|
|
168
|
+
cursor: "pointer"
|
|
169
|
+
},
|
|
170
|
+
image: {
|
|
171
|
+
width: "100%",
|
|
172
|
+
height: "100%",
|
|
173
|
+
objectFit: "cover",
|
|
174
|
+
transition: "transform 0.5s ease",
|
|
175
|
+
transform: imgHovered ? "scale(1.06)" : "scale(1)",
|
|
176
|
+
display: "block"
|
|
177
|
+
},
|
|
178
|
+
imageOverlay: {
|
|
179
|
+
position: "absolute",
|
|
180
|
+
inset: 0,
|
|
181
|
+
background: "linear-gradient(to bottom, transparent 40%, rgba(0,0,0,0.7) 100%)"
|
|
182
|
+
},
|
|
183
|
+
category: {
|
|
184
|
+
position: "absolute",
|
|
185
|
+
top: "16px",
|
|
186
|
+
left: "16px",
|
|
187
|
+
background: accentColor,
|
|
188
|
+
color: "#fff",
|
|
189
|
+
fontSize: "10px",
|
|
190
|
+
fontFamily: "'Courier New', monospace",
|
|
191
|
+
fontWeight: "700",
|
|
192
|
+
letterSpacing: "0.15em",
|
|
193
|
+
textTransform: "uppercase",
|
|
194
|
+
padding: "5px 12px",
|
|
195
|
+
borderRadius: "4px"
|
|
196
|
+
},
|
|
197
|
+
body: {
|
|
198
|
+
padding: "24px"
|
|
199
|
+
},
|
|
200
|
+
title: {
|
|
201
|
+
fontSize: "20px",
|
|
202
|
+
fontWeight: "700",
|
|
203
|
+
color: "#f5f0e8",
|
|
204
|
+
lineHeight: "1.3",
|
|
205
|
+
marginBottom: "12px",
|
|
206
|
+
letterSpacing: "-0.02em"
|
|
207
|
+
},
|
|
208
|
+
description: {
|
|
209
|
+
fontSize: "13px",
|
|
210
|
+
color: "#888",
|
|
211
|
+
lineHeight: "1.7",
|
|
212
|
+
marginBottom: "20px",
|
|
213
|
+
fontFamily: "'Georgia', serif"
|
|
214
|
+
},
|
|
215
|
+
divider: {
|
|
216
|
+
height: "1px",
|
|
217
|
+
background: "#222",
|
|
218
|
+
marginBottom: "16px"
|
|
219
|
+
},
|
|
220
|
+
meta: {
|
|
221
|
+
display: "flex",
|
|
222
|
+
alignItems: "center",
|
|
223
|
+
gap: "10px",
|
|
224
|
+
marginBottom: "20px"
|
|
225
|
+
},
|
|
226
|
+
avatar: {
|
|
227
|
+
width: "32px",
|
|
228
|
+
height: "32px",
|
|
229
|
+
borderRadius: "50%",
|
|
230
|
+
objectFit: "cover",
|
|
231
|
+
border: `2px solid ${accentColor}`
|
|
232
|
+
},
|
|
233
|
+
authorName: {
|
|
234
|
+
fontSize: "13px",
|
|
235
|
+
color: "#f5f0e8",
|
|
236
|
+
fontWeight: "600",
|
|
237
|
+
fontFamily: "'Courier New', monospace"
|
|
238
|
+
},
|
|
239
|
+
metaRight: {
|
|
240
|
+
marginLeft: "auto",
|
|
241
|
+
display: "flex",
|
|
242
|
+
flexDirection: "column",
|
|
243
|
+
alignItems: "flex-end",
|
|
244
|
+
gap: "2px"
|
|
245
|
+
},
|
|
246
|
+
metaText: {
|
|
247
|
+
fontSize: "11px",
|
|
248
|
+
color: "#555",
|
|
249
|
+
fontFamily: "'Courier New', monospace"
|
|
250
|
+
},
|
|
251
|
+
actions: {
|
|
252
|
+
display: "flex",
|
|
253
|
+
alignItems: "center",
|
|
254
|
+
gap: "8px"
|
|
255
|
+
},
|
|
256
|
+
iconBtn: (active, hoverColor) => ({
|
|
257
|
+
display: "inline-flex",
|
|
258
|
+
alignItems: "center",
|
|
259
|
+
gap: "5px",
|
|
260
|
+
background: "none",
|
|
261
|
+
border: "1.5px solid #2a2a2a",
|
|
262
|
+
borderRadius: "8px",
|
|
263
|
+
padding: "8px 14px",
|
|
264
|
+
cursor: "pointer",
|
|
265
|
+
fontSize: "12px",
|
|
266
|
+
color: active ? hoverColor : "#666",
|
|
267
|
+
fontFamily: "'Courier New', monospace",
|
|
268
|
+
transition: "all 0.2s ease"
|
|
269
|
+
}),
|
|
270
|
+
readBtn: {
|
|
271
|
+
marginLeft: "auto",
|
|
272
|
+
background: accentColor,
|
|
273
|
+
border: "none",
|
|
274
|
+
borderRadius: "8px",
|
|
275
|
+
padding: "9px 18px",
|
|
276
|
+
color: "#fff",
|
|
277
|
+
fontSize: "12px",
|
|
278
|
+
fontFamily: "'Courier New', monospace",
|
|
279
|
+
fontWeight: "700",
|
|
280
|
+
letterSpacing: "0.05em",
|
|
281
|
+
cursor: "pointer",
|
|
282
|
+
transition: "opacity 0.2s ease"
|
|
283
|
+
}
|
|
284
|
+
};
|
|
285
|
+
return /* @__PURE__ */ import_react3.default.createElement("div", { style: styles.card }, /* @__PURE__ */ import_react3.default.createElement(
|
|
286
|
+
"div",
|
|
287
|
+
{
|
|
288
|
+
style: styles.imageWrap,
|
|
289
|
+
onMouseEnter: () => setImgHovered(true),
|
|
290
|
+
onMouseLeave: () => setImgHovered(false)
|
|
291
|
+
},
|
|
292
|
+
/* @__PURE__ */ import_react3.default.createElement("img", { src: image, alt: title, style: styles.image }),
|
|
293
|
+
/* @__PURE__ */ import_react3.default.createElement("div", { style: styles.imageOverlay }),
|
|
294
|
+
/* @__PURE__ */ import_react3.default.createElement("span", { style: styles.category }, category)
|
|
295
|
+
), /* @__PURE__ */ import_react3.default.createElement("div", { style: styles.body }, /* @__PURE__ */ import_react3.default.createElement("div", { style: styles.title }, title), /* @__PURE__ */ import_react3.default.createElement("div", { style: styles.description }, description), /* @__PURE__ */ import_react3.default.createElement("div", { style: styles.divider }), /* @__PURE__ */ import_react3.default.createElement("div", { style: styles.meta }, /* @__PURE__ */ import_react3.default.createElement("img", { src: authorAvatar, alt: author, style: styles.avatar }), /* @__PURE__ */ import_react3.default.createElement("div", null, /* @__PURE__ */ import_react3.default.createElement("div", { style: styles.authorName }, author)), /* @__PURE__ */ import_react3.default.createElement("div", { style: styles.metaRight }, /* @__PURE__ */ import_react3.default.createElement("span", { style: styles.metaText }, date), /* @__PURE__ */ import_react3.default.createElement("span", { style: styles.metaText }, readTime))), /* @__PURE__ */ import_react3.default.createElement("div", { style: styles.actions }, /* @__PURE__ */ import_react3.default.createElement("button", { style: styles.iconBtn(liked, "#e74c3c"), onClick: handleLike }, liked ? "\u2665" : "\u2661", " ", likeCount), /* @__PURE__ */ import_react3.default.createElement("button", { style: styles.iconBtn(saved, accentColor), onClick: handleBookmark }, saved ? "\u229F" : "\u229E", " ", saved ? "Saved" : "Save"), /* @__PURE__ */ import_react3.default.createElement(
|
|
296
|
+
"button",
|
|
297
|
+
{
|
|
298
|
+
style: styles.readBtn,
|
|
299
|
+
onMouseOver: (e) => e.target.style.opacity = "0.85",
|
|
300
|
+
onMouseOut: (e) => e.target.style.opacity = "1",
|
|
301
|
+
onClick: onReadMore
|
|
302
|
+
},
|
|
303
|
+
"Read \u2192"
|
|
304
|
+
))));
|
|
305
|
+
};
|
|
306
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
307
|
+
0 && (module.exports = {
|
|
308
|
+
Button,
|
|
309
|
+
Card
|
|
310
|
+
});
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,273 @@
|
|
|
1
|
+
// src/components/Buttons/Button.jsx
|
|
2
|
+
import React from "react";
|
|
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
|
+
var Card = ({
|
|
86
|
+
image = "https://images.unsplash.com/photo-1506905925346-21bda4d32df4?w=600&q=80",
|
|
87
|
+
category = "Travel",
|
|
88
|
+
title = "Into the Wild Mountains",
|
|
89
|
+
description = "A breathtaking journey through untouched alpine landscapes, where every step reveals a new perspective on the world below.",
|
|
90
|
+
author = "Elena Vasquez",
|
|
91
|
+
authorAvatar = "https://i.pravatar.cc/40?img=47",
|
|
92
|
+
date = "Apr 24, 2026",
|
|
93
|
+
readTime = "5 min read",
|
|
94
|
+
likes = 128,
|
|
95
|
+
bookmarked = false,
|
|
96
|
+
accentColor = "#ff6b35",
|
|
97
|
+
onLike = () => {
|
|
98
|
+
},
|
|
99
|
+
onBookmark = () => {
|
|
100
|
+
},
|
|
101
|
+
onReadMore = () => {
|
|
102
|
+
}
|
|
103
|
+
}) => {
|
|
104
|
+
const [liked, setLiked] = useState2(false);
|
|
105
|
+
const [likeCount, setLikeCount] = useState2(likes);
|
|
106
|
+
const [saved, setSaved] = useState2(bookmarked);
|
|
107
|
+
const [imgHovered, setImgHovered] = useState2(false);
|
|
108
|
+
const handleLike = () => {
|
|
109
|
+
setLiked(!liked);
|
|
110
|
+
setLikeCount((c) => liked ? c - 1 : c + 1);
|
|
111
|
+
onLike();
|
|
112
|
+
};
|
|
113
|
+
const handleBookmark = () => {
|
|
114
|
+
setSaved(!saved);
|
|
115
|
+
onBookmark();
|
|
116
|
+
};
|
|
117
|
+
const styles = {
|
|
118
|
+
card: {
|
|
119
|
+
width: "360px",
|
|
120
|
+
borderRadius: "20px",
|
|
121
|
+
overflow: "hidden",
|
|
122
|
+
background: "#0d0d0d",
|
|
123
|
+
boxShadow: "0 24px 60px rgba(0,0,0,0.5)",
|
|
124
|
+
fontFamily: "'Georgia', 'Times New Roman', serif",
|
|
125
|
+
position: "relative",
|
|
126
|
+
transition: "transform 0.3s ease, box-shadow 0.3s ease"
|
|
127
|
+
},
|
|
128
|
+
imageWrap: {
|
|
129
|
+
position: "relative",
|
|
130
|
+
height: "220px",
|
|
131
|
+
overflow: "hidden",
|
|
132
|
+
cursor: "pointer"
|
|
133
|
+
},
|
|
134
|
+
image: {
|
|
135
|
+
width: "100%",
|
|
136
|
+
height: "100%",
|
|
137
|
+
objectFit: "cover",
|
|
138
|
+
transition: "transform 0.5s ease",
|
|
139
|
+
transform: imgHovered ? "scale(1.06)" : "scale(1)",
|
|
140
|
+
display: "block"
|
|
141
|
+
},
|
|
142
|
+
imageOverlay: {
|
|
143
|
+
position: "absolute",
|
|
144
|
+
inset: 0,
|
|
145
|
+
background: "linear-gradient(to bottom, transparent 40%, rgba(0,0,0,0.7) 100%)"
|
|
146
|
+
},
|
|
147
|
+
category: {
|
|
148
|
+
position: "absolute",
|
|
149
|
+
top: "16px",
|
|
150
|
+
left: "16px",
|
|
151
|
+
background: accentColor,
|
|
152
|
+
color: "#fff",
|
|
153
|
+
fontSize: "10px",
|
|
154
|
+
fontFamily: "'Courier New', monospace",
|
|
155
|
+
fontWeight: "700",
|
|
156
|
+
letterSpacing: "0.15em",
|
|
157
|
+
textTransform: "uppercase",
|
|
158
|
+
padding: "5px 12px",
|
|
159
|
+
borderRadius: "4px"
|
|
160
|
+
},
|
|
161
|
+
body: {
|
|
162
|
+
padding: "24px"
|
|
163
|
+
},
|
|
164
|
+
title: {
|
|
165
|
+
fontSize: "20px",
|
|
166
|
+
fontWeight: "700",
|
|
167
|
+
color: "#f5f0e8",
|
|
168
|
+
lineHeight: "1.3",
|
|
169
|
+
marginBottom: "12px",
|
|
170
|
+
letterSpacing: "-0.02em"
|
|
171
|
+
},
|
|
172
|
+
description: {
|
|
173
|
+
fontSize: "13px",
|
|
174
|
+
color: "#888",
|
|
175
|
+
lineHeight: "1.7",
|
|
176
|
+
marginBottom: "20px",
|
|
177
|
+
fontFamily: "'Georgia', serif"
|
|
178
|
+
},
|
|
179
|
+
divider: {
|
|
180
|
+
height: "1px",
|
|
181
|
+
background: "#222",
|
|
182
|
+
marginBottom: "16px"
|
|
183
|
+
},
|
|
184
|
+
meta: {
|
|
185
|
+
display: "flex",
|
|
186
|
+
alignItems: "center",
|
|
187
|
+
gap: "10px",
|
|
188
|
+
marginBottom: "20px"
|
|
189
|
+
},
|
|
190
|
+
avatar: {
|
|
191
|
+
width: "32px",
|
|
192
|
+
height: "32px",
|
|
193
|
+
borderRadius: "50%",
|
|
194
|
+
objectFit: "cover",
|
|
195
|
+
border: `2px solid ${accentColor}`
|
|
196
|
+
},
|
|
197
|
+
authorName: {
|
|
198
|
+
fontSize: "13px",
|
|
199
|
+
color: "#f5f0e8",
|
|
200
|
+
fontWeight: "600",
|
|
201
|
+
fontFamily: "'Courier New', monospace"
|
|
202
|
+
},
|
|
203
|
+
metaRight: {
|
|
204
|
+
marginLeft: "auto",
|
|
205
|
+
display: "flex",
|
|
206
|
+
flexDirection: "column",
|
|
207
|
+
alignItems: "flex-end",
|
|
208
|
+
gap: "2px"
|
|
209
|
+
},
|
|
210
|
+
metaText: {
|
|
211
|
+
fontSize: "11px",
|
|
212
|
+
color: "#555",
|
|
213
|
+
fontFamily: "'Courier New', monospace"
|
|
214
|
+
},
|
|
215
|
+
actions: {
|
|
216
|
+
display: "flex",
|
|
217
|
+
alignItems: "center",
|
|
218
|
+
gap: "8px"
|
|
219
|
+
},
|
|
220
|
+
iconBtn: (active, hoverColor) => ({
|
|
221
|
+
display: "inline-flex",
|
|
222
|
+
alignItems: "center",
|
|
223
|
+
gap: "5px",
|
|
224
|
+
background: "none",
|
|
225
|
+
border: "1.5px solid #2a2a2a",
|
|
226
|
+
borderRadius: "8px",
|
|
227
|
+
padding: "8px 14px",
|
|
228
|
+
cursor: "pointer",
|
|
229
|
+
fontSize: "12px",
|
|
230
|
+
color: active ? hoverColor : "#666",
|
|
231
|
+
fontFamily: "'Courier New', monospace",
|
|
232
|
+
transition: "all 0.2s ease"
|
|
233
|
+
}),
|
|
234
|
+
readBtn: {
|
|
235
|
+
marginLeft: "auto",
|
|
236
|
+
background: accentColor,
|
|
237
|
+
border: "none",
|
|
238
|
+
borderRadius: "8px",
|
|
239
|
+
padding: "9px 18px",
|
|
240
|
+
color: "#fff",
|
|
241
|
+
fontSize: "12px",
|
|
242
|
+
fontFamily: "'Courier New', monospace",
|
|
243
|
+
fontWeight: "700",
|
|
244
|
+
letterSpacing: "0.05em",
|
|
245
|
+
cursor: "pointer",
|
|
246
|
+
transition: "opacity 0.2s ease"
|
|
247
|
+
}
|
|
248
|
+
};
|
|
249
|
+
return /* @__PURE__ */ React2.createElement("div", { style: styles.card }, /* @__PURE__ */ React2.createElement(
|
|
250
|
+
"div",
|
|
251
|
+
{
|
|
252
|
+
style: styles.imageWrap,
|
|
253
|
+
onMouseEnter: () => setImgHovered(true),
|
|
254
|
+
onMouseLeave: () => setImgHovered(false)
|
|
255
|
+
},
|
|
256
|
+
/* @__PURE__ */ React2.createElement("img", { src: image, alt: title, style: styles.image }),
|
|
257
|
+
/* @__PURE__ */ React2.createElement("div", { style: styles.imageOverlay }),
|
|
258
|
+
/* @__PURE__ */ React2.createElement("span", { style: styles.category }, category)
|
|
259
|
+
), /* @__PURE__ */ React2.createElement("div", { style: styles.body }, /* @__PURE__ */ React2.createElement("div", { style: styles.title }, title), /* @__PURE__ */ React2.createElement("div", { style: styles.description }, description), /* @__PURE__ */ React2.createElement("div", { style: styles.divider }), /* @__PURE__ */ React2.createElement("div", { style: styles.meta }, /* @__PURE__ */ React2.createElement("img", { src: authorAvatar, alt: author, style: styles.avatar }), /* @__PURE__ */ React2.createElement("div", null, /* @__PURE__ */ React2.createElement("div", { style: styles.authorName }, author)), /* @__PURE__ */ React2.createElement("div", { style: styles.metaRight }, /* @__PURE__ */ React2.createElement("span", { style: styles.metaText }, date), /* @__PURE__ */ React2.createElement("span", { style: styles.metaText }, readTime))), /* @__PURE__ */ React2.createElement("div", { style: styles.actions }, /* @__PURE__ */ React2.createElement("button", { style: styles.iconBtn(liked, "#e74c3c"), onClick: handleLike }, liked ? "\u2665" : "\u2661", " ", likeCount), /* @__PURE__ */ React2.createElement("button", { style: styles.iconBtn(saved, accentColor), onClick: handleBookmark }, saved ? "\u229F" : "\u229E", " ", saved ? "Saved" : "Save"), /* @__PURE__ */ React2.createElement(
|
|
260
|
+
"button",
|
|
261
|
+
{
|
|
262
|
+
style: styles.readBtn,
|
|
263
|
+
onMouseOver: (e) => e.target.style.opacity = "0.85",
|
|
264
|
+
onMouseOut: (e) => e.target.style.opacity = "1",
|
|
265
|
+
onClick: onReadMore
|
|
266
|
+
},
|
|
267
|
+
"Read \u2192"
|
|
268
|
+
))));
|
|
269
|
+
};
|
|
270
|
+
export {
|
|
271
|
+
Button,
|
|
272
|
+
Card
|
|
273
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "virtual-ui-library-uday",
|
|
3
|
+
"version": "1.0.9",
|
|
4
|
+
"description": "virtual ui react library",
|
|
5
|
+
"license": "ISC",
|
|
6
|
+
"author": "Uday",
|
|
7
|
+
"main": "dist/index.js",
|
|
8
|
+
"module": "dist/index.mjs",
|
|
9
|
+
"files": [
|
|
10
|
+
"dist"
|
|
11
|
+
],
|
|
12
|
+
"scripts": {
|
|
13
|
+
"build": "tsup"
|
|
14
|
+
},
|
|
15
|
+
"peerDependencies": {
|
|
16
|
+
"react": ">=18"
|
|
17
|
+
},
|
|
18
|
+
"devDependencies": {
|
|
19
|
+
"tsup": "^8.5.1",
|
|
20
|
+
"typescript": "^6.0.2"
|
|
21
|
+
}
|
|
22
|
+
}
|