virtual-ui-lib 1.0.34 → 1.0.36

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 CHANGED
@@ -30,6 +30,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
30
30
  var index_exports = {};
31
31
  __export(index_exports, {
32
32
  AlertBanner: () => AlertBanner,
33
+ AnimatedNavbar: () => AnimatedNavbar,
33
34
  AnimatedProgressBar: () => AnimatedProgressBar,
34
35
  Button: () => Button,
35
36
  Card: () => Card,
@@ -48,6 +49,7 @@ __export(index_exports, {
48
49
  OTPInput: () => OTPInput,
49
50
  Rating: () => Rating,
50
51
  RatingStars: () => RatingStars,
52
+ StatCard: () => StatCard,
51
53
  UserAvatar: () => UserAvatar,
52
54
  WishlistButton: () => WishlistButton
53
55
  });
@@ -1076,9 +1078,100 @@ var Rating = ({
1076
1078
  );
1077
1079
  }));
1078
1080
  };
1081
+
1082
+ // src/components/AnimatedNavbar/AnimatedNavbar.jsx
1083
+ var import_react22 = __toESM(require("react"));
1084
+ var AnimatedNavbar = ({
1085
+ logo = "https://via.placeholder.com/100",
1086
+ links = [{ text: "Home", href: "#" }, { text: "About", href: "#" }, { text: "Services", href: "#" }, { text: "Contact", href: "#" }],
1087
+ bgColor = "#0f172a",
1088
+ textColor = "#f1f5f9",
1089
+ accentColor = "#7c3aed",
1090
+ radius = "8px"
1091
+ }) => {
1092
+ const [isOpen, setIsOpen] = import_react22.default.useState(false);
1093
+ return /* @__PURE__ */ import_react22.default.createElement("nav", { style: {
1094
+ background: bgColor,
1095
+ display: "flex",
1096
+ justifyContent: "space-between",
1097
+ alignItems: "center",
1098
+ padding: "10px 20px",
1099
+ borderRadius: radius,
1100
+ position: "relative",
1101
+ boxShadow: "0 4px 10px rgba(0,0,0,0.2)",
1102
+ transition: "background 0.3s"
1103
+ } }, /* @__PURE__ */ import_react22.default.createElement("img", { src: logo, alt: "Logo", style: { width: "100px" } }), /* @__PURE__ */ import_react22.default.createElement("div", { style: { display: "flex", alignItems: "center", gap: "15px" } }, /* @__PURE__ */ import_react22.default.createElement("button", { onClick: () => setIsOpen(!isOpen), style: {
1104
+ background: accentColor,
1105
+ color: textColor,
1106
+ border: "none",
1107
+ borderRadius: radius,
1108
+ padding: "8px 16px",
1109
+ fontWeight: "600",
1110
+ transition: "background 0.3s"
1111
+ } }, "Menu")), isOpen && /* @__PURE__ */ import_react22.default.createElement("div", { style: {
1112
+ position: "absolute",
1113
+ top: "100%",
1114
+ right: "0",
1115
+ background: bgColor,
1116
+ borderRadius: radius,
1117
+ boxShadow: "0 4px 10px rgba(0,0,0,0.2)",
1118
+ zIndex: 10,
1119
+ display: "flex",
1120
+ flexDirection: "column",
1121
+ gap: "10px",
1122
+ padding: "10px"
1123
+ } }, links.map((link) => /* @__PURE__ */ import_react22.default.createElement("a", { key: link.text, href: link.href, style: {
1124
+ color: textColor,
1125
+ textDecoration: "none",
1126
+ padding: "8px 12px",
1127
+ borderRadius: radius,
1128
+ transition: "background 0.3s"
1129
+ }, onMouseEnter: (e) => e.currentTarget.style.background = accentColor, onMouseLeave: (e) => e.currentTarget.style.background = "transparent" }, link.text))));
1130
+ };
1131
+
1132
+ // src/components/StatCard/StatCard.jsx
1133
+ var import_react23 = __toESM(require("react"));
1134
+ var StatCard = ({
1135
+ title = "Total Sales",
1136
+ value = 1e3,
1137
+ change = 5,
1138
+ bg = "#0f172a",
1139
+ accent = "#0f766e",
1140
+ negativeAccent = "#dc2626",
1141
+ radius = "16px"
1142
+ }) => {
1143
+ const [count, setCount] = (0, import_react23.useState)(0);
1144
+ (0, import_react23.useEffect)(() => {
1145
+ let start = 0;
1146
+ const end = value;
1147
+ const duration = 2;
1148
+ const increment = end / (duration * 60);
1149
+ const timer = setInterval(() => {
1150
+ start += increment;
1151
+ if (start >= end) {
1152
+ clearInterval(timer);
1153
+ setCount(end);
1154
+ } else {
1155
+ setCount(Math.floor(start));
1156
+ }
1157
+ }, 1e3 / 60);
1158
+ return () => clearInterval(timer);
1159
+ }, [value]);
1160
+ return /* @__PURE__ */ import_react23.default.createElement("div", { style: { background: bg, borderRadius: radius, padding: "24px", width: "280px", fontFamily: "system-ui, sans-serif", color: "#f1f5f9", position: "relative", boxShadow: "0 10px 30px rgba(0,0,0,0.5)" } }, /* @__PURE__ */ import_react23.default.createElement("h3", { style: { margin: "0 0 12px", fontSize: "16px", fontWeight: "600" } }, title), /* @__PURE__ */ import_react23.default.createElement("div", { style: { fontSize: "40px", fontWeight: "700", margin: "0 0 8px" } }, count), /* @__PURE__ */ import_react23.default.createElement("span", { style: {
1161
+ background: change >= 0 ? accent : negativeAccent,
1162
+ color: "white",
1163
+ padding: "4px 8px",
1164
+ borderRadius: "12px",
1165
+ fontSize: "12px",
1166
+ position: "absolute",
1167
+ top: "24px",
1168
+ right: "24px"
1169
+ } }, change >= 0 ? "+" + change + "%" : change + "%"), /* @__PURE__ */ import_react23.default.createElement("svg", { width: "100%", height: "20", viewBox: "0 0 100 20", style: { marginTop: "10px" } }, /* @__PURE__ */ import_react23.default.createElement("polyline", { points: "0,15 20,10 40,12 60,5 80,8 100,0", stroke: accent, fill: "none", strokeWidth: "2" })));
1170
+ };
1079
1171
  // Annotate the CommonJS export names for ESM import in node:
1080
1172
  0 && (module.exports = {
1081
1173
  AlertBanner,
1174
+ AnimatedNavbar,
1082
1175
  AnimatedProgressBar,
1083
1176
  Button,
1084
1177
  Card,
@@ -1097,6 +1190,7 @@ var Rating = ({
1097
1190
  OTPInput,
1098
1191
  Rating,
1099
1192
  RatingStars,
1193
+ StatCard,
1100
1194
  UserAvatar,
1101
1195
  WishlistButton
1102
1196
  });
package/dist/index.mjs CHANGED
@@ -1021,8 +1021,99 @@ var Rating = ({
1021
1021
  );
1022
1022
  }));
1023
1023
  };
1024
+
1025
+ // src/components/AnimatedNavbar/AnimatedNavbar.jsx
1026
+ import React22 from "react";
1027
+ var AnimatedNavbar = ({
1028
+ logo = "https://via.placeholder.com/100",
1029
+ links = [{ text: "Home", href: "#" }, { text: "About", href: "#" }, { text: "Services", href: "#" }, { text: "Contact", href: "#" }],
1030
+ bgColor = "#0f172a",
1031
+ textColor = "#f1f5f9",
1032
+ accentColor = "#7c3aed",
1033
+ radius = "8px"
1034
+ }) => {
1035
+ const [isOpen, setIsOpen] = React22.useState(false);
1036
+ return /* @__PURE__ */ React22.createElement("nav", { style: {
1037
+ background: bgColor,
1038
+ display: "flex",
1039
+ justifyContent: "space-between",
1040
+ alignItems: "center",
1041
+ padding: "10px 20px",
1042
+ borderRadius: radius,
1043
+ position: "relative",
1044
+ boxShadow: "0 4px 10px rgba(0,0,0,0.2)",
1045
+ transition: "background 0.3s"
1046
+ } }, /* @__PURE__ */ React22.createElement("img", { src: logo, alt: "Logo", style: { width: "100px" } }), /* @__PURE__ */ React22.createElement("div", { style: { display: "flex", alignItems: "center", gap: "15px" } }, /* @__PURE__ */ React22.createElement("button", { onClick: () => setIsOpen(!isOpen), style: {
1047
+ background: accentColor,
1048
+ color: textColor,
1049
+ border: "none",
1050
+ borderRadius: radius,
1051
+ padding: "8px 16px",
1052
+ fontWeight: "600",
1053
+ transition: "background 0.3s"
1054
+ } }, "Menu")), isOpen && /* @__PURE__ */ React22.createElement("div", { style: {
1055
+ position: "absolute",
1056
+ top: "100%",
1057
+ right: "0",
1058
+ background: bgColor,
1059
+ borderRadius: radius,
1060
+ boxShadow: "0 4px 10px rgba(0,0,0,0.2)",
1061
+ zIndex: 10,
1062
+ display: "flex",
1063
+ flexDirection: "column",
1064
+ gap: "10px",
1065
+ padding: "10px"
1066
+ } }, links.map((link) => /* @__PURE__ */ React22.createElement("a", { key: link.text, href: link.href, style: {
1067
+ color: textColor,
1068
+ textDecoration: "none",
1069
+ padding: "8px 12px",
1070
+ borderRadius: radius,
1071
+ transition: "background 0.3s"
1072
+ }, onMouseEnter: (e) => e.currentTarget.style.background = accentColor, onMouseLeave: (e) => e.currentTarget.style.background = "transparent" }, link.text))));
1073
+ };
1074
+
1075
+ // src/components/StatCard/StatCard.jsx
1076
+ import React23, { useEffect as useEffect7, useState as useState15 } from "react";
1077
+ var StatCard = ({
1078
+ title = "Total Sales",
1079
+ value = 1e3,
1080
+ change = 5,
1081
+ bg = "#0f172a",
1082
+ accent = "#0f766e",
1083
+ negativeAccent = "#dc2626",
1084
+ radius = "16px"
1085
+ }) => {
1086
+ const [count, setCount] = useState15(0);
1087
+ useEffect7(() => {
1088
+ let start = 0;
1089
+ const end = value;
1090
+ const duration = 2;
1091
+ const increment = end / (duration * 60);
1092
+ const timer = setInterval(() => {
1093
+ start += increment;
1094
+ if (start >= end) {
1095
+ clearInterval(timer);
1096
+ setCount(end);
1097
+ } else {
1098
+ setCount(Math.floor(start));
1099
+ }
1100
+ }, 1e3 / 60);
1101
+ return () => clearInterval(timer);
1102
+ }, [value]);
1103
+ return /* @__PURE__ */ React23.createElement("div", { style: { background: bg, borderRadius: radius, padding: "24px", width: "280px", fontFamily: "system-ui, sans-serif", color: "#f1f5f9", position: "relative", boxShadow: "0 10px 30px rgba(0,0,0,0.5)" } }, /* @__PURE__ */ React23.createElement("h3", { style: { margin: "0 0 12px", fontSize: "16px", fontWeight: "600" } }, title), /* @__PURE__ */ React23.createElement("div", { style: { fontSize: "40px", fontWeight: "700", margin: "0 0 8px" } }, count), /* @__PURE__ */ React23.createElement("span", { style: {
1104
+ background: change >= 0 ? accent : negativeAccent,
1105
+ color: "white",
1106
+ padding: "4px 8px",
1107
+ borderRadius: "12px",
1108
+ fontSize: "12px",
1109
+ position: "absolute",
1110
+ top: "24px",
1111
+ right: "24px"
1112
+ } }, change >= 0 ? "+" + change + "%" : change + "%"), /* @__PURE__ */ React23.createElement("svg", { width: "100%", height: "20", viewBox: "0 0 100 20", style: { marginTop: "10px" } }, /* @__PURE__ */ React23.createElement("polyline", { points: "0,15 20,10 40,12 60,5 80,8 100,0", stroke: accent, fill: "none", strokeWidth: "2" })));
1113
+ };
1024
1114
  export {
1025
1115
  AlertBanner,
1116
+ AnimatedNavbar,
1026
1117
  AnimatedProgressBar,
1027
1118
  Button,
1028
1119
  Card,
@@ -1041,6 +1132,7 @@ export {
1041
1132
  OTPInput,
1042
1133
  Rating,
1043
1134
  RatingStars,
1135
+ StatCard,
1044
1136
  UserAvatar,
1045
1137
  WishlistButton
1046
1138
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "virtual-ui-lib",
3
- "version": "1.0.34",
3
+ "version": "1.0.36",
4
4
  "description": "Virtual UI React Component Library",
5
5
  "author": "Ankush",
6
6
  "license": "ISC",