@moontra/moonui-pro 2.29.0 → 2.30.1
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 +62 -62
- package/dist/index.global.js.map +1 -1
- package/dist/index.mjs +116 -44
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -86064,8 +86064,16 @@ function ChartWidget2({
|
|
|
86064
86064
|
// red
|
|
86065
86065
|
"#8b5cf6",
|
|
86066
86066
|
// violet
|
|
86067
|
-
"#ec4899"
|
|
86067
|
+
"#ec4899",
|
|
86068
86068
|
// pink
|
|
86069
|
+
"#14b8a6",
|
|
86070
|
+
// teal
|
|
86071
|
+
"#f97316",
|
|
86072
|
+
// orange
|
|
86073
|
+
"#06b6d4",
|
|
86074
|
+
// cyan
|
|
86075
|
+
"#a855f7"
|
|
86076
|
+
// purple
|
|
86069
86077
|
];
|
|
86070
86078
|
const chartColors = colors || defaultColors2;
|
|
86071
86079
|
const maxValue = t__default.useMemo(() => {
|
|
@@ -86101,12 +86109,43 @@ function ChartWidget2({
|
|
|
86101
86109
|
animate: { opacity: 1, y: 0 },
|
|
86102
86110
|
transition: { delay: index2 * 0.05 },
|
|
86103
86111
|
children: [
|
|
86104
|
-
|
|
86112
|
+
isHovered && (() => {
|
|
86113
|
+
const showInside = percentage > 70;
|
|
86114
|
+
return /* @__PURE__ */ jsxs(
|
|
86115
|
+
motion.div,
|
|
86116
|
+
{
|
|
86117
|
+
className: "absolute bg-background border rounded-lg px-3 py-2 text-xs pointer-events-none z-20 shadow-lg",
|
|
86118
|
+
style: showInside ? {
|
|
86119
|
+
top: "20px",
|
|
86120
|
+
left: "50%",
|
|
86121
|
+
transform: "translateX(-50%)"
|
|
86122
|
+
} : {
|
|
86123
|
+
bottom: `calc(${percentage}% + 8px)`,
|
|
86124
|
+
left: "50%",
|
|
86125
|
+
transform: "translateX(-50%)"
|
|
86126
|
+
},
|
|
86127
|
+
initial: { opacity: 0, y: showInside ? -10 : 10 },
|
|
86128
|
+
animate: { opacity: 1, y: 0 },
|
|
86129
|
+
transition: { duration: 0.2 },
|
|
86130
|
+
children: [
|
|
86131
|
+
/* @__PURE__ */ jsx("div", { className: "font-medium", children: labels[index2] || `Item ${index2 + 1}` }),
|
|
86132
|
+
/* @__PURE__ */ jsx("div", { className: "text-muted-foreground", children: formatNumber2(value) })
|
|
86133
|
+
]
|
|
86134
|
+
}
|
|
86135
|
+
);
|
|
86136
|
+
})(),
|
|
86137
|
+
showDataLabels && /* @__PURE__ */ jsx(
|
|
86105
86138
|
motion.span,
|
|
86106
86139
|
{
|
|
86107
|
-
className: "absolute text-xs font-medium -
|
|
86140
|
+
className: "absolute text-xs font-medium text-white mix-blend-difference",
|
|
86141
|
+
style: {
|
|
86142
|
+
bottom: `calc(${percentage}% / 2)`,
|
|
86143
|
+
left: "50%",
|
|
86144
|
+
transform: "translateX(-50%)"
|
|
86145
|
+
},
|
|
86108
86146
|
initial: { opacity: 0 },
|
|
86109
86147
|
animate: { opacity: 1 },
|
|
86148
|
+
transition: { delay: index2 * 0.1 + 0.6 },
|
|
86110
86149
|
children: formatNumber2(value)
|
|
86111
86150
|
}
|
|
86112
86151
|
),
|
|
@@ -86114,12 +86153,14 @@ function ChartWidget2({
|
|
|
86114
86153
|
motion.div,
|
|
86115
86154
|
{
|
|
86116
86155
|
className: cn(
|
|
86117
|
-
"w-full rounded-t cursor-pointer",
|
|
86118
|
-
|
|
86156
|
+
"w-full rounded-t cursor-pointer transition-all duration-200",
|
|
86157
|
+
"shadow-lg",
|
|
86158
|
+
isHovered && "brightness-110 scale-y-105"
|
|
86119
86159
|
),
|
|
86120
86160
|
style: {
|
|
86121
|
-
|
|
86122
|
-
minHeight: "2px"
|
|
86161
|
+
background: `linear-gradient(to top, ${chartColors[index2 % chartColors.length]}, ${chartColors[index2 % chartColors.length]}dd)`,
|
|
86162
|
+
minHeight: "2px",
|
|
86163
|
+
boxShadow: isHovered ? `0 4px 20px ${chartColors[index2 % chartColors.length]}40` : "none"
|
|
86123
86164
|
},
|
|
86124
86165
|
initial: { height: 0 },
|
|
86125
86166
|
animate: { height: `${percentage}%` },
|
|
@@ -86161,9 +86202,12 @@ function ChartWidget2({
|
|
|
86161
86202
|
const labels = data.labels || data.categories || [];
|
|
86162
86203
|
if (values.length < 2)
|
|
86163
86204
|
return null;
|
|
86205
|
+
const padding = 5;
|
|
86206
|
+
const chartWidth = 100 - padding * 2;
|
|
86207
|
+
const chartHeight = 100 - padding * 2;
|
|
86164
86208
|
const points = values.map((value, index2) => {
|
|
86165
|
-
const x = index2 / (values.length - 1) *
|
|
86166
|
-
const y =
|
|
86209
|
+
const x = padding + index2 / (values.length - 1) * chartWidth;
|
|
86210
|
+
const y = padding + (chartHeight - value / maxValue * chartHeight);
|
|
86167
86211
|
return { x, y, value, label: labels[index2] };
|
|
86168
86212
|
});
|
|
86169
86213
|
const pathData = points.map((point, index2) => `${index2 === 0 ? "M" : "L"} ${point.x} ${point.y}`).join(" ");
|
|
@@ -86175,25 +86219,42 @@ function ChartWidget2({
|
|
|
86175
86219
|
viewBox: "0 0 100 100",
|
|
86176
86220
|
preserveAspectRatio: "none",
|
|
86177
86221
|
children: [
|
|
86178
|
-
|
|
86179
|
-
"
|
|
86180
|
-
|
|
86181
|
-
|
|
86182
|
-
|
|
86183
|
-
|
|
86184
|
-
|
|
86185
|
-
|
|
86186
|
-
|
|
86187
|
-
|
|
86188
|
-
|
|
86189
|
-
|
|
86222
|
+
/* @__PURE__ */ jsxs("defs", { children: [
|
|
86223
|
+
/* @__PURE__ */ jsxs("linearGradient", { id: "chartLineGradient", x1: "0%", y1: "0%", x2: "100%", y2: "0%", children: [
|
|
86224
|
+
/* @__PURE__ */ jsx("stop", { offset: "0%", stopColor: chartColors[0], stopOpacity: "1" }),
|
|
86225
|
+
/* @__PURE__ */ jsx("stop", { offset: "50%", stopColor: chartColors[1] || chartColors[0], stopOpacity: "1" }),
|
|
86226
|
+
/* @__PURE__ */ jsx("stop", { offset: "100%", stopColor: chartColors[2] || chartColors[0], stopOpacity: "1" })
|
|
86227
|
+
] }),
|
|
86228
|
+
/* @__PURE__ */ jsxs("linearGradient", { id: "chartAreaGradient", x1: "0%", y1: "0%", x2: "0%", y2: "100%", children: [
|
|
86229
|
+
/* @__PURE__ */ jsx("stop", { offset: "0%", stopColor: chartColors[0], stopOpacity: "0.3" }),
|
|
86230
|
+
/* @__PURE__ */ jsx("stop", { offset: "50%", stopColor: chartColors[0], stopOpacity: "0.15" }),
|
|
86231
|
+
/* @__PURE__ */ jsx("stop", { offset: "100%", stopColor: chartColors[0], stopOpacity: "0.05" })
|
|
86232
|
+
] })
|
|
86233
|
+
] }),
|
|
86234
|
+
showGrid && /* @__PURE__ */ jsx("g", { className: "opacity-10", children: [25, 50, 75].map((percentage) => {
|
|
86235
|
+
const y = 5 + percentage / 100 * 90;
|
|
86236
|
+
return /* @__PURE__ */ jsx(
|
|
86237
|
+
"line",
|
|
86238
|
+
{
|
|
86239
|
+
x1: "0",
|
|
86240
|
+
y1: y,
|
|
86241
|
+
x2: "100",
|
|
86242
|
+
y2: y,
|
|
86243
|
+
stroke: "currentColor",
|
|
86244
|
+
strokeWidth: "0.3"
|
|
86245
|
+
},
|
|
86246
|
+
percentage
|
|
86247
|
+
);
|
|
86248
|
+
}) }),
|
|
86190
86249
|
/* @__PURE__ */ jsx(
|
|
86191
86250
|
motion.path,
|
|
86192
86251
|
{
|
|
86193
86252
|
d: pathData,
|
|
86194
86253
|
fill: "none",
|
|
86195
|
-
stroke:
|
|
86196
|
-
strokeWidth: "
|
|
86254
|
+
stroke: "url(#chartLineGradient)",
|
|
86255
|
+
strokeWidth: "1.5",
|
|
86256
|
+
strokeLinecap: "round",
|
|
86257
|
+
strokeLinejoin: "round",
|
|
86197
86258
|
initial: { pathLength: 0 },
|
|
86198
86259
|
animate: { pathLength: 1 },
|
|
86199
86260
|
transition: { duration: animate5 ? 1 : 0 }
|
|
@@ -86202,8 +86263,8 @@ function ChartWidget2({
|
|
|
86202
86263
|
type === "area" && /* @__PURE__ */ jsx(
|
|
86203
86264
|
motion.path,
|
|
86204
86265
|
{
|
|
86205
|
-
d: `${pathData} L
|
|
86206
|
-
fill:
|
|
86266
|
+
d: `${pathData} L ${90} ${90} L ${10} ${90} Z`,
|
|
86267
|
+
fill: "url(#chartAreaGradient)",
|
|
86207
86268
|
initial: { opacity: 0 },
|
|
86208
86269
|
animate: { opacity: 1 },
|
|
86209
86270
|
transition: { duration: animate5 ? 0.5 : 0, delay: 0.5 }
|
|
@@ -86214,35 +86275,46 @@ function ChartWidget2({
|
|
|
86214
86275
|
{
|
|
86215
86276
|
cx: point.x,
|
|
86216
86277
|
cy: point.y,
|
|
86217
|
-
r: "
|
|
86278
|
+
r: "1",
|
|
86218
86279
|
fill: chartColors[0],
|
|
86219
|
-
|
|
86220
|
-
|
|
86280
|
+
stroke: "white",
|
|
86281
|
+
strokeWidth: "1.5",
|
|
86282
|
+
initial: { r: 0, opacity: 0 },
|
|
86283
|
+
animate: {
|
|
86284
|
+
r: hoveredIndex === index2 ? 2.5 : 1,
|
|
86285
|
+
opacity: 1,
|
|
86286
|
+
strokeWidth: hoveredIndex === index2 ? 2 : 1.5
|
|
86287
|
+
},
|
|
86221
86288
|
onMouseEnter: () => setHoveredIndex(index2),
|
|
86222
86289
|
onMouseLeave: () => setHoveredIndex(null),
|
|
86223
86290
|
className: "cursor-pointer",
|
|
86224
|
-
onClick: () => onDataPointClick?.(point)
|
|
86291
|
+
onClick: () => onDataPointClick?.(point),
|
|
86292
|
+
transition: { duration: 0.2 }
|
|
86225
86293
|
},
|
|
86226
86294
|
index2
|
|
86227
86295
|
))
|
|
86228
86296
|
]
|
|
86229
86297
|
}
|
|
86230
86298
|
),
|
|
86231
|
-
showTooltip && hoveredIndex !== null && points[hoveredIndex] &&
|
|
86232
|
-
|
|
86233
|
-
|
|
86234
|
-
|
|
86235
|
-
|
|
86236
|
-
|
|
86237
|
-
|
|
86238
|
-
|
|
86239
|
-
|
|
86240
|
-
|
|
86241
|
-
|
|
86242
|
-
|
|
86243
|
-
|
|
86244
|
-
|
|
86245
|
-
|
|
86299
|
+
showTooltip && hoveredIndex !== null && points[hoveredIndex] && (() => {
|
|
86300
|
+
const point = points[hoveredIndex];
|
|
86301
|
+
const showBelow = point.y < 30;
|
|
86302
|
+
return /* @__PURE__ */ jsxs(
|
|
86303
|
+
"div",
|
|
86304
|
+
{
|
|
86305
|
+
className: "absolute bg-background border rounded px-2 py-1 text-xs pointer-events-none z-10 shadow-lg",
|
|
86306
|
+
style: {
|
|
86307
|
+
left: `${Math.min(90, Math.max(10, point.x))}%`,
|
|
86308
|
+
top: showBelow ? `${point.y}%` : `${point.y}%`,
|
|
86309
|
+
transform: showBelow ? "translate(-50%, 10px)" : "translate(-50%, calc(-100% - 10px))"
|
|
86310
|
+
},
|
|
86311
|
+
children: [
|
|
86312
|
+
/* @__PURE__ */ jsx("div", { className: "font-medium", children: point.label }),
|
|
86313
|
+
/* @__PURE__ */ jsx("div", { children: formatNumber2(point.value) })
|
|
86314
|
+
]
|
|
86315
|
+
}
|
|
86316
|
+
);
|
|
86317
|
+
})()
|
|
86246
86318
|
] });
|
|
86247
86319
|
};
|
|
86248
86320
|
const renderPieChart = () => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@moontra/moonui-pro",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.30.1",
|
|
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",
|