@moontra/moonui-pro 2.30.0 → 2.30.2

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.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,24 +86109,31 @@ function ChartWidget2({
86101
86109
  animate: { opacity: 1, y: 0 },
86102
86110
  transition: { delay: index2 * 0.05 },
86103
86111
  children: [
86104
- isHovered && /* @__PURE__ */ jsxs(
86105
- motion.div,
86106
- {
86107
- className: "absolute bg-background border rounded-lg px-3 py-2 text-xs pointer-events-none z-20 shadow-lg",
86108
- style: {
86109
- bottom: `calc(${percentage}% + 8px)`,
86110
- left: "50%",
86111
- transform: "translateX(-50%)"
86112
- },
86113
- initial: { opacity: 0, y: 10 },
86114
- animate: { opacity: 1, y: 0 },
86115
- transition: { duration: 0.2 },
86116
- children: [
86117
- /* @__PURE__ */ jsx("div", { className: "font-medium", children: labels[index2] || `Item ${index2 + 1}` }),
86118
- /* @__PURE__ */ jsx("div", { className: "text-muted-foreground", children: formatNumber2(value) })
86119
- ]
86120
- }
86121
- ),
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
+ })(),
86122
86137
  showDataLabels && /* @__PURE__ */ jsx(
86123
86138
  motion.span,
86124
86139
  {
@@ -86139,11 +86154,13 @@ function ChartWidget2({
86139
86154
  {
86140
86155
  className: cn(
86141
86156
  "w-full rounded-t cursor-pointer transition-all duration-200",
86157
+ "shadow-lg",
86142
86158
  isHovered && "brightness-110 scale-y-105"
86143
86159
  ),
86144
86160
  style: {
86145
- backgroundColor: chartColors[index2 % chartColors.length],
86146
- 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"
86147
86164
  },
86148
86165
  initial: { height: 0 },
86149
86166
  animate: { height: `${percentage}%` },
@@ -86185,9 +86202,12 @@ function ChartWidget2({
86185
86202
  const labels = data.labels || data.categories || [];
86186
86203
  if (values.length < 2)
86187
86204
  return null;
86205
+ const padding = 5;
86206
+ const chartWidth = 100 - padding * 2;
86207
+ const chartHeight = 100 - padding * 2;
86188
86208
  const points = values.map((value, index2) => {
86189
- const x = index2 / (values.length - 1) * 100;
86190
- const y = 100 - value / maxValue * 100;
86209
+ const x = padding + index2 / (values.length - 1) * chartWidth;
86210
+ const y = padding + (chartHeight - value / maxValue * chartHeight);
86191
86211
  return { x, y, value, label: labels[index2] };
86192
86212
  });
86193
86213
  const pathData = points.map((point, index2) => `${index2 === 0 ? "M" : "L"} ${point.x} ${point.y}`).join(" ");
@@ -86199,25 +86219,42 @@ function ChartWidget2({
86199
86219
  viewBox: "0 0 100 100",
86200
86220
  preserveAspectRatio: "none",
86201
86221
  children: [
86202
- showGrid && /* @__PURE__ */ jsx("g", { className: "opacity-20", children: [0, 25, 50, 75, 100].map((y) => /* @__PURE__ */ jsx(
86203
- "line",
86204
- {
86205
- x1: "0",
86206
- y1: y,
86207
- x2: "100",
86208
- y2: y,
86209
- stroke: "currentColor",
86210
- strokeWidth: "0.5"
86211
- },
86212
- y
86213
- )) }),
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
+ }) }),
86214
86249
  /* @__PURE__ */ jsx(
86215
86250
  motion.path,
86216
86251
  {
86217
86252
  d: pathData,
86218
86253
  fill: "none",
86219
- stroke: chartColors[0],
86220
- strokeWidth: "2",
86254
+ stroke: "url(#chartLineGradient)",
86255
+ strokeWidth: "1.5",
86256
+ strokeLinecap: "round",
86257
+ strokeLinejoin: "round",
86221
86258
  initial: { pathLength: 0 },
86222
86259
  animate: { pathLength: 1 },
86223
86260
  transition: { duration: animate5 ? 1 : 0 }
@@ -86226,8 +86263,8 @@ function ChartWidget2({
86226
86263
  type === "area" && /* @__PURE__ */ jsx(
86227
86264
  motion.path,
86228
86265
  {
86229
- d: `${pathData} L 100 100 L 0 100 Z`,
86230
- fill: `${chartColors[0]}20`,
86266
+ d: `${pathData} L ${90} ${90} L ${10} ${90} Z`,
86267
+ fill: "url(#chartAreaGradient)",
86231
86268
  initial: { opacity: 0 },
86232
86269
  animate: { opacity: 1 },
86233
86270
  transition: { duration: animate5 ? 0.5 : 0, delay: 0.5 }
@@ -86238,35 +86275,50 @@ function ChartWidget2({
86238
86275
  {
86239
86276
  cx: point.x,
86240
86277
  cy: point.y,
86241
- r: "2",
86278
+ r: "0.8",
86242
86279
  fill: chartColors[0],
86243
- initial: { r: 0 },
86244
- animate: { r: hoveredIndex === index2 ? 3 : 2 },
86280
+ stroke: "white",
86281
+ strokeWidth: "0.8",
86282
+ initial: { r: 0, opacity: 0 },
86283
+ animate: {
86284
+ r: hoveredIndex === index2 ? 1.5 : 0.8,
86285
+ opacity: 1,
86286
+ strokeWidth: hoveredIndex === index2 ? 1 : 0.8
86287
+ },
86245
86288
  onMouseEnter: () => setHoveredIndex(index2),
86246
86289
  onMouseLeave: () => setHoveredIndex(null),
86247
86290
  className: "cursor-pointer",
86248
- onClick: () => onDataPointClick?.(point)
86291
+ style: {
86292
+ shapeRendering: "geometricPrecision",
86293
+ vectorEffect: "non-scaling-stroke"
86294
+ },
86295
+ onClick: () => onDataPointClick?.(point),
86296
+ transition: { duration: 0.2 }
86249
86297
  },
86250
86298
  index2
86251
86299
  ))
86252
86300
  ]
86253
86301
  }
86254
86302
  ),
86255
- showTooltip && hoveredIndex !== null && points[hoveredIndex] && /* @__PURE__ */ jsxs(
86256
- "div",
86257
- {
86258
- className: "absolute bg-background border rounded px-2 py-1 text-xs pointer-events-none z-10",
86259
- style: {
86260
- left: `${Math.min(90, Math.max(10, points[hoveredIndex].x))}%`,
86261
- top: `${Math.min(85, Math.max(5, points[hoveredIndex].y))}%`,
86262
- transform: "translate(-50%, -150%)"
86263
- },
86264
- children: [
86265
- /* @__PURE__ */ jsx("div", { className: "font-medium", children: points[hoveredIndex].label }),
86266
- /* @__PURE__ */ jsx("div", { children: formatNumber2(points[hoveredIndex].value) })
86267
- ]
86268
- }
86269
- )
86303
+ showTooltip && hoveredIndex !== null && points[hoveredIndex] && (() => {
86304
+ const point = points[hoveredIndex];
86305
+ const showBelow = point.y < 30;
86306
+ return /* @__PURE__ */ jsxs(
86307
+ "div",
86308
+ {
86309
+ className: "absolute bg-background border rounded px-2 py-1 text-xs pointer-events-none z-10 shadow-lg",
86310
+ style: {
86311
+ left: `${Math.min(90, Math.max(10, point.x))}%`,
86312
+ top: showBelow ? `${point.y}%` : `${point.y}%`,
86313
+ transform: showBelow ? "translate(-50%, 10px)" : "translate(-50%, calc(-100% - 10px))"
86314
+ },
86315
+ children: [
86316
+ /* @__PURE__ */ jsx("div", { className: "font-medium", children: point.label }),
86317
+ /* @__PURE__ */ jsx("div", { children: formatNumber2(point.value) })
86318
+ ]
86319
+ }
86320
+ );
86321
+ })()
86270
86322
  ] });
86271
86323
  };
86272
86324
  const renderPieChart = () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moontra/moonui-pro",
3
- "version": "2.30.0",
3
+ "version": "2.30.2",
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",