virtual-library-ui 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 ADDED
@@ -0,0 +1,177 @@
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
+ InteractiveCard: () => InteractiveCard
33
+ });
34
+ module.exports = __toCommonJS(index_exports);
35
+
36
+ // src/components/Button/Button.jsx
37
+ var import_react = __toESM(require("react"));
38
+ var InteractiveCard = ({
39
+ title = "Card Title",
40
+ description = "A clean, interactive card component you can customize to your heart's content.",
41
+ tag = "Featured",
42
+ accentColor = "#6C63FF",
43
+ backgroundColor = "#1a1a2e",
44
+ textColor = "#e8e8f0",
45
+ width = 340,
46
+ onAction = null,
47
+ actionLabel = "Explore"
48
+ }) => {
49
+ const [hovered, setHovered] = (0, import_react.useState)(false);
50
+ const [clicked, setClicked] = (0, import_react.useState)(false);
51
+ const [liked, setLiked] = (0, import_react.useState)(false);
52
+ const handleAction = () => {
53
+ setClicked(true);
54
+ setTimeout(() => setClicked(false), 300);
55
+ if (onAction) onAction({ title, liked });
56
+ };
57
+ const styles = {
58
+ card: {
59
+ width,
60
+ background: backgroundColor,
61
+ borderRadius: 20,
62
+ padding: "28px 28px 24px",
63
+ boxSizing: "border-box",
64
+ fontFamily: "'Georgia', 'Times New Roman', serif",
65
+ color: textColor,
66
+ position: "relative",
67
+ overflow: "hidden",
68
+ cursor: "default",
69
+ transition: "transform 0.3s ease, box-shadow 0.3s ease",
70
+ transform: hovered ? "translateY(-6px)" : "translateY(0)",
71
+ boxShadow: hovered ? `0 20px 48px rgba(0,0,0,0.5), 0 0 0 1px ${accentColor}55` : "0 8px 24px rgba(0,0,0,0.3)"
72
+ },
73
+ glow: {
74
+ position: "absolute",
75
+ top: -60,
76
+ right: -60,
77
+ width: 180,
78
+ height: 180,
79
+ borderRadius: "50%",
80
+ background: `radial-gradient(circle, ${accentColor}44 0%, transparent 70%)`,
81
+ transition: "opacity 0.3s ease",
82
+ opacity: hovered ? 1 : 0.4,
83
+ pointerEvents: "none"
84
+ },
85
+ tag: {
86
+ display: "inline-block",
87
+ background: `${accentColor}22`,
88
+ color: accentColor,
89
+ border: `1px solid ${accentColor}55`,
90
+ borderRadius: 6,
91
+ padding: "3px 10px",
92
+ fontSize: 11,
93
+ fontFamily: "'Courier New', monospace",
94
+ letterSpacing: "0.08em",
95
+ textTransform: "uppercase",
96
+ marginBottom: 16
97
+ },
98
+ title: {
99
+ margin: "0 0 10px",
100
+ fontSize: 22,
101
+ fontWeight: "normal",
102
+ lineHeight: 1.3,
103
+ letterSpacing: "-0.01em",
104
+ color: textColor
105
+ },
106
+ divider: {
107
+ height: 1,
108
+ background: `linear-gradient(to right, ${accentColor}88, transparent)`,
109
+ margin: "14px 0",
110
+ border: "none"
111
+ },
112
+ description: {
113
+ margin: 0,
114
+ fontSize: 14,
115
+ lineHeight: 1.7,
116
+ color: `${textColor}bb`,
117
+ fontFamily: "'Georgia', serif"
118
+ },
119
+ footer: {
120
+ display: "flex",
121
+ alignItems: "center",
122
+ justifyContent: "space-between",
123
+ marginTop: 22
124
+ },
125
+ button: {
126
+ background: clicked ? accentColor : "transparent",
127
+ color: clicked ? "#fff" : accentColor,
128
+ border: `1.5px solid ${accentColor}`,
129
+ borderRadius: 8,
130
+ padding: "8px 18px",
131
+ fontSize: 13,
132
+ fontFamily: "'Courier New', monospace",
133
+ letterSpacing: "0.05em",
134
+ cursor: "pointer",
135
+ transition: "background 0.15s ease, color 0.15s ease, transform 0.1s ease",
136
+ transform: clicked ? "scale(0.96)" : "scale(1)",
137
+ outline: "none"
138
+ },
139
+ likeBtn: {
140
+ background: "none",
141
+ border: "none",
142
+ cursor: "pointer",
143
+ fontSize: 20,
144
+ padding: "4px 8px",
145
+ borderRadius: 8,
146
+ transition: "transform 0.2s ease",
147
+ transform: liked ? "scale(1.3)" : "scale(1)",
148
+ filter: liked ? "none" : "grayscale(1) opacity(0.5)"
149
+ }
150
+ };
151
+ return /* @__PURE__ */ import_react.default.createElement(
152
+ "div",
153
+ {
154
+ style: styles.card,
155
+ onMouseEnter: () => setHovered(true),
156
+ onMouseLeave: () => setHovered(false)
157
+ },
158
+ /* @__PURE__ */ import_react.default.createElement("div", { style: styles.glow }),
159
+ /* @__PURE__ */ import_react.default.createElement("div", { style: styles.tag }, tag),
160
+ /* @__PURE__ */ import_react.default.createElement("h2", { style: styles.title }, title),
161
+ /* @__PURE__ */ import_react.default.createElement("hr", { style: styles.divider }),
162
+ /* @__PURE__ */ import_react.default.createElement("p", { style: styles.description }, description),
163
+ /* @__PURE__ */ import_react.default.createElement("div", { style: styles.footer }, /* @__PURE__ */ import_react.default.createElement("button", { style: styles.button, onClick: handleAction }, actionLabel, " \u2192"), /* @__PURE__ */ import_react.default.createElement(
164
+ "button",
165
+ {
166
+ style: styles.likeBtn,
167
+ onClick: () => setLiked((l) => !l),
168
+ title: liked ? "Unlike" : "Like"
169
+ },
170
+ liked ? "\u2665" : "\u2661"
171
+ ))
172
+ );
173
+ };
174
+ // Annotate the CommonJS export names for ESM import in node:
175
+ 0 && (module.exports = {
176
+ InteractiveCard
177
+ });
package/dist/index.mjs ADDED
@@ -0,0 +1,141 @@
1
+ // src/components/Button/Button.jsx
2
+ import React, { useState } from "react";
3
+ var InteractiveCard = ({
4
+ title = "Card Title",
5
+ description = "A clean, interactive card component you can customize to your heart's content.",
6
+ tag = "Featured",
7
+ accentColor = "#6C63FF",
8
+ backgroundColor = "#1a1a2e",
9
+ textColor = "#e8e8f0",
10
+ width = 340,
11
+ onAction = null,
12
+ actionLabel = "Explore"
13
+ }) => {
14
+ const [hovered, setHovered] = useState(false);
15
+ const [clicked, setClicked] = useState(false);
16
+ const [liked, setLiked] = useState(false);
17
+ const handleAction = () => {
18
+ setClicked(true);
19
+ setTimeout(() => setClicked(false), 300);
20
+ if (onAction) onAction({ title, liked });
21
+ };
22
+ const styles = {
23
+ card: {
24
+ width,
25
+ background: backgroundColor,
26
+ borderRadius: 20,
27
+ padding: "28px 28px 24px",
28
+ boxSizing: "border-box",
29
+ fontFamily: "'Georgia', 'Times New Roman', serif",
30
+ color: textColor,
31
+ position: "relative",
32
+ overflow: "hidden",
33
+ cursor: "default",
34
+ transition: "transform 0.3s ease, box-shadow 0.3s ease",
35
+ transform: hovered ? "translateY(-6px)" : "translateY(0)",
36
+ boxShadow: hovered ? `0 20px 48px rgba(0,0,0,0.5), 0 0 0 1px ${accentColor}55` : "0 8px 24px rgba(0,0,0,0.3)"
37
+ },
38
+ glow: {
39
+ position: "absolute",
40
+ top: -60,
41
+ right: -60,
42
+ width: 180,
43
+ height: 180,
44
+ borderRadius: "50%",
45
+ background: `radial-gradient(circle, ${accentColor}44 0%, transparent 70%)`,
46
+ transition: "opacity 0.3s ease",
47
+ opacity: hovered ? 1 : 0.4,
48
+ pointerEvents: "none"
49
+ },
50
+ tag: {
51
+ display: "inline-block",
52
+ background: `${accentColor}22`,
53
+ color: accentColor,
54
+ border: `1px solid ${accentColor}55`,
55
+ borderRadius: 6,
56
+ padding: "3px 10px",
57
+ fontSize: 11,
58
+ fontFamily: "'Courier New', monospace",
59
+ letterSpacing: "0.08em",
60
+ textTransform: "uppercase",
61
+ marginBottom: 16
62
+ },
63
+ title: {
64
+ margin: "0 0 10px",
65
+ fontSize: 22,
66
+ fontWeight: "normal",
67
+ lineHeight: 1.3,
68
+ letterSpacing: "-0.01em",
69
+ color: textColor
70
+ },
71
+ divider: {
72
+ height: 1,
73
+ background: `linear-gradient(to right, ${accentColor}88, transparent)`,
74
+ margin: "14px 0",
75
+ border: "none"
76
+ },
77
+ description: {
78
+ margin: 0,
79
+ fontSize: 14,
80
+ lineHeight: 1.7,
81
+ color: `${textColor}bb`,
82
+ fontFamily: "'Georgia', serif"
83
+ },
84
+ footer: {
85
+ display: "flex",
86
+ alignItems: "center",
87
+ justifyContent: "space-between",
88
+ marginTop: 22
89
+ },
90
+ button: {
91
+ background: clicked ? accentColor : "transparent",
92
+ color: clicked ? "#fff" : accentColor,
93
+ border: `1.5px solid ${accentColor}`,
94
+ borderRadius: 8,
95
+ padding: "8px 18px",
96
+ fontSize: 13,
97
+ fontFamily: "'Courier New', monospace",
98
+ letterSpacing: "0.05em",
99
+ cursor: "pointer",
100
+ transition: "background 0.15s ease, color 0.15s ease, transform 0.1s ease",
101
+ transform: clicked ? "scale(0.96)" : "scale(1)",
102
+ outline: "none"
103
+ },
104
+ likeBtn: {
105
+ background: "none",
106
+ border: "none",
107
+ cursor: "pointer",
108
+ fontSize: 20,
109
+ padding: "4px 8px",
110
+ borderRadius: 8,
111
+ transition: "transform 0.2s ease",
112
+ transform: liked ? "scale(1.3)" : "scale(1)",
113
+ filter: liked ? "none" : "grayscale(1) opacity(0.5)"
114
+ }
115
+ };
116
+ return /* @__PURE__ */ React.createElement(
117
+ "div",
118
+ {
119
+ style: styles.card,
120
+ onMouseEnter: () => setHovered(true),
121
+ onMouseLeave: () => setHovered(false)
122
+ },
123
+ /* @__PURE__ */ React.createElement("div", { style: styles.glow }),
124
+ /* @__PURE__ */ React.createElement("div", { style: styles.tag }, tag),
125
+ /* @__PURE__ */ React.createElement("h2", { style: styles.title }, title),
126
+ /* @__PURE__ */ React.createElement("hr", { style: styles.divider }),
127
+ /* @__PURE__ */ React.createElement("p", { style: styles.description }, description),
128
+ /* @__PURE__ */ React.createElement("div", { style: styles.footer }, /* @__PURE__ */ React.createElement("button", { style: styles.button, onClick: handleAction }, actionLabel, " \u2192"), /* @__PURE__ */ React.createElement(
129
+ "button",
130
+ {
131
+ style: styles.likeBtn,
132
+ onClick: () => setLiked((l) => !l),
133
+ title: liked ? "Unlike" : "Like"
134
+ },
135
+ liked ? "\u2665" : "\u2661"
136
+ ))
137
+ );
138
+ };
139
+ export {
140
+ InteractiveCard
141
+ };
package/package.json ADDED
@@ -0,0 +1,22 @@
1
+ {
2
+ "name": "virtual-library-ui",
3
+ "version": "1.0.0",
4
+ "description": "Virtual UI React Component Library",
5
+ "main": "dist/index.js",
6
+ "module": "dist/index.mjs",
7
+ "files": [
8
+ "dist"
9
+ ],
10
+ "scripts": {
11
+ "build": "tsup"
12
+ },
13
+ "author": "Chetan",
14
+ "license": "ISC",
15
+ "peerDependencies": {
16
+ "react": ">=18"
17
+ },
18
+ "devDependencies": {
19
+ "tsup": "^8.5.1",
20
+ "typescript": "^6.0.3"
21
+ }
22
+ }