virtual-ui-library01 1.0.1 → 1.0.3
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 +214 -0
- package/dist/index.mjs +176 -0
- package/package.json +1 -1
package/dist/index.js
ADDED
|
@@ -0,0 +1,214 @@
|
|
|
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
|
+
ProfileCard: () => ProfileCard
|
|
35
|
+
});
|
|
36
|
+
module.exports = __toCommonJS(index_exports);
|
|
37
|
+
|
|
38
|
+
// src/components/Button/Button.jsx
|
|
39
|
+
var import_react = __toESM(require("react"));
|
|
40
|
+
var Button = ({
|
|
41
|
+
text = "Click Me",
|
|
42
|
+
bgColor = "#4f46e5",
|
|
43
|
+
hoverColor = "#4338ca",
|
|
44
|
+
textColor = "#ffffff",
|
|
45
|
+
size = "medium",
|
|
46
|
+
onClick = () => {
|
|
47
|
+
}
|
|
48
|
+
}) => {
|
|
49
|
+
const [isHovered, setIsHovered] = (0, import_react.useState)(false);
|
|
50
|
+
const sizeStyles = {
|
|
51
|
+
small: { padding: "6px 12px", fontSize: "12px" },
|
|
52
|
+
medium: { padding: "10px 20px", fontSize: "14px" },
|
|
53
|
+
large: { padding: "14px 28px", fontSize: "16px" }
|
|
54
|
+
};
|
|
55
|
+
const styles = {
|
|
56
|
+
backgroundColor: isHovered ? hoverColor : bgColor,
|
|
57
|
+
color: textColor,
|
|
58
|
+
border: "none",
|
|
59
|
+
borderRadius: "8px",
|
|
60
|
+
cursor: "pointer",
|
|
61
|
+
fontWeight: 600,
|
|
62
|
+
transition: "background-color 0.2s ease, transform 0.15s ease",
|
|
63
|
+
transform: isHovered ? "translateY(-1px)" : "translateY(0)",
|
|
64
|
+
...sizeStyles[size] || sizeStyles.medium
|
|
65
|
+
};
|
|
66
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
67
|
+
"button",
|
|
68
|
+
{
|
|
69
|
+
style: styles,
|
|
70
|
+
onClick,
|
|
71
|
+
onMouseEnter: () => setIsHovered(true),
|
|
72
|
+
onMouseLeave: () => setIsHovered(false)
|
|
73
|
+
},
|
|
74
|
+
text
|
|
75
|
+
);
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
// src/components/Card/Card.jsx
|
|
79
|
+
var import_react2 = __toESM(require("react"));
|
|
80
|
+
var Card = ({
|
|
81
|
+
title = "Card Title",
|
|
82
|
+
description = "This is a short card description.",
|
|
83
|
+
bgColor = "#ffffff",
|
|
84
|
+
hoverBgColor = "#f9fafb",
|
|
85
|
+
borderColor = "#e5e7eb",
|
|
86
|
+
textColor = "#111827",
|
|
87
|
+
size = "medium",
|
|
88
|
+
imageUrl = ""
|
|
89
|
+
}) => {
|
|
90
|
+
const [isHovered, setIsHovered] = (0, import_react2.useState)(false);
|
|
91
|
+
const sizeStyles = {
|
|
92
|
+
small: { width: "220px", padding: "12px" },
|
|
93
|
+
medium: { width: "300px", padding: "18px" },
|
|
94
|
+
large: { width: "380px", padding: "24px" }
|
|
95
|
+
};
|
|
96
|
+
const styles = {
|
|
97
|
+
backgroundColor: isHovered ? hoverBgColor : bgColor,
|
|
98
|
+
border: `1px solid ${borderColor}`,
|
|
99
|
+
borderRadius: "12px",
|
|
100
|
+
boxShadow: isHovered ? "0 8px 20px rgba(0,0,0,0.12)" : "0 2px 6px rgba(0,0,0,0.06)",
|
|
101
|
+
transform: isHovered ? "translateY(-4px)" : "translateY(0)",
|
|
102
|
+
transition: "all 0.2s ease",
|
|
103
|
+
cursor: "pointer",
|
|
104
|
+
...sizeStyles[size] || sizeStyles.medium
|
|
105
|
+
};
|
|
106
|
+
return /* @__PURE__ */ import_react2.default.createElement(
|
|
107
|
+
"div",
|
|
108
|
+
{
|
|
109
|
+
style: styles,
|
|
110
|
+
onMouseEnter: () => setIsHovered(true),
|
|
111
|
+
onMouseLeave: () => setIsHovered(false)
|
|
112
|
+
},
|
|
113
|
+
imageUrl && /* @__PURE__ */ import_react2.default.createElement(
|
|
114
|
+
"img",
|
|
115
|
+
{
|
|
116
|
+
src: imageUrl,
|
|
117
|
+
alt: title,
|
|
118
|
+
style: {
|
|
119
|
+
width: "100%",
|
|
120
|
+
height: "140px",
|
|
121
|
+
objectFit: "cover",
|
|
122
|
+
borderRadius: "8px",
|
|
123
|
+
marginBottom: "12px"
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
),
|
|
127
|
+
/* @__PURE__ */ import_react2.default.createElement("h3", { style: { margin: "0 0 8px 0", color: textColor, fontSize: "18px" } }, title),
|
|
128
|
+
/* @__PURE__ */ import_react2.default.createElement("p", { style: { margin: 0, color: textColor, opacity: 0.75, fontSize: "14px", lineHeight: 1.5 } }, description)
|
|
129
|
+
);
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
// src/components/ProfileCard/profilecard.jsx
|
|
133
|
+
var import_react3 = __toESM(require("react"));
|
|
134
|
+
var ProfileCard = ({
|
|
135
|
+
name = "Jane Doe",
|
|
136
|
+
role = "Product Designer",
|
|
137
|
+
bio = "Passionate about crafting delightful user experiences.",
|
|
138
|
+
avatarUrl = "https://i.pravatar.cc/150",
|
|
139
|
+
bgColor = "#ffffff",
|
|
140
|
+
accentColor = "#4f46e5",
|
|
141
|
+
textColor = "#111827",
|
|
142
|
+
size = "medium",
|
|
143
|
+
onFollow = () => {
|
|
144
|
+
}
|
|
145
|
+
}) => {
|
|
146
|
+
const [isHovered, setIsHovered] = (0, import_react3.useState)(false);
|
|
147
|
+
const [isFollowing, setIsFollowing] = (0, import_react3.useState)(false);
|
|
148
|
+
const sizeStyles = {
|
|
149
|
+
small: { width: "220px", padding: "16px", avatar: "60px" },
|
|
150
|
+
medium: { width: "280px", padding: "22px", avatar: "80px" },
|
|
151
|
+
large: { width: "340px", padding: "28px", avatar: "100px" }
|
|
152
|
+
};
|
|
153
|
+
const currentSize = sizeStyles[size] || sizeStyles.medium;
|
|
154
|
+
const cardStyle = {
|
|
155
|
+
width: currentSize.width,
|
|
156
|
+
padding: currentSize.padding,
|
|
157
|
+
backgroundColor: bgColor,
|
|
158
|
+
borderRadius: "16px",
|
|
159
|
+
boxShadow: isHovered ? "0 10px 24px rgba(0,0,0,0.14)" : "0 2px 8px rgba(0,0,0,0.08)",
|
|
160
|
+
transform: isHovered ? "translateY(-4px)" : "translateY(0)",
|
|
161
|
+
transition: "all 0.25s ease",
|
|
162
|
+
textAlign: "center",
|
|
163
|
+
fontFamily: "sans-serif"
|
|
164
|
+
};
|
|
165
|
+
const buttonStyle = {
|
|
166
|
+
marginTop: "14px",
|
|
167
|
+
padding: "8px 20px",
|
|
168
|
+
borderRadius: "20px",
|
|
169
|
+
border: "none",
|
|
170
|
+
cursor: "pointer",
|
|
171
|
+
fontWeight: 600,
|
|
172
|
+
fontSize: "13px",
|
|
173
|
+
color: isFollowing ? accentColor : "#ffffff",
|
|
174
|
+
backgroundColor: isFollowing ? "#ffffff" : accentColor,
|
|
175
|
+
border: `2px solid ${accentColor}`,
|
|
176
|
+
transition: "all 0.2s ease"
|
|
177
|
+
};
|
|
178
|
+
const handleFollow = () => {
|
|
179
|
+
setIsFollowing((prev) => !prev);
|
|
180
|
+
onFollow(!isFollowing);
|
|
181
|
+
};
|
|
182
|
+
return /* @__PURE__ */ import_react3.default.createElement(
|
|
183
|
+
"div",
|
|
184
|
+
{
|
|
185
|
+
style: cardStyle,
|
|
186
|
+
onMouseEnter: () => setIsHovered(true),
|
|
187
|
+
onMouseLeave: () => setIsHovered(false)
|
|
188
|
+
},
|
|
189
|
+
/* @__PURE__ */ import_react3.default.createElement(
|
|
190
|
+
"img",
|
|
191
|
+
{
|
|
192
|
+
src: avatarUrl,
|
|
193
|
+
alt: name,
|
|
194
|
+
style: {
|
|
195
|
+
width: currentSize.avatar,
|
|
196
|
+
height: currentSize.avatar,
|
|
197
|
+
borderRadius: "50%",
|
|
198
|
+
objectFit: "cover",
|
|
199
|
+
border: `3px solid ${accentColor}`
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
),
|
|
203
|
+
/* @__PURE__ */ import_react3.default.createElement("h3", { style: { margin: "12px 0 2px 0", color: textColor, fontSize: "17px" } }, name),
|
|
204
|
+
/* @__PURE__ */ import_react3.default.createElement("p", { style: { margin: "0 0 8px 0", color: accentColor, fontSize: "13px", fontWeight: 600 } }, role),
|
|
205
|
+
/* @__PURE__ */ import_react3.default.createElement("p", { style: { margin: 0, color: textColor, opacity: 0.7, fontSize: "13px", lineHeight: 1.5 } }, bio),
|
|
206
|
+
/* @__PURE__ */ import_react3.default.createElement("button", { style: buttonStyle, onClick: handleFollow }, isFollowing ? "Following" : "Follow")
|
|
207
|
+
);
|
|
208
|
+
};
|
|
209
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
210
|
+
0 && (module.exports = {
|
|
211
|
+
Button,
|
|
212
|
+
Card,
|
|
213
|
+
ProfileCard
|
|
214
|
+
});
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
// src/components/Button/Button.jsx
|
|
2
|
+
import React, { useState } from "react";
|
|
3
|
+
var Button = ({
|
|
4
|
+
text = "Click Me",
|
|
5
|
+
bgColor = "#4f46e5",
|
|
6
|
+
hoverColor = "#4338ca",
|
|
7
|
+
textColor = "#ffffff",
|
|
8
|
+
size = "medium",
|
|
9
|
+
onClick = () => {
|
|
10
|
+
}
|
|
11
|
+
}) => {
|
|
12
|
+
const [isHovered, setIsHovered] = useState(false);
|
|
13
|
+
const sizeStyles = {
|
|
14
|
+
small: { padding: "6px 12px", fontSize: "12px" },
|
|
15
|
+
medium: { padding: "10px 20px", fontSize: "14px" },
|
|
16
|
+
large: { padding: "14px 28px", fontSize: "16px" }
|
|
17
|
+
};
|
|
18
|
+
const styles = {
|
|
19
|
+
backgroundColor: isHovered ? hoverColor : bgColor,
|
|
20
|
+
color: textColor,
|
|
21
|
+
border: "none",
|
|
22
|
+
borderRadius: "8px",
|
|
23
|
+
cursor: "pointer",
|
|
24
|
+
fontWeight: 600,
|
|
25
|
+
transition: "background-color 0.2s ease, transform 0.15s ease",
|
|
26
|
+
transform: isHovered ? "translateY(-1px)" : "translateY(0)",
|
|
27
|
+
...sizeStyles[size] || sizeStyles.medium
|
|
28
|
+
};
|
|
29
|
+
return /* @__PURE__ */ React.createElement(
|
|
30
|
+
"button",
|
|
31
|
+
{
|
|
32
|
+
style: styles,
|
|
33
|
+
onClick,
|
|
34
|
+
onMouseEnter: () => setIsHovered(true),
|
|
35
|
+
onMouseLeave: () => setIsHovered(false)
|
|
36
|
+
},
|
|
37
|
+
text
|
|
38
|
+
);
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
// src/components/Card/Card.jsx
|
|
42
|
+
import React2, { useState as useState2 } from "react";
|
|
43
|
+
var Card = ({
|
|
44
|
+
title = "Card Title",
|
|
45
|
+
description = "This is a short card description.",
|
|
46
|
+
bgColor = "#ffffff",
|
|
47
|
+
hoverBgColor = "#f9fafb",
|
|
48
|
+
borderColor = "#e5e7eb",
|
|
49
|
+
textColor = "#111827",
|
|
50
|
+
size = "medium",
|
|
51
|
+
imageUrl = ""
|
|
52
|
+
}) => {
|
|
53
|
+
const [isHovered, setIsHovered] = useState2(false);
|
|
54
|
+
const sizeStyles = {
|
|
55
|
+
small: { width: "220px", padding: "12px" },
|
|
56
|
+
medium: { width: "300px", padding: "18px" },
|
|
57
|
+
large: { width: "380px", padding: "24px" }
|
|
58
|
+
};
|
|
59
|
+
const styles = {
|
|
60
|
+
backgroundColor: isHovered ? hoverBgColor : bgColor,
|
|
61
|
+
border: `1px solid ${borderColor}`,
|
|
62
|
+
borderRadius: "12px",
|
|
63
|
+
boxShadow: isHovered ? "0 8px 20px rgba(0,0,0,0.12)" : "0 2px 6px rgba(0,0,0,0.06)",
|
|
64
|
+
transform: isHovered ? "translateY(-4px)" : "translateY(0)",
|
|
65
|
+
transition: "all 0.2s ease",
|
|
66
|
+
cursor: "pointer",
|
|
67
|
+
...sizeStyles[size] || sizeStyles.medium
|
|
68
|
+
};
|
|
69
|
+
return /* @__PURE__ */ React2.createElement(
|
|
70
|
+
"div",
|
|
71
|
+
{
|
|
72
|
+
style: styles,
|
|
73
|
+
onMouseEnter: () => setIsHovered(true),
|
|
74
|
+
onMouseLeave: () => setIsHovered(false)
|
|
75
|
+
},
|
|
76
|
+
imageUrl && /* @__PURE__ */ React2.createElement(
|
|
77
|
+
"img",
|
|
78
|
+
{
|
|
79
|
+
src: imageUrl,
|
|
80
|
+
alt: title,
|
|
81
|
+
style: {
|
|
82
|
+
width: "100%",
|
|
83
|
+
height: "140px",
|
|
84
|
+
objectFit: "cover",
|
|
85
|
+
borderRadius: "8px",
|
|
86
|
+
marginBottom: "12px"
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
),
|
|
90
|
+
/* @__PURE__ */ React2.createElement("h3", { style: { margin: "0 0 8px 0", color: textColor, fontSize: "18px" } }, title),
|
|
91
|
+
/* @__PURE__ */ React2.createElement("p", { style: { margin: 0, color: textColor, opacity: 0.75, fontSize: "14px", lineHeight: 1.5 } }, description)
|
|
92
|
+
);
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
// src/components/ProfileCard/profilecard.jsx
|
|
96
|
+
import React3, { useState as useState3 } from "react";
|
|
97
|
+
var ProfileCard = ({
|
|
98
|
+
name = "Jane Doe",
|
|
99
|
+
role = "Product Designer",
|
|
100
|
+
bio = "Passionate about crafting delightful user experiences.",
|
|
101
|
+
avatarUrl = "https://i.pravatar.cc/150",
|
|
102
|
+
bgColor = "#ffffff",
|
|
103
|
+
accentColor = "#4f46e5",
|
|
104
|
+
textColor = "#111827",
|
|
105
|
+
size = "medium",
|
|
106
|
+
onFollow = () => {
|
|
107
|
+
}
|
|
108
|
+
}) => {
|
|
109
|
+
const [isHovered, setIsHovered] = useState3(false);
|
|
110
|
+
const [isFollowing, setIsFollowing] = useState3(false);
|
|
111
|
+
const sizeStyles = {
|
|
112
|
+
small: { width: "220px", padding: "16px", avatar: "60px" },
|
|
113
|
+
medium: { width: "280px", padding: "22px", avatar: "80px" },
|
|
114
|
+
large: { width: "340px", padding: "28px", avatar: "100px" }
|
|
115
|
+
};
|
|
116
|
+
const currentSize = sizeStyles[size] || sizeStyles.medium;
|
|
117
|
+
const cardStyle = {
|
|
118
|
+
width: currentSize.width,
|
|
119
|
+
padding: currentSize.padding,
|
|
120
|
+
backgroundColor: bgColor,
|
|
121
|
+
borderRadius: "16px",
|
|
122
|
+
boxShadow: isHovered ? "0 10px 24px rgba(0,0,0,0.14)" : "0 2px 8px rgba(0,0,0,0.08)",
|
|
123
|
+
transform: isHovered ? "translateY(-4px)" : "translateY(0)",
|
|
124
|
+
transition: "all 0.25s ease",
|
|
125
|
+
textAlign: "center",
|
|
126
|
+
fontFamily: "sans-serif"
|
|
127
|
+
};
|
|
128
|
+
const buttonStyle = {
|
|
129
|
+
marginTop: "14px",
|
|
130
|
+
padding: "8px 20px",
|
|
131
|
+
borderRadius: "20px",
|
|
132
|
+
border: "none",
|
|
133
|
+
cursor: "pointer",
|
|
134
|
+
fontWeight: 600,
|
|
135
|
+
fontSize: "13px",
|
|
136
|
+
color: isFollowing ? accentColor : "#ffffff",
|
|
137
|
+
backgroundColor: isFollowing ? "#ffffff" : accentColor,
|
|
138
|
+
border: `2px solid ${accentColor}`,
|
|
139
|
+
transition: "all 0.2s ease"
|
|
140
|
+
};
|
|
141
|
+
const handleFollow = () => {
|
|
142
|
+
setIsFollowing((prev) => !prev);
|
|
143
|
+
onFollow(!isFollowing);
|
|
144
|
+
};
|
|
145
|
+
return /* @__PURE__ */ React3.createElement(
|
|
146
|
+
"div",
|
|
147
|
+
{
|
|
148
|
+
style: cardStyle,
|
|
149
|
+
onMouseEnter: () => setIsHovered(true),
|
|
150
|
+
onMouseLeave: () => setIsHovered(false)
|
|
151
|
+
},
|
|
152
|
+
/* @__PURE__ */ React3.createElement(
|
|
153
|
+
"img",
|
|
154
|
+
{
|
|
155
|
+
src: avatarUrl,
|
|
156
|
+
alt: name,
|
|
157
|
+
style: {
|
|
158
|
+
width: currentSize.avatar,
|
|
159
|
+
height: currentSize.avatar,
|
|
160
|
+
borderRadius: "50%",
|
|
161
|
+
objectFit: "cover",
|
|
162
|
+
border: `3px solid ${accentColor}`
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
),
|
|
166
|
+
/* @__PURE__ */ React3.createElement("h3", { style: { margin: "12px 0 2px 0", color: textColor, fontSize: "17px" } }, name),
|
|
167
|
+
/* @__PURE__ */ React3.createElement("p", { style: { margin: "0 0 8px 0", color: accentColor, fontSize: "13px", fontWeight: 600 } }, role),
|
|
168
|
+
/* @__PURE__ */ React3.createElement("p", { style: { margin: 0, color: textColor, opacity: 0.7, fontSize: "13px", lineHeight: 1.5 } }, bio),
|
|
169
|
+
/* @__PURE__ */ React3.createElement("button", { style: buttonStyle, onClick: handleFollow }, isFollowing ? "Following" : "Follow")
|
|
170
|
+
);
|
|
171
|
+
};
|
|
172
|
+
export {
|
|
173
|
+
Button,
|
|
174
|
+
Card,
|
|
175
|
+
ProfileCard
|
|
176
|
+
};
|