@mlw-packages/react-components 1.9.12 → 1.9.13
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.d.mts +4 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.js +256 -217
- package/dist/index.mjs +256 -217
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -14664,7 +14664,8 @@ var DraggableTooltipComponent = ({
|
|
|
14664
14664
|
toggleHighlight,
|
|
14665
14665
|
showOnlyHighlighted,
|
|
14666
14666
|
valueFormatter,
|
|
14667
|
-
categoryFormatter
|
|
14667
|
+
categoryFormatter,
|
|
14668
|
+
seriesTypeMap
|
|
14668
14669
|
}) => {
|
|
14669
14670
|
const visibleKeys = React32.useMemo(
|
|
14670
14671
|
() => showOnlyHighlighted && highlightedSeries && highlightedSeries.size > 0 ? dataKeys.filter((k) => highlightedSeries.has(k)) : dataKeys,
|
|
@@ -14675,7 +14676,9 @@ var DraggableTooltipComponent = ({
|
|
|
14675
14676
|
const numeric = visibleKeys2.map((k) => data2[k]).filter((v) => typeof v === "number");
|
|
14676
14677
|
return numeric.reduce((s, v) => s + (v || 0), 0);
|
|
14677
14678
|
}, [data2, visibleKeys2]);
|
|
14678
|
-
const defaultTotalFormatted = total.toLocaleString("pt-BR"
|
|
14679
|
+
const defaultTotalFormatted = total.toLocaleString("pt-BR", {
|
|
14680
|
+
maximumFractionDigits: 0
|
|
14681
|
+
});
|
|
14679
14682
|
const displayTotal = localformatter ? localformatter({
|
|
14680
14683
|
value: total,
|
|
14681
14684
|
formattedValue: defaultTotalFormatted,
|
|
@@ -15130,7 +15133,13 @@ var DraggableTooltipComponent = ({
|
|
|
15130
15133
|
0
|
|
15131
15134
|
);
|
|
15132
15135
|
const val = typeof value === "number" ? value : Number(value) || 0;
|
|
15133
|
-
const
|
|
15136
|
+
const isLine = seriesTypeMap?.[key] === "line";
|
|
15137
|
+
const defaultFormatted = isLine ? `${(val / 100).toLocaleString("pt-BR", {
|
|
15138
|
+
minimumFractionDigits: 2,
|
|
15139
|
+
maximumFractionDigits: 2
|
|
15140
|
+
})}%` : val.toLocaleString("pt-BR", {
|
|
15141
|
+
maximumFractionDigits: 0
|
|
15142
|
+
});
|
|
15134
15143
|
const displayValue = valueFormatter ? valueFormatter({
|
|
15135
15144
|
value,
|
|
15136
15145
|
formattedValue: defaultFormatted,
|
|
@@ -15185,7 +15194,7 @@ var DraggableTooltipComponent = ({
|
|
|
15185
15194
|
children: displayValue
|
|
15186
15195
|
}
|
|
15187
15196
|
),
|
|
15188
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs text-muted-foreground", children: absDenominator > 0 ? `${pct.
|
|
15197
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs text-muted-foreground", children: absDenominator > 0 ? `${pct.toLocaleString("pt-BR", { minimumFractionDigits: 2, maximumFractionDigits: 2 })}%` : "-" })
|
|
15189
15198
|
] })
|
|
15190
15199
|
] }),
|
|
15191
15200
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full bg-muted rounded-full h-1 overflow-hidden", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -15249,7 +15258,8 @@ var RechartTooltipWithTotal = ({
|
|
|
15249
15258
|
valueFormatter,
|
|
15250
15259
|
categoryFormatter,
|
|
15251
15260
|
yAxisMap,
|
|
15252
|
-
isBiaxial = false
|
|
15261
|
+
isBiaxial = false,
|
|
15262
|
+
seriesTypeMap
|
|
15253
15263
|
}) => {
|
|
15254
15264
|
if (!active || !payload || payload.length === 0) return null;
|
|
15255
15265
|
const displayLabel = categoryFormatter ? categoryFormatter(String(label ?? "")) : label;
|
|
@@ -15258,18 +15268,9 @@ var RechartTooltipWithTotal = ({
|
|
|
15258
15268
|
);
|
|
15259
15269
|
const total = numeric.reduce((sum, p) => sum + (p.value || 0), 0);
|
|
15260
15270
|
const isTotalNegative = total < 0;
|
|
15261
|
-
const defaultTotalFormatted = (
|
|
15262
|
-
|
|
15263
|
-
|
|
15264
|
-
return new Intl.NumberFormat("pt-BR", {
|
|
15265
|
-
minimumFractionDigits: 2,
|
|
15266
|
-
maximumFractionDigits: 2
|
|
15267
|
-
}).format(total);
|
|
15268
|
-
}
|
|
15269
|
-
} catch {
|
|
15270
|
-
}
|
|
15271
|
-
return total.toLocaleString("pt-BR");
|
|
15272
|
-
})();
|
|
15271
|
+
const defaultTotalFormatted = total.toLocaleString("pt-BR", {
|
|
15272
|
+
maximumFractionDigits: 0
|
|
15273
|
+
});
|
|
15273
15274
|
const displayTotal = valueFormatter ? valueFormatter({
|
|
15274
15275
|
value: total,
|
|
15275
15276
|
formattedValue: defaultTotalFormatted,
|
|
@@ -15321,18 +15322,13 @@ var RechartTooltipWithTotal = ({
|
|
|
15321
15322
|
const pct = absDenominator > 0 ? Math.abs(value) / absDenominator * 100 : 0;
|
|
15322
15323
|
const baseColor = finalColors[entry.dataKey] || entry.color || "#999";
|
|
15323
15324
|
const isNeg = value < 0;
|
|
15324
|
-
const
|
|
15325
|
-
|
|
15326
|
-
|
|
15327
|
-
|
|
15328
|
-
|
|
15329
|
-
|
|
15330
|
-
|
|
15331
|
-
}
|
|
15332
|
-
} catch {
|
|
15333
|
-
}
|
|
15334
|
-
return value.toLocaleString("pt-BR");
|
|
15335
|
-
})();
|
|
15325
|
+
const isLine = seriesTypeMap?.[entry.dataKey] === "line";
|
|
15326
|
+
const defaultFormatted = isLine ? `${(value / 100).toLocaleString("pt-BR", {
|
|
15327
|
+
minimumFractionDigits: 2,
|
|
15328
|
+
maximumFractionDigits: 2
|
|
15329
|
+
})}%` : value.toLocaleString("pt-BR", {
|
|
15330
|
+
maximumFractionDigits: 0
|
|
15331
|
+
});
|
|
15336
15332
|
const displayValue = valueFormatter ? valueFormatter({
|
|
15337
15333
|
value: entry.value,
|
|
15338
15334
|
formattedValue: defaultFormatted,
|
|
@@ -15371,8 +15367,14 @@ var RechartTooltipWithTotal = ({
|
|
|
15371
15367
|
const axis = normalize(yAxisMap[entry.dataKey]);
|
|
15372
15368
|
const denom = axisDenominators[axis] || 0;
|
|
15373
15369
|
const p = denom > 0 ? Math.abs(value) / denom * 100 : 0;
|
|
15374
|
-
return denom > 0 ? `${p.
|
|
15375
|
-
|
|
15370
|
+
return denom > 0 ? `${p.toLocaleString("pt-BR", {
|
|
15371
|
+
minimumFractionDigits: 2,
|
|
15372
|
+
maximumFractionDigits: 2
|
|
15373
|
+
})}%` : "-";
|
|
15374
|
+
})() : absDenominator > 0 ? `${pct.toLocaleString("pt-BR", {
|
|
15375
|
+
minimumFractionDigits: 2,
|
|
15376
|
+
maximumFractionDigits: 2
|
|
15377
|
+
})}%` : "-" })
|
|
15376
15378
|
] })
|
|
15377
15379
|
] }),
|
|
15378
15380
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full bg-muted rounded-full h-1 overflow-hidden", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -15401,7 +15403,8 @@ var TooltipSimple = ({
|
|
|
15401
15403
|
valueFormatter,
|
|
15402
15404
|
categoryFormatter,
|
|
15403
15405
|
yAxisMap,
|
|
15404
|
-
isBiaxial = false
|
|
15406
|
+
isBiaxial = false,
|
|
15407
|
+
seriesTypeMap
|
|
15405
15408
|
}) => {
|
|
15406
15409
|
if (!active || !payload || payload.length === 0) return null;
|
|
15407
15410
|
const displayLabel = categoryFormatter ? categoryFormatter(String(label ?? "")) : label;
|
|
@@ -15434,18 +15437,13 @@ var TooltipSimple = ({
|
|
|
15434
15437
|
);
|
|
15435
15438
|
pct = axisSum > 0 ? Math.abs(value) / axisSum * 100 : 0;
|
|
15436
15439
|
}
|
|
15437
|
-
const
|
|
15438
|
-
|
|
15439
|
-
|
|
15440
|
-
|
|
15441
|
-
|
|
15442
|
-
|
|
15443
|
-
|
|
15444
|
-
}
|
|
15445
|
-
} catch {
|
|
15446
|
-
}
|
|
15447
|
-
return value.toLocaleString("pt-BR");
|
|
15448
|
-
})();
|
|
15440
|
+
const isLine = seriesTypeMap?.[entry.dataKey] === "line";
|
|
15441
|
+
const defaultFormatted = isLine ? `${(value / 100).toLocaleString("pt-BR", {
|
|
15442
|
+
minimumFractionDigits: 2,
|
|
15443
|
+
maximumFractionDigits: 2
|
|
15444
|
+
})}%` : value.toLocaleString("pt-BR", {
|
|
15445
|
+
maximumFractionDigits: 0
|
|
15446
|
+
});
|
|
15449
15447
|
const displayValue = valueFormatter ? valueFormatter({
|
|
15450
15448
|
value: entry.value,
|
|
15451
15449
|
formattedValue: defaultFormatted,
|
|
@@ -15476,7 +15474,10 @@ var TooltipSimple = ({
|
|
|
15476
15474
|
children: displayValue
|
|
15477
15475
|
}
|
|
15478
15476
|
),
|
|
15479
|
-
isBiaxial ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs text-muted-foreground", children: pct > 0 ? `${pct.
|
|
15477
|
+
isBiaxial ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs text-muted-foreground", children: pct > 0 ? `${pct.toLocaleString("pt-BR", {
|
|
15478
|
+
minimumFractionDigits: 2,
|
|
15479
|
+
maximumFractionDigits: 2
|
|
15480
|
+
})}%` : "-" }) : null
|
|
15480
15481
|
] }) })
|
|
15481
15482
|
]
|
|
15482
15483
|
},
|
|
@@ -16521,7 +16522,7 @@ var NoData = ({
|
|
|
16521
16522
|
"div",
|
|
16522
16523
|
{
|
|
16523
16524
|
className: cn(
|
|
16524
|
-
"rounded-xl bg-card relative overflow-hidden w-full
|
|
16525
|
+
"rounded-xl bg-card relative overflow-hidden w-full shadow-sm h-full",
|
|
16525
16526
|
className
|
|
16526
16527
|
),
|
|
16527
16528
|
style: {
|
|
@@ -17464,6 +17465,13 @@ var Chart = ({
|
|
|
17464
17465
|
maxTooltips,
|
|
17465
17466
|
effectiveChartWidth
|
|
17466
17467
|
});
|
|
17468
|
+
const seriesTypeMap = React32.useMemo(() => {
|
|
17469
|
+
const map = {};
|
|
17470
|
+
seriesOrder.forEach((s) => {
|
|
17471
|
+
map[s.key] = s.type;
|
|
17472
|
+
});
|
|
17473
|
+
return map;
|
|
17474
|
+
}, [seriesOrder]);
|
|
17467
17475
|
if (!data && !isLoading) return null;
|
|
17468
17476
|
if (isLoading) {
|
|
17469
17477
|
return /* @__PURE__ */ jsxRuntime.jsx(ChartWrapper, { className, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -17702,7 +17710,8 @@ var Chart = ({
|
|
|
17702
17710
|
finalColors,
|
|
17703
17711
|
valueFormatter: finalValueFormatter,
|
|
17704
17712
|
categoryFormatter,
|
|
17705
|
-
periodLabel
|
|
17713
|
+
periodLabel,
|
|
17714
|
+
seriesTypeMap
|
|
17706
17715
|
}
|
|
17707
17716
|
) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
17708
17717
|
TooltipSimple_default,
|
|
@@ -17710,7 +17719,8 @@ var Chart = ({
|
|
|
17710
17719
|
finalColors,
|
|
17711
17720
|
valueFormatter: finalValueFormatter,
|
|
17712
17721
|
categoryFormatter,
|
|
17713
|
-
periodLabel
|
|
17722
|
+
periodLabel,
|
|
17723
|
+
seriesTypeMap
|
|
17714
17724
|
}
|
|
17715
17725
|
),
|
|
17716
17726
|
cursor: { fill: "hsl(var(--muted))", opacity: 0.1 }
|
|
@@ -17898,7 +17908,8 @@ var Chart = ({
|
|
|
17898
17908
|
globalTooltipCount: activeTooltips.length,
|
|
17899
17909
|
onCloseAll: () => window.dispatchEvent(new Event("closeAllTooltips")),
|
|
17900
17910
|
closeAllButtonPosition: "top-center",
|
|
17901
|
-
closeAllButtonVariant: "floating"
|
|
17911
|
+
closeAllButtonVariant: "floating",
|
|
17912
|
+
seriesTypeMap
|
|
17902
17913
|
},
|
|
17903
17914
|
tooltip.id
|
|
17904
17915
|
)),
|
|
@@ -18050,6 +18061,13 @@ var HorizontalChart = ({
|
|
|
18050
18061
|
setActiveTooltips
|
|
18051
18062
|
]
|
|
18052
18063
|
);
|
|
18064
|
+
const seriesTypeMap = React32.useMemo(() => {
|
|
18065
|
+
const map = {};
|
|
18066
|
+
seriesOrder.forEach((s) => {
|
|
18067
|
+
map[s.key] = s.type;
|
|
18068
|
+
});
|
|
18069
|
+
return map;
|
|
18070
|
+
}, [seriesOrder]);
|
|
18053
18071
|
if (!data && !isLoading) return null;
|
|
18054
18072
|
if (isLoading) {
|
|
18055
18073
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -18289,7 +18307,8 @@ var HorizontalChart = ({
|
|
|
18289
18307
|
finalColors,
|
|
18290
18308
|
valueFormatter: finalValueFormatter,
|
|
18291
18309
|
categoryFormatter,
|
|
18292
|
-
periodLabel
|
|
18310
|
+
periodLabel,
|
|
18311
|
+
seriesTypeMap
|
|
18293
18312
|
}
|
|
18294
18313
|
) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
18295
18314
|
TooltipSimple_default,
|
|
@@ -18297,7 +18316,8 @@ var HorizontalChart = ({
|
|
|
18297
18316
|
finalColors,
|
|
18298
18317
|
valueFormatter: finalValueFormatter,
|
|
18299
18318
|
categoryFormatter,
|
|
18300
|
-
periodLabel
|
|
18319
|
+
periodLabel,
|
|
18320
|
+
seriesTypeMap
|
|
18301
18321
|
}
|
|
18302
18322
|
),
|
|
18303
18323
|
cursor: { fill: "hsl(var(--muted))", opacity: 0.1 }
|
|
@@ -18383,7 +18403,8 @@ var HorizontalChart = ({
|
|
|
18383
18403
|
globalTooltipCount: activeTooltips.length,
|
|
18384
18404
|
onCloseAll: () => window.dispatchEvent(new Event("closeAllTooltips")),
|
|
18385
18405
|
closeAllButtonPosition: "top-center",
|
|
18386
|
-
closeAllButtonVariant: "floating"
|
|
18406
|
+
closeAllButtonVariant: "floating",
|
|
18407
|
+
seriesTypeMap
|
|
18387
18408
|
},
|
|
18388
18409
|
tooltip.id
|
|
18389
18410
|
)),
|
|
@@ -18690,11 +18711,20 @@ var ZoomImage = React32__namespace.forwardRef(
|
|
|
18690
18711
|
mouseX.set(x);
|
|
18691
18712
|
mouseY.set(y);
|
|
18692
18713
|
};
|
|
18693
|
-
const
|
|
18694
|
-
|
|
18695
|
-
|
|
18696
|
-
|
|
18697
|
-
|
|
18714
|
+
const innerRef = React32__namespace.useRef(null);
|
|
18715
|
+
React32__namespace.useImperativeHandle(ref, () => innerRef.current);
|
|
18716
|
+
React32__namespace.useEffect(() => {
|
|
18717
|
+
const element = innerRef.current;
|
|
18718
|
+
if (!element) return;
|
|
18719
|
+
const onWheel = (e) => {
|
|
18720
|
+
e.preventDefault();
|
|
18721
|
+
const delta = -e.deltaY * 5e-3;
|
|
18722
|
+
const newZoom = Math.min(Math.max(1, zoomLevel.get() + delta), maxZoom);
|
|
18723
|
+
zoomLevel.set(newZoom);
|
|
18724
|
+
};
|
|
18725
|
+
element.addEventListener("wheel", onWheel, { passive: false });
|
|
18726
|
+
return () => element.removeEventListener("wheel", onWheel);
|
|
18727
|
+
}, [maxZoom, zoomLevel]);
|
|
18698
18728
|
const handleMouseLeave = () => {
|
|
18699
18729
|
if (!isPinching.current) {
|
|
18700
18730
|
mouseX.set(50);
|
|
@@ -18752,7 +18782,7 @@ var ZoomImage = React32__namespace.forwardRef(
|
|
|
18752
18782
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
18753
18783
|
framerMotion.motion.div,
|
|
18754
18784
|
{
|
|
18755
|
-
ref,
|
|
18785
|
+
ref: innerRef,
|
|
18756
18786
|
className: cn(
|
|
18757
18787
|
"relative w-full h-full overflow-hidden touch-none",
|
|
18758
18788
|
className
|
|
@@ -18760,7 +18790,6 @@ var ZoomImage = React32__namespace.forwardRef(
|
|
|
18760
18790
|
style: { borderRadius: `${borderRadius}px` },
|
|
18761
18791
|
onMouseMove: handleMouseMove,
|
|
18762
18792
|
onMouseLeave: handleMouseLeave,
|
|
18763
|
-
onWheel: handleWheel,
|
|
18764
18793
|
onTouchStart: handleTouchStart,
|
|
18765
18794
|
onTouchMove: handleTouchMove,
|
|
18766
18795
|
onTouchEnd: handleTouchEnd,
|
|
@@ -18811,11 +18840,17 @@ var Lens = ({
|
|
|
18811
18840
|
const y = e.clientY - rect.top;
|
|
18812
18841
|
setMousePosition({ x, y });
|
|
18813
18842
|
};
|
|
18814
|
-
|
|
18815
|
-
|
|
18816
|
-
|
|
18817
|
-
|
|
18818
|
-
|
|
18843
|
+
React32__namespace.default.useEffect(() => {
|
|
18844
|
+
const element = containerRef.current;
|
|
18845
|
+
if (!element || !isActivated) return;
|
|
18846
|
+
const onWheel = (e) => {
|
|
18847
|
+
e.preventDefault();
|
|
18848
|
+
const delta = -e.deltaY * 5e-3;
|
|
18849
|
+
setZoomFactor((prev) => Math.min(Math.max(1.1, prev + delta), maxZoom));
|
|
18850
|
+
};
|
|
18851
|
+
element.addEventListener("wheel", onWheel, { passive: false });
|
|
18852
|
+
return () => element.removeEventListener("wheel", onWheel);
|
|
18853
|
+
}, [isActivated, maxZoom]);
|
|
18819
18854
|
const resetZoom = () => {
|
|
18820
18855
|
setZoomFactor(initialZoom);
|
|
18821
18856
|
setIsActivated(false);
|
|
@@ -18837,7 +18872,6 @@ var Lens = ({
|
|
|
18837
18872
|
resetZoom();
|
|
18838
18873
|
},
|
|
18839
18874
|
onMouseMove: handleMouseMove,
|
|
18840
|
-
onWheel: handleWheel,
|
|
18841
18875
|
children: [
|
|
18842
18876
|
children,
|
|
18843
18877
|
isStatic ? /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
@@ -18876,9 +18910,9 @@ var Lens = ({
|
|
|
18876
18910
|
top: position.y - lensSize / 2,
|
|
18877
18911
|
width: lensSize,
|
|
18878
18912
|
height: lensSize,
|
|
18879
|
-
borderRadius: "
|
|
18880
|
-
boxShadow: "0 8px
|
|
18881
|
-
background: "radial-gradient(circle at center, transparent
|
|
18913
|
+
borderRadius: "10%",
|
|
18914
|
+
boxShadow: "0 8px 12px rgba(0, 0, 0, 1), 0 4px 16px rgba(5,3, 1, 1)",
|
|
18915
|
+
background: "radial-gradient(circle at center, transparent 100%, rgba(255, 255, 255, 1) 100%, rgba(255, 255, 255, 1) 100%, transparent 100%)"
|
|
18882
18916
|
}
|
|
18883
18917
|
}
|
|
18884
18918
|
)
|
|
@@ -19018,7 +19052,8 @@ function CarouselBase({
|
|
|
19018
19052
|
}) {
|
|
19019
19053
|
const isMobile = useIsMobile();
|
|
19020
19054
|
const [index, setIndex] = React32.useState(0);
|
|
19021
|
-
const
|
|
19055
|
+
const options = React32.useMemo(() => ({ loop: true }), []);
|
|
19056
|
+
const [emblaRef, emblaApi] = useEmblaCarousel__default.default(options);
|
|
19022
19057
|
const [isDownloading, setIsDownloading] = React32.useState(false);
|
|
19023
19058
|
const [downloadSuccess, setDownloadSuccess] = React32.useState(false);
|
|
19024
19059
|
React32.useEffect(() => {
|
|
@@ -19040,11 +19075,6 @@ function CarouselBase({
|
|
|
19040
19075
|
}, autoPlayInterval);
|
|
19041
19076
|
return () => clearInterval(interval);
|
|
19042
19077
|
}, [autoPlay, autoPlayInterval, items.length, emblaApi]);
|
|
19043
|
-
React32.useEffect(() => {
|
|
19044
|
-
if (emblaApi && index !== emblaApi.selectedScrollSnap()) {
|
|
19045
|
-
emblaApi.scrollTo(index);
|
|
19046
|
-
}
|
|
19047
|
-
}, [index, emblaApi]);
|
|
19048
19078
|
const handleDownload = async () => {
|
|
19049
19079
|
if (isDownloading) return;
|
|
19050
19080
|
setIsDownloading(true);
|
|
@@ -19092,16 +19122,13 @@ function CarouselBase({
|
|
|
19092
19122
|
transition: { duration: 0.4 },
|
|
19093
19123
|
className: cn("w-full lg:p-10 sm:p-4 p-2", className),
|
|
19094
19124
|
style: { width, height },
|
|
19095
|
-
children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-col gap-3 h-full", children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
19096
|
-
|
|
19097
|
-
|
|
19098
|
-
|
|
19099
|
-
|
|
19100
|
-
|
|
19101
|
-
|
|
19102
|
-
ref: emblaRef,
|
|
19103
|
-
children: [
|
|
19104
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex h-full", children: items.map((item) => /* @__PURE__ */ jsxRuntime.jsx("div", { className: "shrink-0 w-full h-full min-w-0", children: isMobile || zoomEffect === "scale" ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
19125
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-col gap-3 h-full", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("relative h-full", containerClassName), children: [
|
|
19126
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
19127
|
+
"div",
|
|
19128
|
+
{
|
|
19129
|
+
ref: emblaRef,
|
|
19130
|
+
className: "overflow-hidden rounded-lg h-full cursor-grab active:cursor-grabbing",
|
|
19131
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex h-full", children: items.map((item) => /* @__PURE__ */ jsxRuntime.jsx("div", { className: "shrink-0 w-full h-full min-w-0", children: isMobile || zoomEffect === "scale" ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
19105
19132
|
ZoomImage,
|
|
19106
19133
|
{
|
|
19107
19134
|
src: item.url,
|
|
@@ -19133,154 +19160,166 @@ function CarouselBase({
|
|
|
19133
19160
|
),
|
|
19134
19161
|
draggable: false
|
|
19135
19162
|
}
|
|
19136
|
-
) }, item.id)) })
|
|
19137
|
-
|
|
19138
|
-
|
|
19163
|
+
) }, item.id)) })
|
|
19164
|
+
}
|
|
19165
|
+
),
|
|
19166
|
+
download && /* @__PURE__ */ jsxRuntime.jsx(
|
|
19167
|
+
framerMotion.motion.button,
|
|
19168
|
+
{
|
|
19169
|
+
onClick: handleDownload,
|
|
19170
|
+
onPointerDown: (e) => e.stopPropagation(),
|
|
19171
|
+
onTouchStart: (e) => e.stopPropagation(),
|
|
19172
|
+
onMouseDown: (e) => e.stopPropagation(),
|
|
19173
|
+
className: cn(
|
|
19174
|
+
"absolute top-4 right-4 z-50 p-2 rounded-full text-white transition-colors border border-white/10",
|
|
19175
|
+
downloadSuccess ? "bg-green-500 hover:bg-green-600" : "bg-black/50 hover:bg-black/70"
|
|
19176
|
+
),
|
|
19177
|
+
title: "Download image",
|
|
19178
|
+
initial: false,
|
|
19179
|
+
animate: {
|
|
19180
|
+
scale: isDownloading ? 0.9 : 1,
|
|
19181
|
+
backgroundColor: downloadSuccess ? "rgb(34, 197, 94)" : "rgba(0, 0, 0, 0.5)"
|
|
19182
|
+
},
|
|
19183
|
+
whileHover: { scale: 1.05 },
|
|
19184
|
+
whileTap: { scale: 0.95 },
|
|
19185
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(framerMotion.AnimatePresence, { mode: "wait", initial: false, children: isDownloading ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
19186
|
+
framerMotion.motion.svg,
|
|
19139
19187
|
{
|
|
19140
|
-
|
|
19141
|
-
|
|
19142
|
-
|
|
19143
|
-
|
|
19144
|
-
|
|
19145
|
-
|
|
19146
|
-
|
|
19147
|
-
|
|
19148
|
-
|
|
19149
|
-
|
|
19188
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
19189
|
+
width: "20",
|
|
19190
|
+
height: "20",
|
|
19191
|
+
viewBox: "0 0 24 24",
|
|
19192
|
+
fill: "none",
|
|
19193
|
+
stroke: "currentColor",
|
|
19194
|
+
strokeWidth: "2",
|
|
19195
|
+
strokeLinecap: "round",
|
|
19196
|
+
strokeLinejoin: "round",
|
|
19197
|
+
animate: { rotate: 360 },
|
|
19198
|
+
transition: {
|
|
19199
|
+
repeat: Infinity,
|
|
19200
|
+
ease: "linear",
|
|
19201
|
+
duration: 1
|
|
19150
19202
|
},
|
|
19151
|
-
|
|
19152
|
-
|
|
19153
|
-
|
|
19154
|
-
|
|
19155
|
-
|
|
19156
|
-
|
|
19157
|
-
|
|
19158
|
-
|
|
19159
|
-
|
|
19160
|
-
|
|
19161
|
-
|
|
19162
|
-
|
|
19163
|
-
|
|
19164
|
-
|
|
19165
|
-
|
|
19166
|
-
|
|
19167
|
-
|
|
19168
|
-
|
|
19169
|
-
|
|
19170
|
-
|
|
19171
|
-
|
|
19172
|
-
|
|
19173
|
-
|
|
19174
|
-
|
|
19175
|
-
|
|
19176
|
-
|
|
19177
|
-
|
|
19178
|
-
|
|
19179
|
-
|
|
19180
|
-
|
|
19181
|
-
|
|
19182
|
-
|
|
19183
|
-
|
|
19184
|
-
|
|
19185
|
-
|
|
19186
|
-
|
|
19187
|
-
|
|
19188
|
-
|
|
19189
|
-
|
|
19190
|
-
}
|
|
19191
|
-
|
|
19192
|
-
|
|
19193
|
-
|
|
19194
|
-
|
|
19195
|
-
|
|
19196
|
-
|
|
19197
|
-
|
|
19198
|
-
|
|
19199
|
-
|
|
19200
|
-
|
|
19201
|
-
|
|
19202
|
-
|
|
19203
|
-
|
|
19204
|
-
|
|
19205
|
-
|
|
19206
|
-
|
|
19207
|
-
children: [
|
|
19208
|
-
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" }),
|
|
19209
|
-
/* @__PURE__ */ jsxRuntime.jsx("polyline", { points: "7 10 12 15 17 10" }),
|
|
19210
|
-
/* @__PURE__ */ jsxRuntime.jsx("line", { x1: "12", x2: "12", y1: "15", y2: "3" })
|
|
19211
|
-
]
|
|
19212
|
-
},
|
|
19213
|
-
"download"
|
|
19214
|
-
) })
|
|
19215
|
-
}
|
|
19216
|
-
),
|
|
19217
|
-
showControls && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
19218
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
19219
|
-
framerMotion.motion.button,
|
|
19220
|
-
{
|
|
19221
|
-
disabled: !emblaApi?.canScrollPrev(),
|
|
19222
|
-
onClick: () => emblaApi?.scrollPrev(),
|
|
19223
|
-
className: `absolute left-4 top-1/2 -translate-y-1/2 w-10 h-10 rounded-full flex items-center justify-center shadow-lg transition-transform z-30
|
|
19203
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M21 12a9 9 0 1 1-6.219-8.56" })
|
|
19204
|
+
},
|
|
19205
|
+
"loading"
|
|
19206
|
+
) : downloadSuccess ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
19207
|
+
framerMotion.motion.svg,
|
|
19208
|
+
{
|
|
19209
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
19210
|
+
width: "20",
|
|
19211
|
+
height: "20",
|
|
19212
|
+
viewBox: "0 0 24 24",
|
|
19213
|
+
fill: "none",
|
|
19214
|
+
stroke: "currentColor",
|
|
19215
|
+
strokeWidth: "2",
|
|
19216
|
+
strokeLinecap: "round",
|
|
19217
|
+
strokeLinejoin: "round",
|
|
19218
|
+
initial: { scale: 0.5, opacity: 0 },
|
|
19219
|
+
animate: { scale: 1, opacity: 1 },
|
|
19220
|
+
exit: { scale: 0.5, opacity: 0 },
|
|
19221
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("polyline", { points: "20 6 9 17 4 12" })
|
|
19222
|
+
},
|
|
19223
|
+
"success"
|
|
19224
|
+
) : /* @__PURE__ */ jsxRuntime.jsxs(
|
|
19225
|
+
framerMotion.motion.svg,
|
|
19226
|
+
{
|
|
19227
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
19228
|
+
width: "20",
|
|
19229
|
+
height: "20",
|
|
19230
|
+
viewBox: "0 0 24 24",
|
|
19231
|
+
fill: "none",
|
|
19232
|
+
stroke: "currentColor",
|
|
19233
|
+
strokeWidth: "2",
|
|
19234
|
+
strokeLinecap: "round",
|
|
19235
|
+
strokeLinejoin: "round",
|
|
19236
|
+
initial: { scale: 0.5, opacity: 0 },
|
|
19237
|
+
animate: { scale: 1, opacity: 1 },
|
|
19238
|
+
exit: { scale: 0.5, opacity: 0 },
|
|
19239
|
+
children: [
|
|
19240
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" }),
|
|
19241
|
+
/* @__PURE__ */ jsxRuntime.jsx("polyline", { points: "7 10 12 15 17 10" }),
|
|
19242
|
+
/* @__PURE__ */ jsxRuntime.jsx("line", { x1: "12", x2: "12", y1: "15", y2: "3" })
|
|
19243
|
+
]
|
|
19244
|
+
},
|
|
19245
|
+
"download"
|
|
19246
|
+
) })
|
|
19247
|
+
}
|
|
19248
|
+
),
|
|
19249
|
+
showControls && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
19250
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
19251
|
+
framerMotion.motion.button,
|
|
19252
|
+
{
|
|
19253
|
+
disabled: !emblaApi?.canScrollPrev(),
|
|
19254
|
+
onClick: () => emblaApi?.scrollPrev(),
|
|
19255
|
+
onPointerDown: (e) => e.stopPropagation(),
|
|
19256
|
+
onTouchStart: (e) => e.stopPropagation(),
|
|
19257
|
+
onMouseDown: (e) => e.stopPropagation(),
|
|
19258
|
+
className: `absolute left-4 top-1/2 -translate-y-1/2 w-10 h-10 rounded-full flex items-center justify-center shadow-lg transition-transform z-50
|
|
19224
19259
|
${!emblaApi?.canScrollPrev() ? "opacity-40 cursor-not-allowed" : "bg-secondary hover:scale-110 hover:opacity-100 opacity-70"}`,
|
|
19260
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
19261
|
+
"svg",
|
|
19262
|
+
{
|
|
19263
|
+
className: "w-6 h-6",
|
|
19264
|
+
fill: "none",
|
|
19265
|
+
stroke: "currentColor",
|
|
19266
|
+
viewBox: "0 0 24 24",
|
|
19225
19267
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
19226
|
-
"
|
|
19268
|
+
"path",
|
|
19227
19269
|
{
|
|
19228
|
-
|
|
19229
|
-
|
|
19230
|
-
|
|
19231
|
-
|
|
19232
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
19233
|
-
"path",
|
|
19234
|
-
{
|
|
19235
|
-
strokeLinecap: "round",
|
|
19236
|
-
strokeLinejoin: "round",
|
|
19237
|
-
strokeWidth: 2,
|
|
19238
|
-
d: "M15 19l-7-7 7-7"
|
|
19239
|
-
}
|
|
19240
|
-
)
|
|
19270
|
+
strokeLinecap: "round",
|
|
19271
|
+
strokeLinejoin: "round",
|
|
19272
|
+
strokeWidth: 2,
|
|
19273
|
+
d: "M15 19l-7-7 7-7"
|
|
19241
19274
|
}
|
|
19242
19275
|
)
|
|
19243
19276
|
}
|
|
19244
|
-
)
|
|
19245
|
-
|
|
19246
|
-
|
|
19247
|
-
|
|
19248
|
-
|
|
19249
|
-
|
|
19250
|
-
|
|
19277
|
+
)
|
|
19278
|
+
}
|
|
19279
|
+
),
|
|
19280
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
19281
|
+
framerMotion.motion.button,
|
|
19282
|
+
{
|
|
19283
|
+
disabled: !emblaApi?.canScrollNext(),
|
|
19284
|
+
onClick: () => emblaApi?.scrollNext(),
|
|
19285
|
+
onPointerDown: (e) => e.stopPropagation(),
|
|
19286
|
+
onTouchStart: (e) => e.stopPropagation(),
|
|
19287
|
+
onMouseDown: (e) => e.stopPropagation(),
|
|
19288
|
+
className: `absolute right-4 top-1/2 -translate-y-1/2 w-10 h-10 rounded-full flex items-center justify-center shadow-lg transition-transform z-50
|
|
19251
19289
|
${!emblaApi?.canScrollNext() ? "opacity-40 cursor-not-allowed" : "bg-secondary hover:scale-110 hover:opacity-100 opacity-70"}`,
|
|
19290
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
19291
|
+
"svg",
|
|
19292
|
+
{
|
|
19293
|
+
className: "w-6 h-6",
|
|
19294
|
+
fill: "none",
|
|
19295
|
+
stroke: "currentColor",
|
|
19296
|
+
viewBox: "0 0 24 24",
|
|
19252
19297
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
19253
|
-
"
|
|
19298
|
+
"path",
|
|
19254
19299
|
{
|
|
19255
|
-
|
|
19256
|
-
|
|
19257
|
-
|
|
19258
|
-
|
|
19259
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
19260
|
-
"path",
|
|
19261
|
-
{
|
|
19262
|
-
strokeLinecap: "round",
|
|
19263
|
-
strokeLinejoin: "round",
|
|
19264
|
-
strokeWidth: 2,
|
|
19265
|
-
d: "M9 5l7 7-7 7"
|
|
19266
|
-
}
|
|
19267
|
-
)
|
|
19300
|
+
strokeLinecap: "round",
|
|
19301
|
+
strokeLinejoin: "round",
|
|
19302
|
+
strokeWidth: 2,
|
|
19303
|
+
d: "M9 5l7 7-7 7"
|
|
19268
19304
|
}
|
|
19269
19305
|
)
|
|
19270
19306
|
}
|
|
19271
19307
|
)
|
|
19272
|
-
|
|
19273
|
-
|
|
19274
|
-
|
|
19275
|
-
|
|
19276
|
-
|
|
19277
|
-
|
|
19278
|
-
|
|
19279
|
-
|
|
19280
|
-
)
|
|
19281
|
-
|
|
19282
|
-
|
|
19283
|
-
|
|
19308
|
+
}
|
|
19309
|
+
)
|
|
19310
|
+
] }),
|
|
19311
|
+
showIndicators && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute bottom-4 left-1/2 -translate-x-1/2 flex gap-2 z-50", children: items.map((_, i) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
19312
|
+
"button",
|
|
19313
|
+
{
|
|
19314
|
+
onClick: () => emblaApi?.scrollTo(i),
|
|
19315
|
+
onPointerDown: (e) => e.stopPropagation(),
|
|
19316
|
+
onTouchStart: (e) => e.stopPropagation(),
|
|
19317
|
+
onMouseDown: (e) => e.stopPropagation(),
|
|
19318
|
+
className: `h-2 rounded-full transition-all ${i === index ? "w-8 bg-white" : "w-2 bg-white/50"}`
|
|
19319
|
+
},
|
|
19320
|
+
i
|
|
19321
|
+
)) })
|
|
19322
|
+
] }) })
|
|
19284
19323
|
},
|
|
19285
19324
|
"carousel-content"
|
|
19286
19325
|
) });
|