bhoomi-virtual-ui-library 1.0.0
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 +371 -0
- package/dist/index.mjs +334 -0
- package/package.json +20 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,371 @@
|
|
|
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/Button/Button.jsx
|
|
38
|
+
var import_react = __toESM(require("react"));
|
|
39
|
+
var Button = ({
|
|
40
|
+
label = "Click Me",
|
|
41
|
+
onClick = () => {
|
|
42
|
+
},
|
|
43
|
+
variant = "primary",
|
|
44
|
+
size = "md",
|
|
45
|
+
disabled = false,
|
|
46
|
+
icon = null,
|
|
47
|
+
fullWidth = false
|
|
48
|
+
}) => {
|
|
49
|
+
const [pressed, setPressed] = (0, import_react.useState)(false);
|
|
50
|
+
const [ripples, setRipples] = (0, import_react.useState)([]);
|
|
51
|
+
const palette = {
|
|
52
|
+
primary: {
|
|
53
|
+
bg: "#0f0f0f",
|
|
54
|
+
text: "#f5f0e8",
|
|
55
|
+
border: "#0f0f0f",
|
|
56
|
+
hover: "#2a2a2a",
|
|
57
|
+
accent: "#e8d5a3"
|
|
58
|
+
},
|
|
59
|
+
secondary: {
|
|
60
|
+
bg: "transparent",
|
|
61
|
+
text: "#0f0f0f",
|
|
62
|
+
border: "#0f0f0f",
|
|
63
|
+
hover: "#f0ebe0",
|
|
64
|
+
accent: "#0f0f0f"
|
|
65
|
+
},
|
|
66
|
+
danger: {
|
|
67
|
+
bg: "#c0392b",
|
|
68
|
+
text: "#fff5f5",
|
|
69
|
+
border: "#c0392b",
|
|
70
|
+
hover: "#a93226",
|
|
71
|
+
accent: "#ffcdd2"
|
|
72
|
+
},
|
|
73
|
+
ghost: {
|
|
74
|
+
bg: "transparent",
|
|
75
|
+
text: "#5a5a5a",
|
|
76
|
+
border: "transparent",
|
|
77
|
+
hover: "#f5f0e8",
|
|
78
|
+
accent: "#0f0f0f"
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
const sizes = {
|
|
82
|
+
sm: { padding: "8px 18px", fontSize: "12px", letterSpacing: "0.12em", height: "34px" },
|
|
83
|
+
md: { padding: "12px 28px", fontSize: "13px", letterSpacing: "0.14em", height: "44px" },
|
|
84
|
+
lg: { padding: "16px 40px", fontSize: "14px", letterSpacing: "0.16em", height: "54px" }
|
|
85
|
+
};
|
|
86
|
+
const [hovered, setHovered] = (0, import_react.useState)(false);
|
|
87
|
+
const colors = palette[variant] || palette.primary;
|
|
88
|
+
const sizing = sizes[size] || sizes.md;
|
|
89
|
+
const addRipple = (e) => {
|
|
90
|
+
const rect = e.currentTarget.getBoundingClientRect();
|
|
91
|
+
const x = e.clientX - rect.left;
|
|
92
|
+
const y = e.clientY - rect.top;
|
|
93
|
+
const id = Date.now();
|
|
94
|
+
setRipples((prev) => [...prev, { x, y, id }]);
|
|
95
|
+
setTimeout(() => setRipples((prev) => prev.filter((r) => r.id !== id)), 600);
|
|
96
|
+
};
|
|
97
|
+
const handleClick = (e) => {
|
|
98
|
+
if (disabled) return;
|
|
99
|
+
addRipple(e);
|
|
100
|
+
setPressed(true);
|
|
101
|
+
setTimeout(() => setPressed(false), 150);
|
|
102
|
+
onClick(e);
|
|
103
|
+
};
|
|
104
|
+
const baseStyle = {
|
|
105
|
+
position: "relative",
|
|
106
|
+
overflow: "hidden",
|
|
107
|
+
display: "inline-flex",
|
|
108
|
+
alignItems: "center",
|
|
109
|
+
justifyContent: "center",
|
|
110
|
+
gap: "8px",
|
|
111
|
+
height: sizing.height,
|
|
112
|
+
padding: sizing.padding,
|
|
113
|
+
fontSize: sizing.fontSize,
|
|
114
|
+
fontFamily: "'DM Mono', 'Courier New', monospace",
|
|
115
|
+
fontWeight: "500",
|
|
116
|
+
letterSpacing: sizing.letterSpacing,
|
|
117
|
+
textTransform: "uppercase",
|
|
118
|
+
color: hovered && !disabled ? colors.accent : colors.text,
|
|
119
|
+
backgroundColor: hovered && !disabled ? colors.hover : colors.bg,
|
|
120
|
+
border: `1.5px solid ${colors.border}`,
|
|
121
|
+
borderRadius: "3px",
|
|
122
|
+
cursor: disabled ? "not-allowed" : "pointer",
|
|
123
|
+
opacity: disabled ? 0.4 : 1,
|
|
124
|
+
width: fullWidth ? "100%" : "auto",
|
|
125
|
+
outline: "none",
|
|
126
|
+
WebkitFontSmoothing: "antialiased",
|
|
127
|
+
transition: "background-color 0.18s ease, color 0.18s ease, transform 0.1s ease, box-shadow 0.18s ease",
|
|
128
|
+
transform: pressed ? "scale(0.97)" : "scale(1)",
|
|
129
|
+
boxShadow: hovered && !disabled ? variant === "primary" ? "4px 4px 0px #e8d5a3" : variant === "secondary" ? "4px 4px 0px #0f0f0f" : "none" : "none",
|
|
130
|
+
userSelect: "none"
|
|
131
|
+
};
|
|
132
|
+
const rippleStyle = (r) => ({
|
|
133
|
+
position: "absolute",
|
|
134
|
+
left: r.x - 50,
|
|
135
|
+
top: r.y - 50,
|
|
136
|
+
width: 100,
|
|
137
|
+
height: 100,
|
|
138
|
+
borderRadius: "50%",
|
|
139
|
+
background: variant === "primary" || variant === "danger" ? "rgba(255,255,255,0.18)" : "rgba(0,0,0,0.08)",
|
|
140
|
+
transform: "scale(0)",
|
|
141
|
+
animation: "rippleAnim 0.6s linear forwards",
|
|
142
|
+
pointerEvents: "none"
|
|
143
|
+
});
|
|
144
|
+
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement("style", null, `
|
|
145
|
+
@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&display=swap');
|
|
146
|
+
@keyframes rippleAnim {
|
|
147
|
+
to { transform: scale(4); opacity: 0; }
|
|
148
|
+
}
|
|
149
|
+
`), /* @__PURE__ */ import_react.default.createElement(
|
|
150
|
+
"button",
|
|
151
|
+
{
|
|
152
|
+
style: baseStyle,
|
|
153
|
+
onClick: handleClick,
|
|
154
|
+
onMouseEnter: () => setHovered(true),
|
|
155
|
+
onMouseLeave: () => setHovered(false),
|
|
156
|
+
disabled,
|
|
157
|
+
"aria-disabled": disabled
|
|
158
|
+
},
|
|
159
|
+
ripples.map((r) => /* @__PURE__ */ import_react.default.createElement("span", { key: r.id, style: rippleStyle(r) })),
|
|
160
|
+
icon && /* @__PURE__ */ import_react.default.createElement("span", { style: { display: "flex", alignItems: "center", lineHeight: 1 } }, icon),
|
|
161
|
+
/* @__PURE__ */ import_react.default.createElement("span", { style: { position: "relative", zIndex: 1 } }, label)
|
|
162
|
+
));
|
|
163
|
+
};
|
|
164
|
+
|
|
165
|
+
// src/components/Card/Card.jsx
|
|
166
|
+
var import_react2 = __toESM(require("react"));
|
|
167
|
+
var Card = ({
|
|
168
|
+
title = "Card Title",
|
|
169
|
+
subtitle = "Subtitle or category",
|
|
170
|
+
description = "A short description that gives context about this card's content and purpose.",
|
|
171
|
+
image = null,
|
|
172
|
+
badge = null,
|
|
173
|
+
badgeColor = "#1a1a2e",
|
|
174
|
+
tags = [],
|
|
175
|
+
footer = null,
|
|
176
|
+
onClick = null,
|
|
177
|
+
variant = "default",
|
|
178
|
+
// default | elevated | outlined | glass
|
|
179
|
+
accentColor = "#e63946",
|
|
180
|
+
width = "320px"
|
|
181
|
+
}) => {
|
|
182
|
+
const [hovered, setHovered] = (0, import_react2.useState)(false);
|
|
183
|
+
const variants = {
|
|
184
|
+
default: {
|
|
185
|
+
bg: "#ffffff",
|
|
186
|
+
border: "1px solid #ececec",
|
|
187
|
+
shadow: hovered ? "0 20px 60px rgba(0,0,0,0.12), 0 6px 20px rgba(0,0,0,0.08)" : "0 2px 12px rgba(0,0,0,0.06)"
|
|
188
|
+
},
|
|
189
|
+
elevated: {
|
|
190
|
+
bg: "#ffffff",
|
|
191
|
+
border: "none",
|
|
192
|
+
shadow: hovered ? "0 32px 80px rgba(0,0,0,0.18), 0 8px 24px rgba(0,0,0,0.1)" : "0 8px 32px rgba(0,0,0,0.1), 0 2px 8px rgba(0,0,0,0.06)"
|
|
193
|
+
},
|
|
194
|
+
outlined: {
|
|
195
|
+
bg: "#fafafa",
|
|
196
|
+
border: `2px solid ${hovered ? accentColor : "#d0d0d0"}`,
|
|
197
|
+
shadow: "none"
|
|
198
|
+
},
|
|
199
|
+
glass: {
|
|
200
|
+
bg: "rgba(255,255,255,0.6)",
|
|
201
|
+
border: "1px solid rgba(255,255,255,0.8)",
|
|
202
|
+
shadow: hovered ? "0 20px 60px rgba(0,0,0,0.15)" : "0 8px 32px rgba(0,0,0,0.08)"
|
|
203
|
+
}
|
|
204
|
+
};
|
|
205
|
+
const v = variants[variant] || variants.default;
|
|
206
|
+
const cardStyle = {
|
|
207
|
+
width,
|
|
208
|
+
background: v.bg,
|
|
209
|
+
border: v.border,
|
|
210
|
+
borderRadius: "16px",
|
|
211
|
+
boxShadow: v.shadow,
|
|
212
|
+
overflow: "hidden",
|
|
213
|
+
cursor: onClick ? "pointer" : "default",
|
|
214
|
+
transition: "all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1)",
|
|
215
|
+
transform: hovered && onClick ? "translateY(-6px)" : "translateY(0)",
|
|
216
|
+
backdropFilter: variant === "glass" ? "blur(12px)" : "none",
|
|
217
|
+
fontFamily: "'Lora', Georgia, serif",
|
|
218
|
+
position: "relative"
|
|
219
|
+
};
|
|
220
|
+
const accentBarStyle = {
|
|
221
|
+
height: "4px",
|
|
222
|
+
background: `linear-gradient(90deg, ${accentColor}, ${accentColor}99)`,
|
|
223
|
+
width: hovered ? "100%" : "40%",
|
|
224
|
+
transition: "width 0.4s ease"
|
|
225
|
+
};
|
|
226
|
+
const imageStyle = {
|
|
227
|
+
width: "100%",
|
|
228
|
+
height: "180px",
|
|
229
|
+
objectFit: "cover",
|
|
230
|
+
display: "block",
|
|
231
|
+
transition: "transform 0.5s ease",
|
|
232
|
+
transform: hovered ? "scale(1.04)" : "scale(1)"
|
|
233
|
+
};
|
|
234
|
+
const imagePlaceholderStyle = {
|
|
235
|
+
width: "100%",
|
|
236
|
+
height: "180px",
|
|
237
|
+
background: `linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, ${accentColor}33 100%)`,
|
|
238
|
+
display: "flex",
|
|
239
|
+
alignItems: "center",
|
|
240
|
+
justifyContent: "center",
|
|
241
|
+
overflow: "hidden",
|
|
242
|
+
position: "relative"
|
|
243
|
+
};
|
|
244
|
+
const bodyStyle = {
|
|
245
|
+
padding: "22px 24px 20px"
|
|
246
|
+
};
|
|
247
|
+
const badgeStyle = {
|
|
248
|
+
display: "inline-block",
|
|
249
|
+
padding: "3px 10px",
|
|
250
|
+
background: badgeColor,
|
|
251
|
+
color: "#fff",
|
|
252
|
+
fontSize: "10px",
|
|
253
|
+
fontFamily: "'DM Mono', monospace",
|
|
254
|
+
letterSpacing: "0.12em",
|
|
255
|
+
textTransform: "uppercase",
|
|
256
|
+
borderRadius: "3px",
|
|
257
|
+
marginBottom: "12px"
|
|
258
|
+
};
|
|
259
|
+
const subtitleStyle = {
|
|
260
|
+
fontSize: "10px",
|
|
261
|
+
fontFamily: "'DM Mono', monospace",
|
|
262
|
+
letterSpacing: "0.18em",
|
|
263
|
+
textTransform: "uppercase",
|
|
264
|
+
color: accentColor,
|
|
265
|
+
marginBottom: "6px"
|
|
266
|
+
};
|
|
267
|
+
const titleStyle = {
|
|
268
|
+
fontSize: "20px",
|
|
269
|
+
fontWeight: "700",
|
|
270
|
+
color: "#1a1a2e",
|
|
271
|
+
lineHeight: "1.25",
|
|
272
|
+
marginBottom: "10px",
|
|
273
|
+
letterSpacing: "-0.01em"
|
|
274
|
+
};
|
|
275
|
+
const descStyle = {
|
|
276
|
+
fontSize: "14px",
|
|
277
|
+
color: "#666",
|
|
278
|
+
lineHeight: "1.65",
|
|
279
|
+
marginBottom: tags.length ? "16px" : "0"
|
|
280
|
+
};
|
|
281
|
+
const tagsContainerStyle = {
|
|
282
|
+
display: "flex",
|
|
283
|
+
flexWrap: "wrap",
|
|
284
|
+
gap: "6px",
|
|
285
|
+
marginBottom: footer ? "0" : "0"
|
|
286
|
+
};
|
|
287
|
+
const tagStyle = {
|
|
288
|
+
padding: "4px 10px",
|
|
289
|
+
background: "#f2f2f2",
|
|
290
|
+
color: "#555",
|
|
291
|
+
fontSize: "11px",
|
|
292
|
+
fontFamily: "'DM Mono', monospace",
|
|
293
|
+
letterSpacing: "0.06em",
|
|
294
|
+
borderRadius: "100px",
|
|
295
|
+
transition: "background 0.2s"
|
|
296
|
+
};
|
|
297
|
+
const footerStyle = {
|
|
298
|
+
padding: "14px 24px",
|
|
299
|
+
borderTop: "1px solid #f0f0f0",
|
|
300
|
+
display: "flex",
|
|
301
|
+
alignItems: "center",
|
|
302
|
+
justifyContent: "space-between"
|
|
303
|
+
};
|
|
304
|
+
const arrowStyle = {
|
|
305
|
+
width: "32px",
|
|
306
|
+
height: "32px",
|
|
307
|
+
borderRadius: "50%",
|
|
308
|
+
background: accentColor,
|
|
309
|
+
color: "#fff",
|
|
310
|
+
display: "flex",
|
|
311
|
+
alignItems: "center",
|
|
312
|
+
justifyContent: "center",
|
|
313
|
+
fontSize: "14px",
|
|
314
|
+
transition: "transform 0.25s ease",
|
|
315
|
+
transform: hovered ? "translateX(3px)" : "translateX(0)",
|
|
316
|
+
flexShrink: 0
|
|
317
|
+
};
|
|
318
|
+
return /* @__PURE__ */ import_react2.default.createElement(import_react2.default.Fragment, null, /* @__PURE__ */ import_react2.default.createElement("style", null, `
|
|
319
|
+
@import url('https://fonts.googleapis.com/css2?family=Lora:wght@400;600;700&family=DM+Mono:wght@400;500&display=swap');
|
|
320
|
+
`), /* @__PURE__ */ import_react2.default.createElement(
|
|
321
|
+
"div",
|
|
322
|
+
{
|
|
323
|
+
style: cardStyle,
|
|
324
|
+
onMouseEnter: () => setHovered(true),
|
|
325
|
+
onMouseLeave: () => setHovered(false),
|
|
326
|
+
onClick,
|
|
327
|
+
role: onClick ? "button" : void 0,
|
|
328
|
+
tabIndex: onClick ? 0 : void 0
|
|
329
|
+
},
|
|
330
|
+
/* @__PURE__ */ import_react2.default.createElement("div", { style: accentBarStyle }),
|
|
331
|
+
image ? /* @__PURE__ */ import_react2.default.createElement("div", { style: { overflow: "hidden" } }, /* @__PURE__ */ import_react2.default.createElement("img", { src: image, alt: title, style: imageStyle })) : /* @__PURE__ */ import_react2.default.createElement("div", { style: imagePlaceholderStyle }, /* @__PURE__ */ import_react2.default.createElement("div", { style: {
|
|
332
|
+
position: "absolute",
|
|
333
|
+
width: "120px",
|
|
334
|
+
height: "120px",
|
|
335
|
+
border: `2px solid ${accentColor}44`,
|
|
336
|
+
borderRadius: "50%",
|
|
337
|
+
top: "20px",
|
|
338
|
+
right: "30px"
|
|
339
|
+
} }), /* @__PURE__ */ import_react2.default.createElement("div", { style: {
|
|
340
|
+
position: "absolute",
|
|
341
|
+
width: "60px",
|
|
342
|
+
height: "60px",
|
|
343
|
+
border: `2px solid ${accentColor}66`,
|
|
344
|
+
borderRadius: "50%",
|
|
345
|
+
bottom: "20px",
|
|
346
|
+
left: "40px"
|
|
347
|
+
} }), /* @__PURE__ */ import_react2.default.createElement("div", { style: {
|
|
348
|
+
position: "absolute",
|
|
349
|
+
width: "80px",
|
|
350
|
+
height: "80px",
|
|
351
|
+
background: `${accentColor}22`,
|
|
352
|
+
transform: "rotate(45deg)",
|
|
353
|
+
top: "50px",
|
|
354
|
+
left: "100px"
|
|
355
|
+
} }), /* @__PURE__ */ import_react2.default.createElement("span", { style: {
|
|
356
|
+
fontFamily: "'DM Mono', monospace",
|
|
357
|
+
fontSize: "11px",
|
|
358
|
+
letterSpacing: "0.2em",
|
|
359
|
+
color: "rgba(255,255,255,0.3)",
|
|
360
|
+
textTransform: "uppercase",
|
|
361
|
+
zIndex: 1
|
|
362
|
+
} }, "no image")),
|
|
363
|
+
/* @__PURE__ */ import_react2.default.createElement("div", { style: bodyStyle }, badge && /* @__PURE__ */ import_react2.default.createElement("div", { style: badgeStyle }, badge), /* @__PURE__ */ import_react2.default.createElement("div", { style: subtitleStyle }, subtitle), /* @__PURE__ */ import_react2.default.createElement("div", { style: titleStyle }, title), /* @__PURE__ */ import_react2.default.createElement("div", { style: descStyle }, description), tags.length > 0 && /* @__PURE__ */ import_react2.default.createElement("div", { style: tagsContainerStyle }, tags.map((tag, i) => /* @__PURE__ */ import_react2.default.createElement("span", { key: i, style: tagStyle }, tag)))),
|
|
364
|
+
(footer || onClick) && /* @__PURE__ */ import_react2.default.createElement("div", { style: footerStyle }, /* @__PURE__ */ import_react2.default.createElement("span", { style: { fontSize: "13px", color: "#999", fontFamily: "'DM Mono', monospace" } }, footer || "View details"), onClick && /* @__PURE__ */ import_react2.default.createElement("div", { style: arrowStyle }, "\u2192"))
|
|
365
|
+
));
|
|
366
|
+
};
|
|
367
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
368
|
+
0 && (module.exports = {
|
|
369
|
+
Button,
|
|
370
|
+
Card
|
|
371
|
+
});
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,334 @@
|
|
|
1
|
+
// src/components/Button/Button.jsx
|
|
2
|
+
import React, { useState } from "react";
|
|
3
|
+
var Button = ({
|
|
4
|
+
label = "Click Me",
|
|
5
|
+
onClick = () => {
|
|
6
|
+
},
|
|
7
|
+
variant = "primary",
|
|
8
|
+
size = "md",
|
|
9
|
+
disabled = false,
|
|
10
|
+
icon = null,
|
|
11
|
+
fullWidth = false
|
|
12
|
+
}) => {
|
|
13
|
+
const [pressed, setPressed] = useState(false);
|
|
14
|
+
const [ripples, setRipples] = useState([]);
|
|
15
|
+
const palette = {
|
|
16
|
+
primary: {
|
|
17
|
+
bg: "#0f0f0f",
|
|
18
|
+
text: "#f5f0e8",
|
|
19
|
+
border: "#0f0f0f",
|
|
20
|
+
hover: "#2a2a2a",
|
|
21
|
+
accent: "#e8d5a3"
|
|
22
|
+
},
|
|
23
|
+
secondary: {
|
|
24
|
+
bg: "transparent",
|
|
25
|
+
text: "#0f0f0f",
|
|
26
|
+
border: "#0f0f0f",
|
|
27
|
+
hover: "#f0ebe0",
|
|
28
|
+
accent: "#0f0f0f"
|
|
29
|
+
},
|
|
30
|
+
danger: {
|
|
31
|
+
bg: "#c0392b",
|
|
32
|
+
text: "#fff5f5",
|
|
33
|
+
border: "#c0392b",
|
|
34
|
+
hover: "#a93226",
|
|
35
|
+
accent: "#ffcdd2"
|
|
36
|
+
},
|
|
37
|
+
ghost: {
|
|
38
|
+
bg: "transparent",
|
|
39
|
+
text: "#5a5a5a",
|
|
40
|
+
border: "transparent",
|
|
41
|
+
hover: "#f5f0e8",
|
|
42
|
+
accent: "#0f0f0f"
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
const sizes = {
|
|
46
|
+
sm: { padding: "8px 18px", fontSize: "12px", letterSpacing: "0.12em", height: "34px" },
|
|
47
|
+
md: { padding: "12px 28px", fontSize: "13px", letterSpacing: "0.14em", height: "44px" },
|
|
48
|
+
lg: { padding: "16px 40px", fontSize: "14px", letterSpacing: "0.16em", height: "54px" }
|
|
49
|
+
};
|
|
50
|
+
const [hovered, setHovered] = useState(false);
|
|
51
|
+
const colors = palette[variant] || palette.primary;
|
|
52
|
+
const sizing = sizes[size] || sizes.md;
|
|
53
|
+
const addRipple = (e) => {
|
|
54
|
+
const rect = e.currentTarget.getBoundingClientRect();
|
|
55
|
+
const x = e.clientX - rect.left;
|
|
56
|
+
const y = e.clientY - rect.top;
|
|
57
|
+
const id = Date.now();
|
|
58
|
+
setRipples((prev) => [...prev, { x, y, id }]);
|
|
59
|
+
setTimeout(() => setRipples((prev) => prev.filter((r) => r.id !== id)), 600);
|
|
60
|
+
};
|
|
61
|
+
const handleClick = (e) => {
|
|
62
|
+
if (disabled) return;
|
|
63
|
+
addRipple(e);
|
|
64
|
+
setPressed(true);
|
|
65
|
+
setTimeout(() => setPressed(false), 150);
|
|
66
|
+
onClick(e);
|
|
67
|
+
};
|
|
68
|
+
const baseStyle = {
|
|
69
|
+
position: "relative",
|
|
70
|
+
overflow: "hidden",
|
|
71
|
+
display: "inline-flex",
|
|
72
|
+
alignItems: "center",
|
|
73
|
+
justifyContent: "center",
|
|
74
|
+
gap: "8px",
|
|
75
|
+
height: sizing.height,
|
|
76
|
+
padding: sizing.padding,
|
|
77
|
+
fontSize: sizing.fontSize,
|
|
78
|
+
fontFamily: "'DM Mono', 'Courier New', monospace",
|
|
79
|
+
fontWeight: "500",
|
|
80
|
+
letterSpacing: sizing.letterSpacing,
|
|
81
|
+
textTransform: "uppercase",
|
|
82
|
+
color: hovered && !disabled ? colors.accent : colors.text,
|
|
83
|
+
backgroundColor: hovered && !disabled ? colors.hover : colors.bg,
|
|
84
|
+
border: `1.5px solid ${colors.border}`,
|
|
85
|
+
borderRadius: "3px",
|
|
86
|
+
cursor: disabled ? "not-allowed" : "pointer",
|
|
87
|
+
opacity: disabled ? 0.4 : 1,
|
|
88
|
+
width: fullWidth ? "100%" : "auto",
|
|
89
|
+
outline: "none",
|
|
90
|
+
WebkitFontSmoothing: "antialiased",
|
|
91
|
+
transition: "background-color 0.18s ease, color 0.18s ease, transform 0.1s ease, box-shadow 0.18s ease",
|
|
92
|
+
transform: pressed ? "scale(0.97)" : "scale(1)",
|
|
93
|
+
boxShadow: hovered && !disabled ? variant === "primary" ? "4px 4px 0px #e8d5a3" : variant === "secondary" ? "4px 4px 0px #0f0f0f" : "none" : "none",
|
|
94
|
+
userSelect: "none"
|
|
95
|
+
};
|
|
96
|
+
const rippleStyle = (r) => ({
|
|
97
|
+
position: "absolute",
|
|
98
|
+
left: r.x - 50,
|
|
99
|
+
top: r.y - 50,
|
|
100
|
+
width: 100,
|
|
101
|
+
height: 100,
|
|
102
|
+
borderRadius: "50%",
|
|
103
|
+
background: variant === "primary" || variant === "danger" ? "rgba(255,255,255,0.18)" : "rgba(0,0,0,0.08)",
|
|
104
|
+
transform: "scale(0)",
|
|
105
|
+
animation: "rippleAnim 0.6s linear forwards",
|
|
106
|
+
pointerEvents: "none"
|
|
107
|
+
});
|
|
108
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("style", null, `
|
|
109
|
+
@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&display=swap');
|
|
110
|
+
@keyframes rippleAnim {
|
|
111
|
+
to { transform: scale(4); opacity: 0; }
|
|
112
|
+
}
|
|
113
|
+
`), /* @__PURE__ */ React.createElement(
|
|
114
|
+
"button",
|
|
115
|
+
{
|
|
116
|
+
style: baseStyle,
|
|
117
|
+
onClick: handleClick,
|
|
118
|
+
onMouseEnter: () => setHovered(true),
|
|
119
|
+
onMouseLeave: () => setHovered(false),
|
|
120
|
+
disabled,
|
|
121
|
+
"aria-disabled": disabled
|
|
122
|
+
},
|
|
123
|
+
ripples.map((r) => /* @__PURE__ */ React.createElement("span", { key: r.id, style: rippleStyle(r) })),
|
|
124
|
+
icon && /* @__PURE__ */ React.createElement("span", { style: { display: "flex", alignItems: "center", lineHeight: 1 } }, icon),
|
|
125
|
+
/* @__PURE__ */ React.createElement("span", { style: { position: "relative", zIndex: 1 } }, label)
|
|
126
|
+
));
|
|
127
|
+
};
|
|
128
|
+
|
|
129
|
+
// src/components/Card/Card.jsx
|
|
130
|
+
import React2, { useState as useState2 } from "react";
|
|
131
|
+
var Card = ({
|
|
132
|
+
title = "Card Title",
|
|
133
|
+
subtitle = "Subtitle or category",
|
|
134
|
+
description = "A short description that gives context about this card's content and purpose.",
|
|
135
|
+
image = null,
|
|
136
|
+
badge = null,
|
|
137
|
+
badgeColor = "#1a1a2e",
|
|
138
|
+
tags = [],
|
|
139
|
+
footer = null,
|
|
140
|
+
onClick = null,
|
|
141
|
+
variant = "default",
|
|
142
|
+
// default | elevated | outlined | glass
|
|
143
|
+
accentColor = "#e63946",
|
|
144
|
+
width = "320px"
|
|
145
|
+
}) => {
|
|
146
|
+
const [hovered, setHovered] = useState2(false);
|
|
147
|
+
const variants = {
|
|
148
|
+
default: {
|
|
149
|
+
bg: "#ffffff",
|
|
150
|
+
border: "1px solid #ececec",
|
|
151
|
+
shadow: hovered ? "0 20px 60px rgba(0,0,0,0.12), 0 6px 20px rgba(0,0,0,0.08)" : "0 2px 12px rgba(0,0,0,0.06)"
|
|
152
|
+
},
|
|
153
|
+
elevated: {
|
|
154
|
+
bg: "#ffffff",
|
|
155
|
+
border: "none",
|
|
156
|
+
shadow: hovered ? "0 32px 80px rgba(0,0,0,0.18), 0 8px 24px rgba(0,0,0,0.1)" : "0 8px 32px rgba(0,0,0,0.1), 0 2px 8px rgba(0,0,0,0.06)"
|
|
157
|
+
},
|
|
158
|
+
outlined: {
|
|
159
|
+
bg: "#fafafa",
|
|
160
|
+
border: `2px solid ${hovered ? accentColor : "#d0d0d0"}`,
|
|
161
|
+
shadow: "none"
|
|
162
|
+
},
|
|
163
|
+
glass: {
|
|
164
|
+
bg: "rgba(255,255,255,0.6)",
|
|
165
|
+
border: "1px solid rgba(255,255,255,0.8)",
|
|
166
|
+
shadow: hovered ? "0 20px 60px rgba(0,0,0,0.15)" : "0 8px 32px rgba(0,0,0,0.08)"
|
|
167
|
+
}
|
|
168
|
+
};
|
|
169
|
+
const v = variants[variant] || variants.default;
|
|
170
|
+
const cardStyle = {
|
|
171
|
+
width,
|
|
172
|
+
background: v.bg,
|
|
173
|
+
border: v.border,
|
|
174
|
+
borderRadius: "16px",
|
|
175
|
+
boxShadow: v.shadow,
|
|
176
|
+
overflow: "hidden",
|
|
177
|
+
cursor: onClick ? "pointer" : "default",
|
|
178
|
+
transition: "all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1)",
|
|
179
|
+
transform: hovered && onClick ? "translateY(-6px)" : "translateY(0)",
|
|
180
|
+
backdropFilter: variant === "glass" ? "blur(12px)" : "none",
|
|
181
|
+
fontFamily: "'Lora', Georgia, serif",
|
|
182
|
+
position: "relative"
|
|
183
|
+
};
|
|
184
|
+
const accentBarStyle = {
|
|
185
|
+
height: "4px",
|
|
186
|
+
background: `linear-gradient(90deg, ${accentColor}, ${accentColor}99)`,
|
|
187
|
+
width: hovered ? "100%" : "40%",
|
|
188
|
+
transition: "width 0.4s ease"
|
|
189
|
+
};
|
|
190
|
+
const imageStyle = {
|
|
191
|
+
width: "100%",
|
|
192
|
+
height: "180px",
|
|
193
|
+
objectFit: "cover",
|
|
194
|
+
display: "block",
|
|
195
|
+
transition: "transform 0.5s ease",
|
|
196
|
+
transform: hovered ? "scale(1.04)" : "scale(1)"
|
|
197
|
+
};
|
|
198
|
+
const imagePlaceholderStyle = {
|
|
199
|
+
width: "100%",
|
|
200
|
+
height: "180px",
|
|
201
|
+
background: `linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, ${accentColor}33 100%)`,
|
|
202
|
+
display: "flex",
|
|
203
|
+
alignItems: "center",
|
|
204
|
+
justifyContent: "center",
|
|
205
|
+
overflow: "hidden",
|
|
206
|
+
position: "relative"
|
|
207
|
+
};
|
|
208
|
+
const bodyStyle = {
|
|
209
|
+
padding: "22px 24px 20px"
|
|
210
|
+
};
|
|
211
|
+
const badgeStyle = {
|
|
212
|
+
display: "inline-block",
|
|
213
|
+
padding: "3px 10px",
|
|
214
|
+
background: badgeColor,
|
|
215
|
+
color: "#fff",
|
|
216
|
+
fontSize: "10px",
|
|
217
|
+
fontFamily: "'DM Mono', monospace",
|
|
218
|
+
letterSpacing: "0.12em",
|
|
219
|
+
textTransform: "uppercase",
|
|
220
|
+
borderRadius: "3px",
|
|
221
|
+
marginBottom: "12px"
|
|
222
|
+
};
|
|
223
|
+
const subtitleStyle = {
|
|
224
|
+
fontSize: "10px",
|
|
225
|
+
fontFamily: "'DM Mono', monospace",
|
|
226
|
+
letterSpacing: "0.18em",
|
|
227
|
+
textTransform: "uppercase",
|
|
228
|
+
color: accentColor,
|
|
229
|
+
marginBottom: "6px"
|
|
230
|
+
};
|
|
231
|
+
const titleStyle = {
|
|
232
|
+
fontSize: "20px",
|
|
233
|
+
fontWeight: "700",
|
|
234
|
+
color: "#1a1a2e",
|
|
235
|
+
lineHeight: "1.25",
|
|
236
|
+
marginBottom: "10px",
|
|
237
|
+
letterSpacing: "-0.01em"
|
|
238
|
+
};
|
|
239
|
+
const descStyle = {
|
|
240
|
+
fontSize: "14px",
|
|
241
|
+
color: "#666",
|
|
242
|
+
lineHeight: "1.65",
|
|
243
|
+
marginBottom: tags.length ? "16px" : "0"
|
|
244
|
+
};
|
|
245
|
+
const tagsContainerStyle = {
|
|
246
|
+
display: "flex",
|
|
247
|
+
flexWrap: "wrap",
|
|
248
|
+
gap: "6px",
|
|
249
|
+
marginBottom: footer ? "0" : "0"
|
|
250
|
+
};
|
|
251
|
+
const tagStyle = {
|
|
252
|
+
padding: "4px 10px",
|
|
253
|
+
background: "#f2f2f2",
|
|
254
|
+
color: "#555",
|
|
255
|
+
fontSize: "11px",
|
|
256
|
+
fontFamily: "'DM Mono', monospace",
|
|
257
|
+
letterSpacing: "0.06em",
|
|
258
|
+
borderRadius: "100px",
|
|
259
|
+
transition: "background 0.2s"
|
|
260
|
+
};
|
|
261
|
+
const footerStyle = {
|
|
262
|
+
padding: "14px 24px",
|
|
263
|
+
borderTop: "1px solid #f0f0f0",
|
|
264
|
+
display: "flex",
|
|
265
|
+
alignItems: "center",
|
|
266
|
+
justifyContent: "space-between"
|
|
267
|
+
};
|
|
268
|
+
const arrowStyle = {
|
|
269
|
+
width: "32px",
|
|
270
|
+
height: "32px",
|
|
271
|
+
borderRadius: "50%",
|
|
272
|
+
background: accentColor,
|
|
273
|
+
color: "#fff",
|
|
274
|
+
display: "flex",
|
|
275
|
+
alignItems: "center",
|
|
276
|
+
justifyContent: "center",
|
|
277
|
+
fontSize: "14px",
|
|
278
|
+
transition: "transform 0.25s ease",
|
|
279
|
+
transform: hovered ? "translateX(3px)" : "translateX(0)",
|
|
280
|
+
flexShrink: 0
|
|
281
|
+
};
|
|
282
|
+
return /* @__PURE__ */ React2.createElement(React2.Fragment, null, /* @__PURE__ */ React2.createElement("style", null, `
|
|
283
|
+
@import url('https://fonts.googleapis.com/css2?family=Lora:wght@400;600;700&family=DM+Mono:wght@400;500&display=swap');
|
|
284
|
+
`), /* @__PURE__ */ React2.createElement(
|
|
285
|
+
"div",
|
|
286
|
+
{
|
|
287
|
+
style: cardStyle,
|
|
288
|
+
onMouseEnter: () => setHovered(true),
|
|
289
|
+
onMouseLeave: () => setHovered(false),
|
|
290
|
+
onClick,
|
|
291
|
+
role: onClick ? "button" : void 0,
|
|
292
|
+
tabIndex: onClick ? 0 : void 0
|
|
293
|
+
},
|
|
294
|
+
/* @__PURE__ */ React2.createElement("div", { style: accentBarStyle }),
|
|
295
|
+
image ? /* @__PURE__ */ React2.createElement("div", { style: { overflow: "hidden" } }, /* @__PURE__ */ React2.createElement("img", { src: image, alt: title, style: imageStyle })) : /* @__PURE__ */ React2.createElement("div", { style: imagePlaceholderStyle }, /* @__PURE__ */ React2.createElement("div", { style: {
|
|
296
|
+
position: "absolute",
|
|
297
|
+
width: "120px",
|
|
298
|
+
height: "120px",
|
|
299
|
+
border: `2px solid ${accentColor}44`,
|
|
300
|
+
borderRadius: "50%",
|
|
301
|
+
top: "20px",
|
|
302
|
+
right: "30px"
|
|
303
|
+
} }), /* @__PURE__ */ React2.createElement("div", { style: {
|
|
304
|
+
position: "absolute",
|
|
305
|
+
width: "60px",
|
|
306
|
+
height: "60px",
|
|
307
|
+
border: `2px solid ${accentColor}66`,
|
|
308
|
+
borderRadius: "50%",
|
|
309
|
+
bottom: "20px",
|
|
310
|
+
left: "40px"
|
|
311
|
+
} }), /* @__PURE__ */ React2.createElement("div", { style: {
|
|
312
|
+
position: "absolute",
|
|
313
|
+
width: "80px",
|
|
314
|
+
height: "80px",
|
|
315
|
+
background: `${accentColor}22`,
|
|
316
|
+
transform: "rotate(45deg)",
|
|
317
|
+
top: "50px",
|
|
318
|
+
left: "100px"
|
|
319
|
+
} }), /* @__PURE__ */ React2.createElement("span", { style: {
|
|
320
|
+
fontFamily: "'DM Mono', monospace",
|
|
321
|
+
fontSize: "11px",
|
|
322
|
+
letterSpacing: "0.2em",
|
|
323
|
+
color: "rgba(255,255,255,0.3)",
|
|
324
|
+
textTransform: "uppercase",
|
|
325
|
+
zIndex: 1
|
|
326
|
+
} }, "no image")),
|
|
327
|
+
/* @__PURE__ */ React2.createElement("div", { style: bodyStyle }, badge && /* @__PURE__ */ React2.createElement("div", { style: badgeStyle }, badge), /* @__PURE__ */ React2.createElement("div", { style: subtitleStyle }, subtitle), /* @__PURE__ */ React2.createElement("div", { style: titleStyle }, title), /* @__PURE__ */ React2.createElement("div", { style: descStyle }, description), tags.length > 0 && /* @__PURE__ */ React2.createElement("div", { style: tagsContainerStyle }, tags.map((tag, i) => /* @__PURE__ */ React2.createElement("span", { key: i, style: tagStyle }, tag)))),
|
|
328
|
+
(footer || onClick) && /* @__PURE__ */ React2.createElement("div", { style: footerStyle }, /* @__PURE__ */ React2.createElement("span", { style: { fontSize: "13px", color: "#999", fontFamily: "'DM Mono', monospace" } }, footer || "View details"), onClick && /* @__PURE__ */ React2.createElement("div", { style: arrowStyle }, "\u2192"))
|
|
329
|
+
));
|
|
330
|
+
};
|
|
331
|
+
export {
|
|
332
|
+
Button,
|
|
333
|
+
Card
|
|
334
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "bhoomi-virtual-ui-library",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"main": "dist/index.js",
|
|
5
|
+
"module": "dist/index.mjs",
|
|
6
|
+
"files": ["dist"],
|
|
7
|
+
"scripts": {
|
|
8
|
+
"build": "tsup"
|
|
9
|
+
},
|
|
10
|
+
"author": "Bhoomi",
|
|
11
|
+
"license": "ISC",
|
|
12
|
+
"description": "Virtual UI React Component Library",
|
|
13
|
+
"peerDependencies": {
|
|
14
|
+
"react": ">=18"
|
|
15
|
+
},
|
|
16
|
+
"devDependencies": {
|
|
17
|
+
"tsup": "^8.5.1",
|
|
18
|
+
"typescript": "^6.0.3"
|
|
19
|
+
}
|
|
20
|
+
}
|