@moontra/moonui-pro 2.28.8 → 2.28.10
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.global.js +71 -71
- package/dist/index.global.js.map +1 -1
- package/dist/index.mjs +107 -75
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -85707,13 +85707,22 @@ function WidgetBase({
|
|
|
85707
85707
|
overlay
|
|
85708
85708
|
}) {
|
|
85709
85709
|
const colorSchemeClasses = {
|
|
85710
|
-
blue: "from-blue-500/
|
|
85711
|
-
green: "from-green-500/
|
|
85712
|
-
purple: "from-purple-500/
|
|
85713
|
-
orange: "from-orange-500/
|
|
85714
|
-
pink: "from-pink-500/
|
|
85715
|
-
cyan: "from-cyan-500/
|
|
85716
|
-
neutral: "from-gray-500/
|
|
85710
|
+
blue: "from-blue-500/10 via-blue-500/5 to-transparent border-blue-500/20 dark:from-blue-400/10 dark:via-blue-400/5 dark:border-blue-400/20",
|
|
85711
|
+
green: "from-green-500/10 via-green-500/5 to-transparent border-green-500/20 dark:from-green-400/10 dark:via-green-400/5 dark:border-green-400/20",
|
|
85712
|
+
purple: "from-purple-500/10 via-purple-500/5 to-transparent border-purple-500/20 dark:from-purple-400/10 dark:via-purple-400/5 dark:border-purple-400/20",
|
|
85713
|
+
orange: "from-orange-500/10 via-orange-500/5 to-transparent border-orange-500/20 dark:from-orange-400/10 dark:via-orange-400/5 dark:border-orange-400/20",
|
|
85714
|
+
pink: "from-pink-500/10 via-pink-500/5 to-transparent border-pink-500/20 dark:from-pink-400/10 dark:via-pink-400/5 dark:border-pink-400/20",
|
|
85715
|
+
cyan: "from-cyan-500/10 via-cyan-500/5 to-transparent border-cyan-500/20 dark:from-cyan-400/10 dark:via-cyan-400/5 dark:border-cyan-400/20",
|
|
85716
|
+
neutral: "from-gray-500/10 via-gray-500/5 to-transparent border-gray-500/20 dark:from-gray-400/10 dark:via-gray-400/5 dark:border-gray-400/20"
|
|
85717
|
+
};
|
|
85718
|
+
const colorSchemeClassesColored = {
|
|
85719
|
+
blue: "from-blue-500/20 via-blue-500/10 to-transparent border-blue-500/30 dark:from-blue-400/20 dark:via-blue-400/10 dark:border-blue-400/30",
|
|
85720
|
+
green: "from-green-500/20 via-green-500/10 to-transparent border-green-500/30 dark:from-green-400/20 dark:via-green-400/10 dark:border-green-400/30",
|
|
85721
|
+
purple: "from-purple-500/20 via-purple-500/10 to-transparent border-purple-500/30 dark:from-purple-400/20 dark:via-purple-400/10 dark:border-purple-400/30",
|
|
85722
|
+
orange: "from-orange-500/20 via-orange-500/10 to-transparent border-orange-500/30 dark:from-orange-400/20 dark:via-orange-400/10 dark:border-orange-400/30",
|
|
85723
|
+
pink: "from-pink-500/20 via-pink-500/10 to-transparent border-pink-500/30 dark:from-pink-400/20 dark:via-pink-400/10 dark:border-pink-400/30",
|
|
85724
|
+
cyan: "from-cyan-500/20 via-cyan-500/10 to-transparent border-cyan-500/30 dark:from-cyan-400/20 dark:via-cyan-400/10 dark:border-cyan-400/30",
|
|
85725
|
+
neutral: "from-gray-500/20 via-gray-500/10 to-transparent border-gray-500/30 dark:from-gray-400/20 dark:via-gray-400/10 dark:border-gray-400/30"
|
|
85717
85726
|
};
|
|
85718
85727
|
const roundedClasses = {
|
|
85719
85728
|
none: "rounded-none",
|
|
@@ -85757,52 +85766,69 @@ function WidgetBase({
|
|
|
85757
85766
|
"to-tl": "bg-gradient-to-tl"
|
|
85758
85767
|
// top-left
|
|
85759
85768
|
};
|
|
85769
|
+
const gradientDirectionStyles = {
|
|
85770
|
+
"to-t": { backgroundImage: "linear-gradient(to top, var(--tw-gradient-stops))" },
|
|
85771
|
+
"to-tr": { backgroundImage: "linear-gradient(to top right, var(--tw-gradient-stops))" },
|
|
85772
|
+
"to-r": { backgroundImage: "linear-gradient(to right, var(--tw-gradient-stops))" },
|
|
85773
|
+
"to-br": { backgroundImage: "linear-gradient(to bottom right, var(--tw-gradient-stops))" },
|
|
85774
|
+
"to-b": { backgroundImage: "linear-gradient(to bottom, var(--tw-gradient-stops))" },
|
|
85775
|
+
"to-bl": { backgroundImage: "linear-gradient(to bottom left, var(--tw-gradient-stops))" },
|
|
85776
|
+
"to-l": { backgroundImage: "linear-gradient(to left, var(--tw-gradient-stops))" },
|
|
85777
|
+
"to-tl": { backgroundImage: "linear-gradient(to top left, var(--tw-gradient-stops))" }
|
|
85778
|
+
};
|
|
85760
85779
|
const variantClasses = {
|
|
85761
85780
|
default: "bg-card border",
|
|
85762
85781
|
minimal: "border-0 shadow-none bg-card/50",
|
|
85763
85782
|
glass: "bg-background/60 backdrop-blur-md border-white/10",
|
|
85764
85783
|
bordered: "border-2 bg-card",
|
|
85765
85784
|
gradient: `${gradientDirectionClasses[gradientDirection]} ${colorSchemeClasses[colorScheme]}`,
|
|
85766
|
-
colored: `${gradientDirectionClasses[gradientDirection]} ${
|
|
85785
|
+
colored: `${gradientDirectionClasses[gradientDirection]} ${colorSchemeClassesColored[colorScheme]} border-2`,
|
|
85767
85786
|
overlay: "bg-card border relative overflow-hidden",
|
|
85768
85787
|
floating: "bg-card border-0 shadow-2xl hover:shadow-3xl transform hover:-translate-y-1 transition-all duration-300 ring-1 ring-gray-200/50 dark:ring-gray-700/50"
|
|
85769
85788
|
};
|
|
85770
|
-
const content = /* @__PURE__ */ jsxs(
|
|
85771
|
-
|
|
85772
|
-
|
|
85773
|
-
|
|
85774
|
-
|
|
85775
|
-
|
|
85776
|
-
|
|
85777
|
-
|
|
85778
|
-
|
|
85779
|
-
|
|
85780
|
-
|
|
85781
|
-
|
|
85782
|
-
|
|
85783
|
-
|
|
85784
|
-
|
|
85785
|
-
|
|
85786
|
-
|
|
85787
|
-
|
|
85788
|
-
|
|
85789
|
-
|
|
85790
|
-
|
|
85791
|
-
|
|
85792
|
-
|
|
85793
|
-
|
|
85794
|
-
|
|
85795
|
-
|
|
85796
|
-
|
|
85797
|
-
|
|
85798
|
-
|
|
85799
|
-
|
|
85800
|
-
|
|
85801
|
-
|
|
85802
|
-
|
|
85803
|
-
|
|
85804
|
-
|
|
85805
|
-
|
|
85789
|
+
const content = /* @__PURE__ */ jsxs(
|
|
85790
|
+
MoonUICardPro,
|
|
85791
|
+
{
|
|
85792
|
+
className: cn(
|
|
85793
|
+
variantClasses[variant],
|
|
85794
|
+
roundedClasses[rounded],
|
|
85795
|
+
shadowClasses[shadow],
|
|
85796
|
+
"transition-all duration-200 relative",
|
|
85797
|
+
className
|
|
85798
|
+
),
|
|
85799
|
+
style: variant === "gradient" || variant === "colored" ? gradientDirectionStyles[gradientDirection] : void 0,
|
|
85800
|
+
children: [
|
|
85801
|
+
(variant === "overlay" || overlay) && overlay?.pattern && overlay.pattern !== "none" && /* @__PURE__ */ jsx(
|
|
85802
|
+
"div",
|
|
85803
|
+
{
|
|
85804
|
+
className: "absolute inset-0 pointer-events-none",
|
|
85805
|
+
style: {
|
|
85806
|
+
backgroundImage: overlayPatterns[overlay.pattern],
|
|
85807
|
+
backgroundSize: overlay.pattern === "dots" ? "8px 8px" : overlay.pattern === "grid" ? "20px 20px" : overlay.pattern === "diagonal" ? "8px 8px" : overlay.pattern === "waves" ? "60px 60px" : "auto",
|
|
85808
|
+
opacity: overlay.opacity || 0.1,
|
|
85809
|
+
color: overlay.color || "currentColor"
|
|
85810
|
+
}
|
|
85811
|
+
}
|
|
85812
|
+
),
|
|
85813
|
+
(title || subtitle || headerAction) && /* @__PURE__ */ jsxs(MoonUICardHeaderPro, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
|
|
85814
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
85815
|
+
title && /* @__PURE__ */ jsx(MoonUICardTitlePro, { className: "text-base font-semibold", children: title }),
|
|
85816
|
+
subtitle && /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground mt-1", children: subtitle })
|
|
85817
|
+
] }),
|
|
85818
|
+
headerAction && /* @__PURE__ */ jsx("div", { className: "ml-4", children: headerAction })
|
|
85819
|
+
] }),
|
|
85820
|
+
/* @__PURE__ */ jsx(MoonUICardContentPro, { className: cn(
|
|
85821
|
+
title || subtitle || headerAction ? "pt-0" : "pt-6"
|
|
85822
|
+
), children: loading ? /* @__PURE__ */ jsx("div", { className: "flex items-center justify-center py-8", children: /* @__PURE__ */ jsxs("div", { className: "animate-pulse space-y-2", children: [
|
|
85823
|
+
/* @__PURE__ */ jsx("div", { className: "h-4 bg-muted rounded w-24 mx-auto" }),
|
|
85824
|
+
/* @__PURE__ */ jsx("div", { className: "h-8 bg-muted rounded w-16 mx-auto" })
|
|
85825
|
+
] }) }) : error ? /* @__PURE__ */ jsx("div", { className: "flex items-center justify-center py-8 text-center", children: /* @__PURE__ */ jsxs("div", { className: "text-destructive", children: [
|
|
85826
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm font-medium", children: "Error" }),
|
|
85827
|
+
/* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground mt-1", children: error })
|
|
85828
|
+
] }) }) : children })
|
|
85829
|
+
]
|
|
85830
|
+
}
|
|
85831
|
+
);
|
|
85806
85832
|
if (animate5) {
|
|
85807
85833
|
return /* @__PURE__ */ jsx(
|
|
85808
85834
|
motion.div,
|
|
@@ -86058,29 +86084,27 @@ function ChartWidget2({
|
|
|
86058
86084
|
const renderBarChart = () => {
|
|
86059
86085
|
const values = data.values || [];
|
|
86060
86086
|
const labels = data.labels || data.categories || [];
|
|
86061
|
-
|
|
86062
|
-
|
|
86063
|
-
/* @__PURE__ */ jsx("div", { className: "flex items-end justify-between gap-1 pl-12 pr-4", style: { height: "200px" }, children: values.map((value, index2) => {
|
|
86087
|
+
return /* @__PURE__ */ jsxs("div", { className: "relative h-full overflow-hidden", children: [
|
|
86088
|
+
/* @__PURE__ */ jsx("div", { className: "absolute inset-0 flex items-end justify-between gap-1 pl-10 pr-2 pb-6", children: values.map((value, index2) => {
|
|
86064
86089
|
const percentage = value / maxValue * 100;
|
|
86065
86090
|
const isHovered = hoveredIndex === index2;
|
|
86066
|
-
console.log(`Bar ${index2}:`, { value, percentage, maxValue });
|
|
86067
86091
|
return /* @__PURE__ */ jsxs(
|
|
86068
86092
|
motion.div,
|
|
86069
86093
|
{
|
|
86070
|
-
className: "flex flex-col items-center justify-end
|
|
86071
|
-
style: { height: "100%", flex: "1 1 0"
|
|
86094
|
+
className: "relative flex flex-col items-center justify-end min-w-0",
|
|
86095
|
+
style: { height: "calc(100% - 24px)", flex: "1 1 0" },
|
|
86072
86096
|
onMouseEnter: () => setHoveredIndex(index2),
|
|
86073
86097
|
onMouseLeave: () => setHoveredIndex(null),
|
|
86074
86098
|
initial: { opacity: 0, y: 20 },
|
|
86075
86099
|
animate: { opacity: 1, y: 0 },
|
|
86076
86100
|
transition: { delay: index2 * 0.05 },
|
|
86077
86101
|
children: [
|
|
86078
|
-
showDataLabels && /* @__PURE__ */ jsx(
|
|
86102
|
+
showDataLabels && isHovered && /* @__PURE__ */ jsx(
|
|
86079
86103
|
motion.span,
|
|
86080
86104
|
{
|
|
86081
|
-
className: "text-xs font-medium",
|
|
86105
|
+
className: "absolute text-xs font-medium -top-5",
|
|
86082
86106
|
initial: { opacity: 0 },
|
|
86083
|
-
animate: { opacity:
|
|
86107
|
+
animate: { opacity: 1 },
|
|
86084
86108
|
children: formatNumber2(value)
|
|
86085
86109
|
}
|
|
86086
86110
|
),
|
|
@@ -86093,7 +86117,7 @@ function ChartWidget2({
|
|
|
86093
86117
|
),
|
|
86094
86118
|
style: {
|
|
86095
86119
|
backgroundColor: chartColors[index2 % chartColors.length],
|
|
86096
|
-
minHeight: "
|
|
86120
|
+
minHeight: "2px"
|
|
86097
86121
|
},
|
|
86098
86122
|
initial: { height: 0 },
|
|
86099
86123
|
animate: { height: `${percentage}%` },
|
|
@@ -86104,22 +86128,30 @@ function ChartWidget2({
|
|
|
86104
86128
|
},
|
|
86105
86129
|
onClick: () => onDataPointClick?.({ label: labels[index2], value })
|
|
86106
86130
|
}
|
|
86107
|
-
) })
|
|
86108
|
-
labels[index2] && /* @__PURE__ */ jsx("span", { className: "text-xs text-muted-foreground truncate max-w-full", children: labels[index2] })
|
|
86131
|
+
) })
|
|
86109
86132
|
]
|
|
86110
86133
|
},
|
|
86111
86134
|
index2
|
|
86112
86135
|
);
|
|
86113
86136
|
}) }),
|
|
86114
|
-
|
|
86115
|
-
|
|
86116
|
-
|
|
86117
|
-
|
|
86118
|
-
|
|
86119
|
-
|
|
86120
|
-
|
|
86121
|
-
|
|
86122
|
-
|
|
86137
|
+
/* @__PURE__ */ jsx("div", { className: "absolute bottom-0 left-10 right-0 flex justify-between gap-1 pr-2 h-6", children: labels.map((label, index2) => /* @__PURE__ */ jsx("div", { className: "flex-1 flex justify-center", children: /* @__PURE__ */ jsx("span", { className: "text-xs text-muted-foreground truncate", children: label }) }, index2)) }),
|
|
86138
|
+
showGrid && /* @__PURE__ */ jsxs("div", { className: "absolute inset-0 pb-6 pointer-events-none", children: [
|
|
86139
|
+
[0, 25, 50, 75, 100].map((percentage) => /* @__PURE__ */ jsx(
|
|
86140
|
+
"div",
|
|
86141
|
+
{
|
|
86142
|
+
className: "absolute left-10 right-0 border-b border-muted/20",
|
|
86143
|
+
style: { bottom: `calc(24px + ${percentage}% * (100% - 24px) / 100)` }
|
|
86144
|
+
},
|
|
86145
|
+
percentage
|
|
86146
|
+
)),
|
|
86147
|
+
/* @__PURE__ */ jsxs("div", { className: "absolute left-0 top-0 bottom-6 w-9 flex flex-col justify-between text-xs text-muted-foreground pr-1", children: [
|
|
86148
|
+
/* @__PURE__ */ jsx("span", { className: "text-right", children: formatNumber2(maxValue) }),
|
|
86149
|
+
/* @__PURE__ */ jsx("span", { className: "text-right", children: formatNumber2(maxValue * 0.75) }),
|
|
86150
|
+
/* @__PURE__ */ jsx("span", { className: "text-right", children: formatNumber2(maxValue * 0.5) }),
|
|
86151
|
+
/* @__PURE__ */ jsx("span", { className: "text-right", children: formatNumber2(maxValue * 0.25) }),
|
|
86152
|
+
/* @__PURE__ */ jsx("span", { className: "text-right", children: "0" })
|
|
86153
|
+
] })
|
|
86154
|
+
] })
|
|
86123
86155
|
] });
|
|
86124
86156
|
};
|
|
86125
86157
|
const renderLineChart = () => {
|
|
@@ -86133,7 +86165,7 @@ function ChartWidget2({
|
|
|
86133
86165
|
return { x, y, value, label: labels[index2] };
|
|
86134
86166
|
});
|
|
86135
86167
|
const pathData = points.map((point, index2) => `${index2 === 0 ? "M" : "L"} ${point.x} ${point.y}`).join(" ");
|
|
86136
|
-
return /* @__PURE__ */ jsxs("div", { className: "relative h-full", children: [
|
|
86168
|
+
return /* @__PURE__ */ jsxs("div", { className: "relative h-full overflow-hidden", children: [
|
|
86137
86169
|
/* @__PURE__ */ jsxs(
|
|
86138
86170
|
"svg",
|
|
86139
86171
|
{
|
|
@@ -86197,10 +86229,10 @@ function ChartWidget2({
|
|
|
86197
86229
|
showTooltip && hoveredIndex !== null && points[hoveredIndex] && /* @__PURE__ */ jsxs(
|
|
86198
86230
|
"div",
|
|
86199
86231
|
{
|
|
86200
|
-
className: "absolute bg-background border rounded px-2 py-1 text-xs pointer-events-none",
|
|
86232
|
+
className: "absolute bg-background border rounded px-2 py-1 text-xs pointer-events-none z-10",
|
|
86201
86233
|
style: {
|
|
86202
|
-
left: `${points[hoveredIndex].x}%`,
|
|
86203
|
-
top: `${points[hoveredIndex].y}%`,
|
|
86234
|
+
left: `${Math.min(90, Math.max(10, points[hoveredIndex].x))}%`,
|
|
86235
|
+
top: `${Math.min(85, Math.max(5, points[hoveredIndex].y))}%`,
|
|
86204
86236
|
transform: "translate(-50%, -150%)"
|
|
86205
86237
|
},
|
|
86206
86238
|
children: [
|
|
@@ -86216,8 +86248,8 @@ function ChartWidget2({
|
|
|
86216
86248
|
const labels = data.labels || data.categories || [];
|
|
86217
86249
|
const total = values.reduce((sum, val) => sum + val, 0);
|
|
86218
86250
|
let currentAngle = -90;
|
|
86219
|
-
return /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-4", children: [
|
|
86220
|
-
/* @__PURE__ */ jsxs("div", { className: "relative w-
|
|
86251
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-4 h-full overflow-hidden", children: [
|
|
86252
|
+
/* @__PURE__ */ jsxs("div", { className: "relative w-32 h-32 lg:w-40 lg:h-40 flex-shrink-0", children: [
|
|
86221
86253
|
/* @__PURE__ */ jsxs("svg", { className: "w-full h-full transform", viewBox: "0 0 100 100", children: [
|
|
86222
86254
|
values.map((value, index2) => {
|
|
86223
86255
|
const percentage = value / total * 100;
|
|
@@ -86258,7 +86290,7 @@ function ChartWidget2({
|
|
|
86258
86290
|
/* @__PURE__ */ jsx("div", { className: "text-xs text-muted-foreground", children: "Total" })
|
|
86259
86291
|
] })
|
|
86260
86292
|
] }),
|
|
86261
|
-
showLegend && /* @__PURE__ */ jsx("div", { className: "space-y-
|
|
86293
|
+
showLegend && /* @__PURE__ */ jsx("div", { className: "space-y-1 overflow-y-auto flex-1 min-w-0", children: values.map((value, index2) => {
|
|
86262
86294
|
const percentage = (value / total * 100).toFixed(1);
|
|
86263
86295
|
return /* @__PURE__ */ jsxs(
|
|
86264
86296
|
"div",
|
|
@@ -86273,11 +86305,11 @@ function ChartWidget2({
|
|
|
86273
86305
|
/* @__PURE__ */ jsx(
|
|
86274
86306
|
"div",
|
|
86275
86307
|
{
|
|
86276
|
-
className: "w-
|
|
86308
|
+
className: "w-2 h-2 rounded flex-shrink-0",
|
|
86277
86309
|
style: { backgroundColor: chartColors[index2 % chartColors.length] }
|
|
86278
86310
|
}
|
|
86279
86311
|
),
|
|
86280
|
-
/* @__PURE__ */ jsx("span", { className: "text-
|
|
86312
|
+
/* @__PURE__ */ jsx("span", { className: "text-xs truncate", children: labels[index2] }),
|
|
86281
86313
|
/* @__PURE__ */ jsxs("span", { className: "text-xs text-muted-foreground ml-auto", children: [
|
|
86282
86314
|
percentage,
|
|
86283
86315
|
"%"
|
|
@@ -86339,7 +86371,7 @@ function ChartWidget2({
|
|
|
86339
86371
|
] })
|
|
86340
86372
|
] })
|
|
86341
86373
|
] }),
|
|
86342
|
-
/* @__PURE__ */ jsx("div", { style: { height: `${height}px` }, children: renderChart() })
|
|
86374
|
+
/* @__PURE__ */ jsx("div", { className: "overflow-hidden", style: { height: `${height}px` }, children: renderChart() })
|
|
86343
86375
|
] })
|
|
86344
86376
|
}
|
|
86345
86377
|
);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@moontra/moonui-pro",
|
|
3
|
-
"version": "2.28.
|
|
3
|
+
"version": "2.28.10",
|
|
4
4
|
"description": "Premium React components for MoonUI - Advanced UI library with 50+ pro components including performance, interactive, and gesture components",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.mjs",
|