@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.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 defaultFormatted = val.toLocaleString("pt-BR");
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.toFixed(1)}%` : "-" })
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
- try {
15263
- if (Math.abs(total) < 1e3) {
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 defaultFormatted = (() => {
15325
- try {
15326
- if (Math.abs(value) < 1e3) {
15327
- return new Intl.NumberFormat("pt-BR", {
15328
- minimumFractionDigits: 2,
15329
- maximumFractionDigits: 2
15330
- }).format(value);
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.toFixed(1)}%` : "-";
15375
- })() : absDenominator > 0 ? `${pct.toFixed(1)}%` : "-" })
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 defaultFormatted = (() => {
15438
- try {
15439
- if (Math.abs(value) < 1e3) {
15440
- return new Intl.NumberFormat("pt-BR", {
15441
- minimumFractionDigits: 2,
15442
- maximumFractionDigits: 2
15443
- }).format(value);
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.toFixed(1)}%` : "-" }) : null
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 border border-border/50 shadow-sm h-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 handleWheel = (e) => {
18694
- const delta = -e.deltaY * 5e-3;
18695
- const newZoom = Math.min(Math.max(1, zoomLevel.get() + delta), maxZoom);
18696
- zoomLevel.set(newZoom);
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
- const handleWheel = (e) => {
18815
- if (!isActivated) return;
18816
- const delta = -e.deltaY * 5e-3;
18817
- setZoomFactor((prev) => Math.min(Math.max(1.1, prev + delta), maxZoom));
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: "50%",
18880
- boxShadow: "0 8px 32px rgba(0, 0, 0, 0.4), 0 4px 16px rgba(0, 0, 0, 0.2)",
18881
- background: "radial-gradient(circle at center, transparent 60%, rgba(255, 255, 255, 0.1) 70%, rgba(255, 255, 255, 0.2) 80%, transparent 100%)"
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 [emblaRef, emblaApi] = useEmblaCarousel__default.default({ loop: true });
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
- "div",
19097
- {
19098
- className: cn(
19099
- "relative overflow-hidden rounded-lg h-full cursor-grab active:cursor-grabbing",
19100
- containerClassName
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
- download && /* @__PURE__ */ jsxRuntime.jsx(
19138
- framerMotion.motion.button,
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
- onClick: handleDownload,
19141
- className: cn(
19142
- "absolute top-4 right-4 z-30 p-2 rounded-full text-white transition-colors border border-white/10",
19143
- downloadSuccess ? "bg-green-500 hover:bg-green-600" : "bg-black/50 hover:bg-black/70"
19144
- ),
19145
- title: "Download image",
19146
- initial: false,
19147
- animate: {
19148
- scale: isDownloading ? 0.9 : 1,
19149
- backgroundColor: downloadSuccess ? "rgb(34, 197, 94)" : "rgba(0, 0, 0, 0.5)"
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
- whileHover: { scale: 1.05 },
19152
- whileTap: { scale: 0.95 },
19153
- children: /* @__PURE__ */ jsxRuntime.jsx(framerMotion.AnimatePresence, { mode: "wait", initial: false, children: isDownloading ? /* @__PURE__ */ jsxRuntime.jsx(
19154
- framerMotion.motion.svg,
19155
- {
19156
- xmlns: "http://www.w3.org/2000/svg",
19157
- width: "20",
19158
- height: "20",
19159
- viewBox: "0 0 24 24",
19160
- fill: "none",
19161
- stroke: "currentColor",
19162
- strokeWidth: "2",
19163
- strokeLinecap: "round",
19164
- strokeLinejoin: "round",
19165
- animate: { rotate: 360 },
19166
- transition: {
19167
- repeat: Infinity,
19168
- ease: "linear",
19169
- duration: 1
19170
- },
19171
- children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M21 12a9 9 0 1 1-6.219-8.56" })
19172
- },
19173
- "loading"
19174
- ) : downloadSuccess ? /* @__PURE__ */ jsxRuntime.jsx(
19175
- framerMotion.motion.svg,
19176
- {
19177
- xmlns: "http://www.w3.org/2000/svg",
19178
- width: "20",
19179
- height: "20",
19180
- viewBox: "0 0 24 24",
19181
- fill: "none",
19182
- stroke: "currentColor",
19183
- strokeWidth: "2",
19184
- strokeLinecap: "round",
19185
- strokeLinejoin: "round",
19186
- initial: { scale: 0.5, opacity: 0 },
19187
- animate: { scale: 1, opacity: 1 },
19188
- exit: { scale: 0.5, opacity: 0 },
19189
- children: /* @__PURE__ */ jsxRuntime.jsx("polyline", { points: "20 6 9 17 4 12" })
19190
- },
19191
- "success"
19192
- ) : /* @__PURE__ */ jsxRuntime.jsxs(
19193
- framerMotion.motion.svg,
19194
- {
19195
- xmlns: "http://www.w3.org/2000/svg",
19196
- width: "20",
19197
- height: "20",
19198
- viewBox: "0 0 24 24",
19199
- fill: "none",
19200
- stroke: "currentColor",
19201
- strokeWidth: "2",
19202
- strokeLinecap: "round",
19203
- strokeLinejoin: "round",
19204
- initial: { scale: 0.5, opacity: 0 },
19205
- animate: { scale: 1, opacity: 1 },
19206
- exit: { scale: 0.5, opacity: 0 },
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
- "svg",
19268
+ "path",
19227
19269
  {
19228
- className: "w-6 h-6",
19229
- fill: "none",
19230
- stroke: "currentColor",
19231
- viewBox: "0 0 24 24",
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
- /* @__PURE__ */ jsxRuntime.jsx(
19246
- framerMotion.motion.button,
19247
- {
19248
- disabled: !emblaApi?.canScrollNext(),
19249
- onClick: () => emblaApi?.scrollNext(),
19250
- 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-30
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
- "svg",
19298
+ "path",
19254
19299
  {
19255
- className: "w-6 h-6",
19256
- fill: "none",
19257
- stroke: "currentColor",
19258
- viewBox: "0 0 24 24",
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
- showIndicators && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute bottom-4 left-1/2 -translate-x-1/2 flex gap-2", children: items.map((_, i) => /* @__PURE__ */ jsxRuntime.jsx(
19274
- "button",
19275
- {
19276
- onClick: () => emblaApi?.scrollTo(i),
19277
- className: `h-2 rounded-full transition-all ${i === index ? "w-8 bg-white" : "w-2 bg-white/50"}`
19278
- },
19279
- i
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
  ) });