surya-virtual-ui-lib 1.0.81
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 +198 -0
- package/dist/index.mjs +161 -0
- package/package.json +22 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,198 @@
|
|
|
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
|
+
text = "Click Me",
|
|
41
|
+
variant = "gradient",
|
|
42
|
+
// primary | outline | ghost | gradient
|
|
43
|
+
size = "md",
|
|
44
|
+
// sm | md | lg
|
|
45
|
+
icon,
|
|
46
|
+
loading = false,
|
|
47
|
+
disabled = false,
|
|
48
|
+
onClick
|
|
49
|
+
}) => {
|
|
50
|
+
const [hovered, setHovered] = (0, import_react.useState)(false);
|
|
51
|
+
const variants = {
|
|
52
|
+
primary: {
|
|
53
|
+
background: "#2563eb",
|
|
54
|
+
color: "#fff",
|
|
55
|
+
border: "none"
|
|
56
|
+
},
|
|
57
|
+
outline: {
|
|
58
|
+
background: "transparent",
|
|
59
|
+
color: "#2563eb",
|
|
60
|
+
border: "1px solid #2563eb"
|
|
61
|
+
},
|
|
62
|
+
ghost: {
|
|
63
|
+
background: "transparent",
|
|
64
|
+
color: "#111",
|
|
65
|
+
border: "none"
|
|
66
|
+
},
|
|
67
|
+
gradient: {
|
|
68
|
+
background: "linear-gradient(135deg, #6366f1, #06b6d4)",
|
|
69
|
+
color: "#fff",
|
|
70
|
+
border: "none"
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
const sizes = {
|
|
74
|
+
sm: { padding: "6px 12px", fontSize: "12px" },
|
|
75
|
+
md: { padding: "10px 18px", fontSize: "14px" },
|
|
76
|
+
lg: { padding: "14px 24px", fontSize: "16px" }
|
|
77
|
+
};
|
|
78
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
79
|
+
"button",
|
|
80
|
+
{
|
|
81
|
+
onClick,
|
|
82
|
+
disabled: disabled || loading,
|
|
83
|
+
onMouseEnter: () => setHovered(true),
|
|
84
|
+
onMouseLeave: () => setHovered(false),
|
|
85
|
+
style: {
|
|
86
|
+
...variants[variant],
|
|
87
|
+
...sizes[size],
|
|
88
|
+
borderRadius: "10px",
|
|
89
|
+
cursor: disabled ? "not-allowed" : "pointer",
|
|
90
|
+
display: "flex",
|
|
91
|
+
alignItems: "center",
|
|
92
|
+
gap: "8px",
|
|
93
|
+
fontWeight: 600,
|
|
94
|
+
fontFamily: "sans-serif",
|
|
95
|
+
// 🔥 Animation
|
|
96
|
+
transform: hovered ? "translateY(-2px) scale(1.02)" : "scale(1)",
|
|
97
|
+
boxShadow: hovered ? "0 10px 20px rgba(0,0,0,0.15)" : "0 2px 6px rgba(0,0,0,0.1)",
|
|
98
|
+
transition: "all 0.2s ease",
|
|
99
|
+
opacity: disabled ? 0.6 : 1,
|
|
100
|
+
position: "relative",
|
|
101
|
+
overflow: "hidden"
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
/* @__PURE__ */ import_react.default.createElement(
|
|
105
|
+
"span",
|
|
106
|
+
{
|
|
107
|
+
style: {
|
|
108
|
+
position: "absolute",
|
|
109
|
+
inset: 0,
|
|
110
|
+
background: "rgba(255,255,255,0.2)",
|
|
111
|
+
opacity: hovered ? 1 : 0,
|
|
112
|
+
transition: "opacity 0.3s"
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
),
|
|
116
|
+
loading ? /* @__PURE__ */ import_react.default.createElement("span", null, "Loading...") : /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, icon && /* @__PURE__ */ import_react.default.createElement("span", null, icon), /* @__PURE__ */ import_react.default.createElement("span", null, text))
|
|
117
|
+
);
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
// src/components/Card/Card.jsx
|
|
121
|
+
var import_react2 = __toESM(require("react"));
|
|
122
|
+
var Card = ({
|
|
123
|
+
title = "Performance",
|
|
124
|
+
description = "Real-time metrics with live dashboard updates every second.",
|
|
125
|
+
icon = "\u26A1",
|
|
126
|
+
tag = "Active",
|
|
127
|
+
onClick
|
|
128
|
+
}) => {
|
|
129
|
+
const [hovered, setHovered] = (0, import_react2.useState)(false);
|
|
130
|
+
return /* @__PURE__ */ import_react2.default.createElement(
|
|
131
|
+
"div",
|
|
132
|
+
{
|
|
133
|
+
onMouseEnter: () => setHovered(true),
|
|
134
|
+
onMouseLeave: () => setHovered(false),
|
|
135
|
+
onClick,
|
|
136
|
+
style: {
|
|
137
|
+
background: "#ffffff",
|
|
138
|
+
border: `0.5px solid ${hovered ? "#00000033" : "#0000001a"}`,
|
|
139
|
+
borderRadius: "12px",
|
|
140
|
+
padding: "1.25rem",
|
|
141
|
+
transition: "border-color 0.2s, transform 0.2s",
|
|
142
|
+
transform: hovered ? "translateY(-2px)" : "translateY(0)",
|
|
143
|
+
cursor: onClick ? "pointer" : "default",
|
|
144
|
+
position: "relative",
|
|
145
|
+
overflow: "hidden",
|
|
146
|
+
fontFamily: "sans-serif",
|
|
147
|
+
width: "260px"
|
|
148
|
+
}
|
|
149
|
+
},
|
|
150
|
+
/* @__PURE__ */ import_react2.default.createElement("div", { style: {
|
|
151
|
+
position: "absolute",
|
|
152
|
+
top: 0,
|
|
153
|
+
left: 0,
|
|
154
|
+
right: 0,
|
|
155
|
+
height: "3px",
|
|
156
|
+
background: "#1D9E75",
|
|
157
|
+
borderRadius: "12px 12px 0 0"
|
|
158
|
+
} }),
|
|
159
|
+
/* @__PURE__ */ import_react2.default.createElement("div", { style: {
|
|
160
|
+
width: 40,
|
|
161
|
+
height: 40,
|
|
162
|
+
borderRadius: 8,
|
|
163
|
+
background: "#E1F5EE",
|
|
164
|
+
display: "flex",
|
|
165
|
+
alignItems: "center",
|
|
166
|
+
justifyContent: "center",
|
|
167
|
+
fontSize: 18,
|
|
168
|
+
marginBottom: 14
|
|
169
|
+
} }, icon),
|
|
170
|
+
/* @__PURE__ */ import_react2.default.createElement("p", { style: { fontSize: 15, fontWeight: 700, color: "#111", margin: "0 0 6px" } }, title),
|
|
171
|
+
/* @__PURE__ */ import_react2.default.createElement("p", { style: { fontSize: 13, color: "#666", lineHeight: 1.6, margin: "0 0 16px" } }, description),
|
|
172
|
+
/* @__PURE__ */ import_react2.default.createElement("div", { style: {
|
|
173
|
+
display: "flex",
|
|
174
|
+
alignItems: "center",
|
|
175
|
+
justifyContent: "space-between",
|
|
176
|
+
borderTop: "0.5px solid #0000001a",
|
|
177
|
+
paddingTop: 12
|
|
178
|
+
} }, /* @__PURE__ */ import_react2.default.createElement("span", { style: {
|
|
179
|
+
fontSize: 11,
|
|
180
|
+
fontWeight: 500,
|
|
181
|
+
padding: "3px 9px",
|
|
182
|
+
borderRadius: 20,
|
|
183
|
+
background: "#E1F5EE",
|
|
184
|
+
color: "#0F6E56"
|
|
185
|
+
} }, tag), /* @__PURE__ */ import_react2.default.createElement("span", { style: {
|
|
186
|
+
fontSize: 14,
|
|
187
|
+
color: "#999",
|
|
188
|
+
display: "inline-block",
|
|
189
|
+
transition: "transform 0.2s",
|
|
190
|
+
transform: hovered ? "translateX(3px)" : "translateX(0)"
|
|
191
|
+
} }, "\u2192"))
|
|
192
|
+
);
|
|
193
|
+
};
|
|
194
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
195
|
+
0 && (module.exports = {
|
|
196
|
+
Button,
|
|
197
|
+
Card
|
|
198
|
+
});
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
// src/components/Button/Button.jsx
|
|
2
|
+
import React, { useState } from "react";
|
|
3
|
+
var Button = ({
|
|
4
|
+
text = "Click Me",
|
|
5
|
+
variant = "gradient",
|
|
6
|
+
// primary | outline | ghost | gradient
|
|
7
|
+
size = "md",
|
|
8
|
+
// sm | md | lg
|
|
9
|
+
icon,
|
|
10
|
+
loading = false,
|
|
11
|
+
disabled = false,
|
|
12
|
+
onClick
|
|
13
|
+
}) => {
|
|
14
|
+
const [hovered, setHovered] = useState(false);
|
|
15
|
+
const variants = {
|
|
16
|
+
primary: {
|
|
17
|
+
background: "#2563eb",
|
|
18
|
+
color: "#fff",
|
|
19
|
+
border: "none"
|
|
20
|
+
},
|
|
21
|
+
outline: {
|
|
22
|
+
background: "transparent",
|
|
23
|
+
color: "#2563eb",
|
|
24
|
+
border: "1px solid #2563eb"
|
|
25
|
+
},
|
|
26
|
+
ghost: {
|
|
27
|
+
background: "transparent",
|
|
28
|
+
color: "#111",
|
|
29
|
+
border: "none"
|
|
30
|
+
},
|
|
31
|
+
gradient: {
|
|
32
|
+
background: "linear-gradient(135deg, #6366f1, #06b6d4)",
|
|
33
|
+
color: "#fff",
|
|
34
|
+
border: "none"
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
const sizes = {
|
|
38
|
+
sm: { padding: "6px 12px", fontSize: "12px" },
|
|
39
|
+
md: { padding: "10px 18px", fontSize: "14px" },
|
|
40
|
+
lg: { padding: "14px 24px", fontSize: "16px" }
|
|
41
|
+
};
|
|
42
|
+
return /* @__PURE__ */ React.createElement(
|
|
43
|
+
"button",
|
|
44
|
+
{
|
|
45
|
+
onClick,
|
|
46
|
+
disabled: disabled || loading,
|
|
47
|
+
onMouseEnter: () => setHovered(true),
|
|
48
|
+
onMouseLeave: () => setHovered(false),
|
|
49
|
+
style: {
|
|
50
|
+
...variants[variant],
|
|
51
|
+
...sizes[size],
|
|
52
|
+
borderRadius: "10px",
|
|
53
|
+
cursor: disabled ? "not-allowed" : "pointer",
|
|
54
|
+
display: "flex",
|
|
55
|
+
alignItems: "center",
|
|
56
|
+
gap: "8px",
|
|
57
|
+
fontWeight: 600,
|
|
58
|
+
fontFamily: "sans-serif",
|
|
59
|
+
// 🔥 Animation
|
|
60
|
+
transform: hovered ? "translateY(-2px) scale(1.02)" : "scale(1)",
|
|
61
|
+
boxShadow: hovered ? "0 10px 20px rgba(0,0,0,0.15)" : "0 2px 6px rgba(0,0,0,0.1)",
|
|
62
|
+
transition: "all 0.2s ease",
|
|
63
|
+
opacity: disabled ? 0.6 : 1,
|
|
64
|
+
position: "relative",
|
|
65
|
+
overflow: "hidden"
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
/* @__PURE__ */ React.createElement(
|
|
69
|
+
"span",
|
|
70
|
+
{
|
|
71
|
+
style: {
|
|
72
|
+
position: "absolute",
|
|
73
|
+
inset: 0,
|
|
74
|
+
background: "rgba(255,255,255,0.2)",
|
|
75
|
+
opacity: hovered ? 1 : 0,
|
|
76
|
+
transition: "opacity 0.3s"
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
),
|
|
80
|
+
loading ? /* @__PURE__ */ React.createElement("span", null, "Loading...") : /* @__PURE__ */ React.createElement(React.Fragment, null, icon && /* @__PURE__ */ React.createElement("span", null, icon), /* @__PURE__ */ React.createElement("span", null, text))
|
|
81
|
+
);
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
// src/components/Card/Card.jsx
|
|
85
|
+
import React2, { useState as useState2 } from "react";
|
|
86
|
+
var Card = ({
|
|
87
|
+
title = "Performance",
|
|
88
|
+
description = "Real-time metrics with live dashboard updates every second.",
|
|
89
|
+
icon = "\u26A1",
|
|
90
|
+
tag = "Active",
|
|
91
|
+
onClick
|
|
92
|
+
}) => {
|
|
93
|
+
const [hovered, setHovered] = useState2(false);
|
|
94
|
+
return /* @__PURE__ */ React2.createElement(
|
|
95
|
+
"div",
|
|
96
|
+
{
|
|
97
|
+
onMouseEnter: () => setHovered(true),
|
|
98
|
+
onMouseLeave: () => setHovered(false),
|
|
99
|
+
onClick,
|
|
100
|
+
style: {
|
|
101
|
+
background: "#ffffff",
|
|
102
|
+
border: `0.5px solid ${hovered ? "#00000033" : "#0000001a"}`,
|
|
103
|
+
borderRadius: "12px",
|
|
104
|
+
padding: "1.25rem",
|
|
105
|
+
transition: "border-color 0.2s, transform 0.2s",
|
|
106
|
+
transform: hovered ? "translateY(-2px)" : "translateY(0)",
|
|
107
|
+
cursor: onClick ? "pointer" : "default",
|
|
108
|
+
position: "relative",
|
|
109
|
+
overflow: "hidden",
|
|
110
|
+
fontFamily: "sans-serif",
|
|
111
|
+
width: "260px"
|
|
112
|
+
}
|
|
113
|
+
},
|
|
114
|
+
/* @__PURE__ */ React2.createElement("div", { style: {
|
|
115
|
+
position: "absolute",
|
|
116
|
+
top: 0,
|
|
117
|
+
left: 0,
|
|
118
|
+
right: 0,
|
|
119
|
+
height: "3px",
|
|
120
|
+
background: "#1D9E75",
|
|
121
|
+
borderRadius: "12px 12px 0 0"
|
|
122
|
+
} }),
|
|
123
|
+
/* @__PURE__ */ React2.createElement("div", { style: {
|
|
124
|
+
width: 40,
|
|
125
|
+
height: 40,
|
|
126
|
+
borderRadius: 8,
|
|
127
|
+
background: "#E1F5EE",
|
|
128
|
+
display: "flex",
|
|
129
|
+
alignItems: "center",
|
|
130
|
+
justifyContent: "center",
|
|
131
|
+
fontSize: 18,
|
|
132
|
+
marginBottom: 14
|
|
133
|
+
} }, icon),
|
|
134
|
+
/* @__PURE__ */ React2.createElement("p", { style: { fontSize: 15, fontWeight: 700, color: "#111", margin: "0 0 6px" } }, title),
|
|
135
|
+
/* @__PURE__ */ React2.createElement("p", { style: { fontSize: 13, color: "#666", lineHeight: 1.6, margin: "0 0 16px" } }, description),
|
|
136
|
+
/* @__PURE__ */ React2.createElement("div", { style: {
|
|
137
|
+
display: "flex",
|
|
138
|
+
alignItems: "center",
|
|
139
|
+
justifyContent: "space-between",
|
|
140
|
+
borderTop: "0.5px solid #0000001a",
|
|
141
|
+
paddingTop: 12
|
|
142
|
+
} }, /* @__PURE__ */ React2.createElement("span", { style: {
|
|
143
|
+
fontSize: 11,
|
|
144
|
+
fontWeight: 500,
|
|
145
|
+
padding: "3px 9px",
|
|
146
|
+
borderRadius: 20,
|
|
147
|
+
background: "#E1F5EE",
|
|
148
|
+
color: "#0F6E56"
|
|
149
|
+
} }, tag), /* @__PURE__ */ React2.createElement("span", { style: {
|
|
150
|
+
fontSize: 14,
|
|
151
|
+
color: "#999",
|
|
152
|
+
display: "inline-block",
|
|
153
|
+
transition: "transform 0.2s",
|
|
154
|
+
transform: hovered ? "translateX(3px)" : "translateX(0)"
|
|
155
|
+
} }, "\u2192"))
|
|
156
|
+
);
|
|
157
|
+
};
|
|
158
|
+
export {
|
|
159
|
+
Button,
|
|
160
|
+
Card
|
|
161
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "surya-virtual-ui-lib",
|
|
3
|
+
"version": "1.0.81",
|
|
4
|
+
"description": "Virtual UI React Component Library",
|
|
5
|
+
"license": "ISC",
|
|
6
|
+
"author": "Surya",
|
|
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.3"
|
|
21
|
+
}
|
|
22
|
+
}
|