levonx-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,257 @@
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 variantStyles = {
40
+ primary: {
41
+ background: "#534AB7",
42
+ color: "#fff",
43
+ border: "1.5px solid #3C3489"
44
+ },
45
+ secondary: {
46
+ background: "transparent",
47
+ color: "#534AB7",
48
+ border: "1.5px solid #534AB7"
49
+ },
50
+ danger: {
51
+ background: "#A32D2D",
52
+ color: "#fff",
53
+ border: "1.5px solid #791F1F"
54
+ },
55
+ ghost: {
56
+ background: "transparent",
57
+ color: "#333",
58
+ border: "1.5px solid #ccc"
59
+ }
60
+ };
61
+ var sizeStyles = {
62
+ sm: { padding: "6px 14px", fontSize: "13px", borderRadius: "6px" },
63
+ md: { padding: "9px 20px", fontSize: "15px", borderRadius: "8px" },
64
+ lg: { padding: "13px 28px", fontSize: "17px", borderRadius: "10px" }
65
+ };
66
+ var Button = ({
67
+ label = "Click me",
68
+ variant = "primary",
69
+ size = "md",
70
+ disabled = false,
71
+ fullWidth = false,
72
+ leftIcon = null,
73
+ rightIcon = null,
74
+ onClick = () => {
75
+ }
76
+ }) => {
77
+ const [hovered, setHovered] = (0, import_react.useState)(false);
78
+ const [active, setActive] = (0, import_react.useState)(false);
79
+ const baseStyle = {
80
+ display: "inline-flex",
81
+ alignItems: "center",
82
+ justifyContent: "center",
83
+ gap: "8px",
84
+ fontFamily: "inherit",
85
+ fontWeight: 500,
86
+ cursor: disabled ? "not-allowed" : "pointer",
87
+ opacity: disabled ? 0.45 : 1,
88
+ width: fullWidth ? "100%" : "auto",
89
+ outline: "none",
90
+ transition: "opacity 0.15s, transform 0.1s, background 0.15s",
91
+ transform: active && !disabled ? "scale(0.97)" : "scale(1)",
92
+ ...variantStyles[variant] || variantStyles.primary,
93
+ ...sizeStyles[size] || sizeStyles.md,
94
+ ...hovered && !disabled && variant === "primary" ? { background: "#3C3489" } : {},
95
+ ...hovered && !disabled && variant === "secondary" ? { background: "#EEEDFE" } : {},
96
+ ...hovered && !disabled && variant === "danger" ? { background: "#791F1F" } : {},
97
+ ...hovered && !disabled && variant === "ghost" ? { background: "#f3f3f3" } : {}
98
+ };
99
+ return /* @__PURE__ */ import_react.default.createElement(
100
+ "button",
101
+ {
102
+ style: baseStyle,
103
+ disabled,
104
+ onClick: !disabled ? onClick : void 0,
105
+ onMouseEnter: () => setHovered(true),
106
+ onMouseLeave: () => {
107
+ setHovered(false);
108
+ setActive(false);
109
+ },
110
+ onMouseDown: () => setActive(true),
111
+ onMouseUp: () => setActive(false)
112
+ },
113
+ leftIcon && /* @__PURE__ */ import_react.default.createElement("span", { style: { display: "flex", alignItems: "center" } }, leftIcon),
114
+ label,
115
+ rightIcon && /* @__PURE__ */ import_react.default.createElement("span", { style: { display: "flex", alignItems: "center" } }, rightIcon)
116
+ );
117
+ };
118
+
119
+ // src/components/Card/Card.jsx
120
+ var import_react2 = __toESM(require("react"));
121
+ var variantStyles2 = {
122
+ primary: {
123
+ background: "#534AB7",
124
+ color: "#fff",
125
+ border: "1.5px solid #3C3489"
126
+ },
127
+ secondary: {
128
+ background: "#fff",
129
+ color: "#534AB7",
130
+ border: "1.5px solid #534AB7"
131
+ },
132
+ danger: {
133
+ background: "#A32D2D",
134
+ color: "#fff",
135
+ border: "1.5px solid #791F1F"
136
+ },
137
+ ghost: {
138
+ background: "#fff",
139
+ color: "#333",
140
+ border: "1.5px solid #ccc"
141
+ }
142
+ };
143
+ var Card = ({
144
+ title = "Card Title",
145
+ variant = "primary",
146
+ description = "A short description of the card content goes here.",
147
+ tag = "Category",
148
+ tagColor = "#E6F1FB",
149
+ tagTextColor = "#185FA5",
150
+ accentColor = "#E6F1FB",
151
+ accentIcon = "\u{1F5BC}",
152
+ author = "Author Name",
153
+ authorInitials = "AU",
154
+ authorBg = "#EAF3DE",
155
+ authorColor = "#3B6D11",
156
+ date = "Apr 12",
157
+ width = "280px",
158
+ onClick,
159
+ className = ""
160
+ }) => {
161
+ const [hovered, setHovered] = (0, import_react2.useState)(false);
162
+ const currentVariant = variantStyles2[variant] || variantStyles2.primary;
163
+ const styles = {
164
+ card: {
165
+ width,
166
+ borderRadius: "12px",
167
+ border: hovered ? "1.5px solid #aaa" : currentVariant.border,
168
+ overflow: "hidden",
169
+ cursor: "pointer",
170
+ transition: "all 0.2s ease",
171
+ boxShadow: hovered ? "0 6px 18px rgba(0,0,0,0.1)" : "none",
172
+ backgroundColor: currentVariant.background,
173
+ fontFamily: "sans-serif"
174
+ },
175
+ imageArea: {
176
+ height: "140px",
177
+ backgroundColor: accentColor,
178
+ display: "flex",
179
+ alignItems: "center",
180
+ justifyContent: "center",
181
+ fontSize: "32px"
182
+ },
183
+ body: {
184
+ padding: "1rem 1.25rem"
185
+ },
186
+ tag: {
187
+ display: "inline-block",
188
+ fontSize: "11px",
189
+ fontWeight: "500",
190
+ backgroundColor: tagColor,
191
+ color: tagTextColor,
192
+ borderRadius: "4px",
193
+ padding: "2px 8px"
194
+ },
195
+ title: {
196
+ fontSize: "16px",
197
+ fontWeight: "600",
198
+ margin: "0.5rem 0 0.25rem",
199
+ color: variant === "primary" || variant === "danger" ? "#fff" : "#111"
200
+ },
201
+ description: {
202
+ fontSize: "14px",
203
+ color: variant === "primary" || variant === "danger" ? "#e0e0e0" : "#555",
204
+ margin: "0 0 1rem",
205
+ lineHeight: "1.6"
206
+ },
207
+ footer: {
208
+ borderTop: variant === "primary" || variant === "danger" ? "1px solid rgba(255,255,255,0.2)" : "1px solid #eee",
209
+ paddingTop: "0.75rem",
210
+ display: "flex",
211
+ alignItems: "center",
212
+ justifyContent: "space-between"
213
+ },
214
+ authorRow: {
215
+ display: "flex",
216
+ alignItems: "center",
217
+ gap: "8px"
218
+ },
219
+ avatar: {
220
+ width: "26px",
221
+ height: "26px",
222
+ borderRadius: "50%",
223
+ backgroundColor: authorBg,
224
+ display: "flex",
225
+ alignItems: "center",
226
+ justifyContent: "center",
227
+ fontSize: "11px",
228
+ fontWeight: "500",
229
+ color: authorColor
230
+ },
231
+ authorName: {
232
+ fontSize: "13px",
233
+ color: variant === "primary" || variant === "danger" ? "#ddd" : "#666"
234
+ },
235
+ date: {
236
+ fontSize: "12px",
237
+ color: variant === "primary" || variant === "danger" ? "#ccc" : "#999"
238
+ }
239
+ };
240
+ return /* @__PURE__ */ import_react2.default.createElement(
241
+ "div",
242
+ {
243
+ className,
244
+ style: styles.card,
245
+ onMouseEnter: () => setHovered(true),
246
+ onMouseLeave: () => setHovered(false),
247
+ onClick
248
+ },
249
+ /* @__PURE__ */ import_react2.default.createElement("div", { style: styles.imageArea }, accentIcon),
250
+ /* @__PURE__ */ import_react2.default.createElement("div", { style: styles.body }, /* @__PURE__ */ import_react2.default.createElement("span", { style: styles.tag }, tag), /* @__PURE__ */ import_react2.default.createElement("h3", { style: styles.title }, title), /* @__PURE__ */ import_react2.default.createElement("p", { style: styles.description }, description), /* @__PURE__ */ import_react2.default.createElement("div", { style: styles.footer }, /* @__PURE__ */ import_react2.default.createElement("div", { style: styles.authorRow }, /* @__PURE__ */ import_react2.default.createElement("div", { style: styles.avatar }, authorInitials), /* @__PURE__ */ import_react2.default.createElement("span", { style: styles.authorName }, author)), /* @__PURE__ */ import_react2.default.createElement("span", { style: styles.date }, date)))
251
+ );
252
+ };
253
+ // Annotate the CommonJS export names for ESM import in node:
254
+ 0 && (module.exports = {
255
+ Button,
256
+ Card
257
+ });
package/dist/index.mjs ADDED
@@ -0,0 +1,220 @@
1
+ // src/components/Button/Button.jsx
2
+ import React, { useState } from "react";
3
+ var variantStyles = {
4
+ primary: {
5
+ background: "#534AB7",
6
+ color: "#fff",
7
+ border: "1.5px solid #3C3489"
8
+ },
9
+ secondary: {
10
+ background: "transparent",
11
+ color: "#534AB7",
12
+ border: "1.5px solid #534AB7"
13
+ },
14
+ danger: {
15
+ background: "#A32D2D",
16
+ color: "#fff",
17
+ border: "1.5px solid #791F1F"
18
+ },
19
+ ghost: {
20
+ background: "transparent",
21
+ color: "#333",
22
+ border: "1.5px solid #ccc"
23
+ }
24
+ };
25
+ var sizeStyles = {
26
+ sm: { padding: "6px 14px", fontSize: "13px", borderRadius: "6px" },
27
+ md: { padding: "9px 20px", fontSize: "15px", borderRadius: "8px" },
28
+ lg: { padding: "13px 28px", fontSize: "17px", borderRadius: "10px" }
29
+ };
30
+ var Button = ({
31
+ label = "Click me",
32
+ variant = "primary",
33
+ size = "md",
34
+ disabled = false,
35
+ fullWidth = false,
36
+ leftIcon = null,
37
+ rightIcon = null,
38
+ onClick = () => {
39
+ }
40
+ }) => {
41
+ const [hovered, setHovered] = useState(false);
42
+ const [active, setActive] = useState(false);
43
+ const baseStyle = {
44
+ display: "inline-flex",
45
+ alignItems: "center",
46
+ justifyContent: "center",
47
+ gap: "8px",
48
+ fontFamily: "inherit",
49
+ fontWeight: 500,
50
+ cursor: disabled ? "not-allowed" : "pointer",
51
+ opacity: disabled ? 0.45 : 1,
52
+ width: fullWidth ? "100%" : "auto",
53
+ outline: "none",
54
+ transition: "opacity 0.15s, transform 0.1s, background 0.15s",
55
+ transform: active && !disabled ? "scale(0.97)" : "scale(1)",
56
+ ...variantStyles[variant] || variantStyles.primary,
57
+ ...sizeStyles[size] || sizeStyles.md,
58
+ ...hovered && !disabled && variant === "primary" ? { background: "#3C3489" } : {},
59
+ ...hovered && !disabled && variant === "secondary" ? { background: "#EEEDFE" } : {},
60
+ ...hovered && !disabled && variant === "danger" ? { background: "#791F1F" } : {},
61
+ ...hovered && !disabled && variant === "ghost" ? { background: "#f3f3f3" } : {}
62
+ };
63
+ return /* @__PURE__ */ React.createElement(
64
+ "button",
65
+ {
66
+ style: baseStyle,
67
+ disabled,
68
+ onClick: !disabled ? onClick : void 0,
69
+ onMouseEnter: () => setHovered(true),
70
+ onMouseLeave: () => {
71
+ setHovered(false);
72
+ setActive(false);
73
+ },
74
+ onMouseDown: () => setActive(true),
75
+ onMouseUp: () => setActive(false)
76
+ },
77
+ leftIcon && /* @__PURE__ */ React.createElement("span", { style: { display: "flex", alignItems: "center" } }, leftIcon),
78
+ label,
79
+ rightIcon && /* @__PURE__ */ React.createElement("span", { style: { display: "flex", alignItems: "center" } }, rightIcon)
80
+ );
81
+ };
82
+
83
+ // src/components/Card/Card.jsx
84
+ import React2, { useState as useState2 } from "react";
85
+ var variantStyles2 = {
86
+ primary: {
87
+ background: "#534AB7",
88
+ color: "#fff",
89
+ border: "1.5px solid #3C3489"
90
+ },
91
+ secondary: {
92
+ background: "#fff",
93
+ color: "#534AB7",
94
+ border: "1.5px solid #534AB7"
95
+ },
96
+ danger: {
97
+ background: "#A32D2D",
98
+ color: "#fff",
99
+ border: "1.5px solid #791F1F"
100
+ },
101
+ ghost: {
102
+ background: "#fff",
103
+ color: "#333",
104
+ border: "1.5px solid #ccc"
105
+ }
106
+ };
107
+ var Card = ({
108
+ title = "Card Title",
109
+ variant = "primary",
110
+ description = "A short description of the card content goes here.",
111
+ tag = "Category",
112
+ tagColor = "#E6F1FB",
113
+ tagTextColor = "#185FA5",
114
+ accentColor = "#E6F1FB",
115
+ accentIcon = "\u{1F5BC}",
116
+ author = "Author Name",
117
+ authorInitials = "AU",
118
+ authorBg = "#EAF3DE",
119
+ authorColor = "#3B6D11",
120
+ date = "Apr 12",
121
+ width = "280px",
122
+ onClick,
123
+ className = ""
124
+ }) => {
125
+ const [hovered, setHovered] = useState2(false);
126
+ const currentVariant = variantStyles2[variant] || variantStyles2.primary;
127
+ const styles = {
128
+ card: {
129
+ width,
130
+ borderRadius: "12px",
131
+ border: hovered ? "1.5px solid #aaa" : currentVariant.border,
132
+ overflow: "hidden",
133
+ cursor: "pointer",
134
+ transition: "all 0.2s ease",
135
+ boxShadow: hovered ? "0 6px 18px rgba(0,0,0,0.1)" : "none",
136
+ backgroundColor: currentVariant.background,
137
+ fontFamily: "sans-serif"
138
+ },
139
+ imageArea: {
140
+ height: "140px",
141
+ backgroundColor: accentColor,
142
+ display: "flex",
143
+ alignItems: "center",
144
+ justifyContent: "center",
145
+ fontSize: "32px"
146
+ },
147
+ body: {
148
+ padding: "1rem 1.25rem"
149
+ },
150
+ tag: {
151
+ display: "inline-block",
152
+ fontSize: "11px",
153
+ fontWeight: "500",
154
+ backgroundColor: tagColor,
155
+ color: tagTextColor,
156
+ borderRadius: "4px",
157
+ padding: "2px 8px"
158
+ },
159
+ title: {
160
+ fontSize: "16px",
161
+ fontWeight: "600",
162
+ margin: "0.5rem 0 0.25rem",
163
+ color: variant === "primary" || variant === "danger" ? "#fff" : "#111"
164
+ },
165
+ description: {
166
+ fontSize: "14px",
167
+ color: variant === "primary" || variant === "danger" ? "#e0e0e0" : "#555",
168
+ margin: "0 0 1rem",
169
+ lineHeight: "1.6"
170
+ },
171
+ footer: {
172
+ borderTop: variant === "primary" || variant === "danger" ? "1px solid rgba(255,255,255,0.2)" : "1px solid #eee",
173
+ paddingTop: "0.75rem",
174
+ display: "flex",
175
+ alignItems: "center",
176
+ justifyContent: "space-between"
177
+ },
178
+ authorRow: {
179
+ display: "flex",
180
+ alignItems: "center",
181
+ gap: "8px"
182
+ },
183
+ avatar: {
184
+ width: "26px",
185
+ height: "26px",
186
+ borderRadius: "50%",
187
+ backgroundColor: authorBg,
188
+ display: "flex",
189
+ alignItems: "center",
190
+ justifyContent: "center",
191
+ fontSize: "11px",
192
+ fontWeight: "500",
193
+ color: authorColor
194
+ },
195
+ authorName: {
196
+ fontSize: "13px",
197
+ color: variant === "primary" || variant === "danger" ? "#ddd" : "#666"
198
+ },
199
+ date: {
200
+ fontSize: "12px",
201
+ color: variant === "primary" || variant === "danger" ? "#ccc" : "#999"
202
+ }
203
+ };
204
+ return /* @__PURE__ */ React2.createElement(
205
+ "div",
206
+ {
207
+ className,
208
+ style: styles.card,
209
+ onMouseEnter: () => setHovered(true),
210
+ onMouseLeave: () => setHovered(false),
211
+ onClick
212
+ },
213
+ /* @__PURE__ */ React2.createElement("div", { style: styles.imageArea }, accentIcon),
214
+ /* @__PURE__ */ React2.createElement("div", { style: styles.body }, /* @__PURE__ */ React2.createElement("span", { style: styles.tag }, tag), /* @__PURE__ */ React2.createElement("h3", { style: styles.title }, title), /* @__PURE__ */ React2.createElement("p", { style: styles.description }, description), /* @__PURE__ */ React2.createElement("div", { style: styles.footer }, /* @__PURE__ */ React2.createElement("div", { style: styles.authorRow }, /* @__PURE__ */ React2.createElement("div", { style: styles.avatar }, authorInitials), /* @__PURE__ */ React2.createElement("span", { style: styles.authorName }, author)), /* @__PURE__ */ React2.createElement("span", { style: styles.date }, date)))
215
+ );
216
+ };
217
+ export {
218
+ Button,
219
+ Card
220
+ };
package/package.json ADDED
@@ -0,0 +1,21 @@
1
+ {
2
+ "name": "levonx-lib",
3
+ "version": "1.0.0",
4
+ "description": "LevonX UI React Component Library",
5
+ "license": "ISC",
6
+ "author": "labhamsharma",
7
+
8
+ "main": "dist/index.js",
9
+ "module": "dist/index.mjs",
10
+ "files":["dist"],
11
+ "scripts": {
12
+ "build": "tsup"
13
+ },
14
+ "peerDependencies": {
15
+ "react":">=18"
16
+ },
17
+ "devDependencies": {
18
+ "tsup": "^8.5.1",
19
+ "typescript": "^6.0.2"
20
+ }
21
+ }