virtual-ui-lib 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,169 @@
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
+ Input: () => Input
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 = "Button",
42
+ bg = "#2563eb",
43
+ color = "white",
44
+ size = "md",
45
+ width = "auto",
46
+ radius = "6px",
47
+ border = "none",
48
+ weight = "500",
49
+ shadow = "none",
50
+ disabled = false,
51
+ loading = false,
52
+ icon = null,
53
+ onClick
54
+ }) => {
55
+ const sizes = {
56
+ sm: "6px 12px",
57
+ md: "8px 16px",
58
+ lg: "12px 20px"
59
+ };
60
+ return /* @__PURE__ */ import_react.default.createElement(
61
+ "button",
62
+ {
63
+ onClick,
64
+ disabled: disabled || loading,
65
+ style: {
66
+ background: bg,
67
+ color,
68
+ padding: sizes[size],
69
+ width,
70
+ border,
71
+ borderRadius: radius,
72
+ cursor: disabled ? "not-allowed" : "pointer",
73
+ fontWeight: weight,
74
+ boxShadow: shadow,
75
+ opacity: disabled ? 0.6 : 1,
76
+ display: "flex",
77
+ alignItems: "center",
78
+ gap: "6px",
79
+ justifyContent: "center"
80
+ }
81
+ },
82
+ loading ? "Loading..." : /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, icon, text)
83
+ );
84
+ };
85
+
86
+ // src/components/Card/Card.jsx
87
+ var import_react2 = __toESM(require("react"));
88
+ var Card = ({
89
+ title = "Card Title",
90
+ text = "Card description",
91
+ width = "250px",
92
+ bg = "white",
93
+ border = "1px solid #eee",
94
+ radius = "8px",
95
+ padding = "16px",
96
+ shadow = "0 2px 6px rgba(0,0,0,0.05)",
97
+ titleSize = "18px",
98
+ textSize = "14px",
99
+ align = "left",
100
+ children
101
+ }) => {
102
+ return /* @__PURE__ */ import_react2.default.createElement(
103
+ "div",
104
+ {
105
+ style: {
106
+ width,
107
+ background: bg,
108
+ border,
109
+ borderRadius: radius,
110
+ padding,
111
+ boxShadow: shadow,
112
+ textAlign: align
113
+ }
114
+ },
115
+ /* @__PURE__ */ import_react2.default.createElement("h3", { style: { fontSize: titleSize, marginBottom: "8px" } }, title),
116
+ /* @__PURE__ */ import_react2.default.createElement("p", { style: { fontSize: textSize, marginBottom: "10px" } }, text),
117
+ children
118
+ );
119
+ };
120
+
121
+ // src/components/Input/Input.jsx
122
+ var import_react3 = __toESM(require("react"));
123
+ var Input = ({
124
+ placeholder = "Enter text",
125
+ type = "text",
126
+ width = "200px",
127
+ bg = "white",
128
+ color = "#111",
129
+ border = "1px solid #ccc",
130
+ radius = "6px",
131
+ shadow = "none",
132
+ size = "md",
133
+ disabled = false,
134
+ value,
135
+ onChange
136
+ }) => {
137
+ const sizes = {
138
+ sm: "6px",
139
+ md: "8px",
140
+ lg: "12px"
141
+ };
142
+ return /* @__PURE__ */ import_react3.default.createElement(
143
+ "input",
144
+ {
145
+ type,
146
+ placeholder,
147
+ value,
148
+ onChange,
149
+ disabled,
150
+ style: {
151
+ width,
152
+ padding: sizes[size],
153
+ background: bg,
154
+ color,
155
+ border,
156
+ borderRadius: radius,
157
+ boxShadow: shadow,
158
+ outline: "none",
159
+ opacity: disabled ? 0.6 : 1
160
+ }
161
+ }
162
+ );
163
+ };
164
+ // Annotate the CommonJS export names for ESM import in node:
165
+ 0 && (module.exports = {
166
+ Button,
167
+ Card,
168
+ Input
169
+ });
package/dist/index.mjs ADDED
@@ -0,0 +1,131 @@
1
+ // src/components/Button/Button.jsx
2
+ import React from "react";
3
+ var Button = ({
4
+ text = "Button",
5
+ bg = "#2563eb",
6
+ color = "white",
7
+ size = "md",
8
+ width = "auto",
9
+ radius = "6px",
10
+ border = "none",
11
+ weight = "500",
12
+ shadow = "none",
13
+ disabled = false,
14
+ loading = false,
15
+ icon = null,
16
+ onClick
17
+ }) => {
18
+ const sizes = {
19
+ sm: "6px 12px",
20
+ md: "8px 16px",
21
+ lg: "12px 20px"
22
+ };
23
+ return /* @__PURE__ */ React.createElement(
24
+ "button",
25
+ {
26
+ onClick,
27
+ disabled: disabled || loading,
28
+ style: {
29
+ background: bg,
30
+ color,
31
+ padding: sizes[size],
32
+ width,
33
+ border,
34
+ borderRadius: radius,
35
+ cursor: disabled ? "not-allowed" : "pointer",
36
+ fontWeight: weight,
37
+ boxShadow: shadow,
38
+ opacity: disabled ? 0.6 : 1,
39
+ display: "flex",
40
+ alignItems: "center",
41
+ gap: "6px",
42
+ justifyContent: "center"
43
+ }
44
+ },
45
+ loading ? "Loading..." : /* @__PURE__ */ React.createElement(React.Fragment, null, icon, text)
46
+ );
47
+ };
48
+
49
+ // src/components/Card/Card.jsx
50
+ import React2 from "react";
51
+ var Card = ({
52
+ title = "Card Title",
53
+ text = "Card description",
54
+ width = "250px",
55
+ bg = "white",
56
+ border = "1px solid #eee",
57
+ radius = "8px",
58
+ padding = "16px",
59
+ shadow = "0 2px 6px rgba(0,0,0,0.05)",
60
+ titleSize = "18px",
61
+ textSize = "14px",
62
+ align = "left",
63
+ children
64
+ }) => {
65
+ return /* @__PURE__ */ React2.createElement(
66
+ "div",
67
+ {
68
+ style: {
69
+ width,
70
+ background: bg,
71
+ border,
72
+ borderRadius: radius,
73
+ padding,
74
+ boxShadow: shadow,
75
+ textAlign: align
76
+ }
77
+ },
78
+ /* @__PURE__ */ React2.createElement("h3", { style: { fontSize: titleSize, marginBottom: "8px" } }, title),
79
+ /* @__PURE__ */ React2.createElement("p", { style: { fontSize: textSize, marginBottom: "10px" } }, text),
80
+ children
81
+ );
82
+ };
83
+
84
+ // src/components/Input/Input.jsx
85
+ import React3 from "react";
86
+ var Input = ({
87
+ placeholder = "Enter text",
88
+ type = "text",
89
+ width = "200px",
90
+ bg = "white",
91
+ color = "#111",
92
+ border = "1px solid #ccc",
93
+ radius = "6px",
94
+ shadow = "none",
95
+ size = "md",
96
+ disabled = false,
97
+ value,
98
+ onChange
99
+ }) => {
100
+ const sizes = {
101
+ sm: "6px",
102
+ md: "8px",
103
+ lg: "12px"
104
+ };
105
+ return /* @__PURE__ */ React3.createElement(
106
+ "input",
107
+ {
108
+ type,
109
+ placeholder,
110
+ value,
111
+ onChange,
112
+ disabled,
113
+ style: {
114
+ width,
115
+ padding: sizes[size],
116
+ background: bg,
117
+ color,
118
+ border,
119
+ borderRadius: radius,
120
+ boxShadow: shadow,
121
+ outline: "none",
122
+ opacity: disabled ? 0.6 : 1
123
+ }
124
+ }
125
+ );
126
+ };
127
+ export {
128
+ Button,
129
+ Card,
130
+ Input
131
+ };
package/package.json ADDED
@@ -0,0 +1,22 @@
1
+ {
2
+ "name": "virtual-ui-lib",
3
+ "version": "1.0.0",
4
+ "description": "Virtual UI React Component Library",
5
+ "author": "Ankush",
6
+ "license": "ISC",
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": "^5.9.3"
21
+ }
22
+ }