nova-ai-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 +138 -0
- package/dist/index.mjs +101 -0
- package/package.json +23 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,138 @@
|
|
|
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
|
+
bgColor = "#4f46e5",
|
|
42
|
+
hoverColor = "#4338ca",
|
|
43
|
+
textColor = "#ffffff",
|
|
44
|
+
size = "medium",
|
|
45
|
+
onClick = () => {
|
|
46
|
+
}
|
|
47
|
+
}) => {
|
|
48
|
+
const [isHovered, setIsHovered] = (0, import_react.useState)(false);
|
|
49
|
+
const sizeStyles = {
|
|
50
|
+
small: { padding: "6px 12px", fontSize: "12px" },
|
|
51
|
+
medium: { padding: "10px 20px", fontSize: "14px" },
|
|
52
|
+
large: { padding: "14px 28px", fontSize: "16px" }
|
|
53
|
+
};
|
|
54
|
+
const style = {
|
|
55
|
+
backgroundColor: isHovered ? hoverColor : bgColor,
|
|
56
|
+
color: textColor,
|
|
57
|
+
border: "none",
|
|
58
|
+
borderRadius: "6px",
|
|
59
|
+
cursor: "pointer",
|
|
60
|
+
fontWeight: 600,
|
|
61
|
+
transition: "background-color 0.2s ease, transform 0.1s ease",
|
|
62
|
+
transform: isHovered ? "translateY(-1px)" : "translateY(0)",
|
|
63
|
+
...sizeStyles[size]
|
|
64
|
+
};
|
|
65
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
66
|
+
"button",
|
|
67
|
+
{
|
|
68
|
+
style,
|
|
69
|
+
onClick,
|
|
70
|
+
onMouseEnter: () => setIsHovered(true),
|
|
71
|
+
onMouseLeave: () => setIsHovered(false)
|
|
72
|
+
},
|
|
73
|
+
text
|
|
74
|
+
);
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
// src/components/Card/Card.jsx
|
|
78
|
+
var import_react2 = __toESM(require("react"));
|
|
79
|
+
var Card = ({
|
|
80
|
+
title = "Card Title",
|
|
81
|
+
description = "This is a simple reusable card component description.",
|
|
82
|
+
imageUrl = "https://via.placeholder.com/300x180",
|
|
83
|
+
bgColor = "#ffffff",
|
|
84
|
+
textColor = "#1f2937",
|
|
85
|
+
accentColor = "#4f46e5",
|
|
86
|
+
width = "300px"
|
|
87
|
+
}) => {
|
|
88
|
+
const [isHovered, setIsHovered] = (0, import_react2.useState)(false);
|
|
89
|
+
const cardStyle = {
|
|
90
|
+
width,
|
|
91
|
+
backgroundColor: bgColor,
|
|
92
|
+
color: textColor,
|
|
93
|
+
borderRadius: "10px",
|
|
94
|
+
overflow: "hidden",
|
|
95
|
+
boxShadow: isHovered ? "0 10px 20px rgba(0,0,0,0.15)" : "0 4px 10px rgba(0,0,0,0.08)",
|
|
96
|
+
transform: isHovered ? "translateY(-4px)" : "translateY(0)",
|
|
97
|
+
transition: "all 0.25s ease",
|
|
98
|
+
fontFamily: "sans-serif",
|
|
99
|
+
cursor: "pointer"
|
|
100
|
+
};
|
|
101
|
+
const imageStyle = {
|
|
102
|
+
width: "100%",
|
|
103
|
+
height: "180px",
|
|
104
|
+
objectFit: "cover",
|
|
105
|
+
display: "block"
|
|
106
|
+
};
|
|
107
|
+
const bodyStyle = {
|
|
108
|
+
padding: "16px"
|
|
109
|
+
};
|
|
110
|
+
const titleStyle = {
|
|
111
|
+
margin: "0 0 8px 0",
|
|
112
|
+
fontSize: "18px",
|
|
113
|
+
fontWeight: 700,
|
|
114
|
+
color: accentColor
|
|
115
|
+
};
|
|
116
|
+
const descStyle = {
|
|
117
|
+
margin: 0,
|
|
118
|
+
fontSize: "14px",
|
|
119
|
+
lineHeight: 1.5,
|
|
120
|
+
color: textColor,
|
|
121
|
+
opacity: 0.85
|
|
122
|
+
};
|
|
123
|
+
return /* @__PURE__ */ import_react2.default.createElement(
|
|
124
|
+
"div",
|
|
125
|
+
{
|
|
126
|
+
style: cardStyle,
|
|
127
|
+
onMouseEnter: () => setIsHovered(true),
|
|
128
|
+
onMouseLeave: () => setIsHovered(false)
|
|
129
|
+
},
|
|
130
|
+
/* @__PURE__ */ import_react2.default.createElement("img", { src: imageUrl, alt: title, style: imageStyle }),
|
|
131
|
+
/* @__PURE__ */ import_react2.default.createElement("div", { style: bodyStyle }, /* @__PURE__ */ import_react2.default.createElement("h3", { style: titleStyle }, title), /* @__PURE__ */ import_react2.default.createElement("p", { style: descStyle }, description))
|
|
132
|
+
);
|
|
133
|
+
};
|
|
134
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
135
|
+
0 && (module.exports = {
|
|
136
|
+
Button,
|
|
137
|
+
Card
|
|
138
|
+
});
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,101 @@
|
|
|
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 style = {
|
|
19
|
+
backgroundColor: isHovered ? hoverColor : bgColor,
|
|
20
|
+
color: textColor,
|
|
21
|
+
border: "none",
|
|
22
|
+
borderRadius: "6px",
|
|
23
|
+
cursor: "pointer",
|
|
24
|
+
fontWeight: 600,
|
|
25
|
+
transition: "background-color 0.2s ease, transform 0.1s ease",
|
|
26
|
+
transform: isHovered ? "translateY(-1px)" : "translateY(0)",
|
|
27
|
+
...sizeStyles[size]
|
|
28
|
+
};
|
|
29
|
+
return /* @__PURE__ */ React.createElement(
|
|
30
|
+
"button",
|
|
31
|
+
{
|
|
32
|
+
style,
|
|
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 simple reusable card component description.",
|
|
46
|
+
imageUrl = "https://via.placeholder.com/300x180",
|
|
47
|
+
bgColor = "#ffffff",
|
|
48
|
+
textColor = "#1f2937",
|
|
49
|
+
accentColor = "#4f46e5",
|
|
50
|
+
width = "300px"
|
|
51
|
+
}) => {
|
|
52
|
+
const [isHovered, setIsHovered] = useState2(false);
|
|
53
|
+
const cardStyle = {
|
|
54
|
+
width,
|
|
55
|
+
backgroundColor: bgColor,
|
|
56
|
+
color: textColor,
|
|
57
|
+
borderRadius: "10px",
|
|
58
|
+
overflow: "hidden",
|
|
59
|
+
boxShadow: isHovered ? "0 10px 20px rgba(0,0,0,0.15)" : "0 4px 10px rgba(0,0,0,0.08)",
|
|
60
|
+
transform: isHovered ? "translateY(-4px)" : "translateY(0)",
|
|
61
|
+
transition: "all 0.25s ease",
|
|
62
|
+
fontFamily: "sans-serif",
|
|
63
|
+
cursor: "pointer"
|
|
64
|
+
};
|
|
65
|
+
const imageStyle = {
|
|
66
|
+
width: "100%",
|
|
67
|
+
height: "180px",
|
|
68
|
+
objectFit: "cover",
|
|
69
|
+
display: "block"
|
|
70
|
+
};
|
|
71
|
+
const bodyStyle = {
|
|
72
|
+
padding: "16px"
|
|
73
|
+
};
|
|
74
|
+
const titleStyle = {
|
|
75
|
+
margin: "0 0 8px 0",
|
|
76
|
+
fontSize: "18px",
|
|
77
|
+
fontWeight: 700,
|
|
78
|
+
color: accentColor
|
|
79
|
+
};
|
|
80
|
+
const descStyle = {
|
|
81
|
+
margin: 0,
|
|
82
|
+
fontSize: "14px",
|
|
83
|
+
lineHeight: 1.5,
|
|
84
|
+
color: textColor,
|
|
85
|
+
opacity: 0.85
|
|
86
|
+
};
|
|
87
|
+
return /* @__PURE__ */ React2.createElement(
|
|
88
|
+
"div",
|
|
89
|
+
{
|
|
90
|
+
style: cardStyle,
|
|
91
|
+
onMouseEnter: () => setIsHovered(true),
|
|
92
|
+
onMouseLeave: () => setIsHovered(false)
|
|
93
|
+
},
|
|
94
|
+
/* @__PURE__ */ React2.createElement("img", { src: imageUrl, alt: title, style: imageStyle }),
|
|
95
|
+
/* @__PURE__ */ React2.createElement("div", { style: bodyStyle }, /* @__PURE__ */ React2.createElement("h3", { style: titleStyle }, title), /* @__PURE__ */ React2.createElement("p", { style: descStyle }, description))
|
|
96
|
+
);
|
|
97
|
+
};
|
|
98
|
+
export {
|
|
99
|
+
Button,
|
|
100
|
+
Card
|
|
101
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "nova-ai-ui",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Nova 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
|
+
"keywords": [],
|
|
14
|
+
"author": "Nur",
|
|
15
|
+
"license": "ISC",
|
|
16
|
+
"peerDependencies": {
|
|
17
|
+
"react": ">=18"
|
|
18
|
+
},
|
|
19
|
+
"devDependencies": {
|
|
20
|
+
"tsup": "^8.5.1",
|
|
21
|
+
"typescript": "^6.0.3"
|
|
22
|
+
}
|
|
23
|
+
}
|