@mlw-packages/react-components 1.9.11 → 1.9.12

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
@@ -43,6 +43,7 @@ var core = require('@dnd-kit/core');
43
43
  var utilities = require('@dnd-kit/utilities');
44
44
  var reactRadioGroup = require('@radix-ui/react-radio-group');
45
45
  var recharts = require('recharts');
46
+ var useEmblaCarousel = require('embla-carousel-react');
46
47
 
47
48
  function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
48
49
 
@@ -84,6 +85,7 @@ var TabsPrimitive__namespace = /*#__PURE__*/_interopNamespace(TabsPrimitive);
84
85
  var NavigationMenuPrimitive__namespace = /*#__PURE__*/_interopNamespace(NavigationMenuPrimitive);
85
86
  var ContextMenuPrimitive__namespace = /*#__PURE__*/_interopNamespace(ContextMenuPrimitive);
86
87
  var ptBR3__default = /*#__PURE__*/_interopDefault(ptBR3);
88
+ var useEmblaCarousel__default = /*#__PURE__*/_interopDefault(useEmblaCarousel);
87
89
 
88
90
  var __create = Object.create;
89
91
  var __defProp = Object.defineProperty;
@@ -3755,7 +3757,7 @@ var FileUploader = React32__namespace.forwardRef(
3755
3757
  showPreview = true,
3756
3758
  dropzoneText = "Arraste arquivos aqui ou clique para selecionar",
3757
3759
  dropzoneSubtext,
3758
- animate: animate2 = true,
3760
+ animate = true,
3759
3761
  ...props
3760
3762
  }, ref) => {
3761
3763
  const [isDragging, setIsDragging] = React32__namespace.useState(false);
@@ -3963,7 +3965,7 @@ var FileUploader = React32__namespace.forwardRef(
3963
3965
  framerMotion.motion.p,
3964
3966
  {
3965
3967
  className: "mb-2 text-base font-semibold text-foreground",
3966
- initial: animate2 ? { opacity: 0, y: -10 } : false,
3968
+ initial: animate ? { opacity: 0, y: -10 } : false,
3967
3969
  animate: { opacity: 1, y: 0 },
3968
3970
  transition: { delay: 0.1 },
3969
3971
  children: dropzoneText
@@ -3973,7 +3975,7 @@ var FileUploader = React32__namespace.forwardRef(
3973
3975
  framerMotion.motion.p,
3974
3976
  {
3975
3977
  className: "text-sm text-muted-foreground",
3976
- initial: animate2 ? { opacity: 0, y: -10 } : false,
3978
+ initial: animate ? { opacity: 0, y: -10 } : false,
3977
3979
  animate: { opacity: 1, y: 0 },
3978
3980
  transition: { delay: 0.2 },
3979
3981
  children: defaultSubtext
@@ -4017,7 +4019,7 @@ var FileUploader = React32__namespace.forwardRef(
4017
4019
  framerMotion.motion.div,
4018
4020
  {
4019
4021
  className: "mt-6 w-full",
4020
- initial: animate2 ? { opacity: 0, y: 10 } : false,
4022
+ initial: animate ? { opacity: 0, y: 10 } : false,
4021
4023
  animate: { opacity: 1, y: 0 },
4022
4024
  transition: { delay: 0.3 },
4023
4025
  children: /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
@@ -4032,7 +4034,7 @@ var FileUploader = React32__namespace.forwardRef(
4032
4034
  framerMotion.motion.div,
4033
4035
  {
4034
4036
  layout: true,
4035
- initial: animate2 ? { opacity: 0, x: -20 } : false,
4037
+ initial: animate ? { opacity: 0, x: -20 } : false,
4036
4038
  animate: { opacity: 1, x: 0 },
4037
4039
  exit: {
4038
4040
  opacity: 0,
@@ -4040,7 +4042,7 @@ var FileUploader = React32__namespace.forwardRef(
4040
4042
  transition: { duration: 0.2 }
4041
4043
  },
4042
4044
  transition: {
4043
- delay: animate2 ? index * 0.05 : 0,
4045
+ delay: animate ? index * 0.05 : 0,
4044
4046
  layout: { duration: 0.2 }
4045
4047
  },
4046
4048
  className: cn(
@@ -5738,7 +5740,7 @@ var sheetVariants = classVarianceAuthority.cva(
5738
5740
  top: "inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",
5739
5741
  bottom: "inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",
5740
5742
  left: "inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",
5741
- right: "inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"
5743
+ right: "inset-y-0 right-0 h-full w-3/4 data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"
5742
5744
  }
5743
5745
  },
5744
5746
  defaultVariants: {
@@ -16524,11 +16526,11 @@ var NoData = ({
16524
16526
  ),
16525
16527
  style: {
16526
16528
  "--pl": `${paddingLeft}px`,
16527
- "--svg-h": typeof height === "number" ? `${height}px` : String(height)
16529
+ ...typeof height === "number" ? { height } : {}
16528
16530
  },
16529
16531
  role: "img",
16530
16532
  "aria-label": message,
16531
- children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full flex items-center justify-center pl-[var(--pl)] p-6 h-[var(--svg-h)]", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "w-full max-w-[900px] relative", children: [
16533
+ children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full flex items-center justify-center pl-[var(--pl)] p-6 h-full", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "w-full max-w-[900px] relative", children: [
16532
16534
  /* @__PURE__ */ jsxRuntime.jsxs(
16533
16535
  "svg",
16534
16536
  {
@@ -17263,11 +17265,30 @@ function useOpenTooltipForPeriod({
17263
17265
  );
17264
17266
  }
17265
17267
  var DEFAULT_COLORS2 = ["#55af7d", "#8e68ff", "#2273e1"];
17268
+ function ChartWrapper({
17269
+ className,
17270
+ children,
17271
+ wrapperRef
17272
+ }) {
17273
+ const cls = className ?? "";
17274
+ const hasExplicitSizing = /\bh-/.test(cls) || /\bflex-1\b/.test(cls);
17275
+ return /* @__PURE__ */ jsxRuntime.jsx(
17276
+ "div",
17277
+ {
17278
+ ref: wrapperRef,
17279
+ className: cn(
17280
+ "w-full overflow-hidden min-w-0 rounded-lg border-border",
17281
+ !hasExplicitSizing && "h-[550px]",
17282
+ className
17283
+ ),
17284
+ children
17285
+ }
17286
+ );
17287
+ }
17266
17288
  var Chart = ({
17267
17289
  data,
17268
17290
  series,
17269
17291
  className,
17270
- height = 350,
17271
17292
  width = "100%",
17272
17293
  colors: colors2 = DEFAULT_COLORS2,
17273
17294
  gridColor,
@@ -17299,19 +17320,7 @@ var Chart = ({
17299
17320
  timeSeries,
17300
17321
  timeSeriesLegend,
17301
17322
  customLegend
17302
- // horizontal removido
17303
- // orderBy removido
17304
17323
  }) => {
17305
- const usesFullHeight = typeof height === "string" && (height === "100%" || height === "100vh") || typeof className === "string" && /\bh-full\b/.test(className || "");
17306
- const responsiveHeight = usesFullHeight ? "100%" : height;
17307
- const wrapperClass = cn(
17308
- "w-full min-w-0 rounded-lg border-border",
17309
- className,
17310
- "overflow-hidden"
17311
- );
17312
- const wrapperStyle = usesFullHeight ? void 0 : {
17313
- height: typeof responsiveHeight === "number" ? `${responsiveHeight}px` : responsiveHeight
17314
- };
17315
17324
  const { xAxisConfig, mapperConfig } = React32.useMemo(() => {
17316
17325
  return fnSmartConfig({ xAxis, data, labelMap });
17317
17326
  }, [data, xAxis, labelMap]);
@@ -17455,393 +17464,419 @@ var Chart = ({
17455
17464
  maxTooltips,
17456
17465
  effectiveChartWidth
17457
17466
  });
17458
- const legendSpace = showLegend ? 44 : 0;
17459
- const xAxisLabelSpace = xAxisLabel ? 18 : 0;
17460
- const brushSpace = timeSeriesConfig?.height ? 200 : 0;
17461
- const bottomMargin = 10 + legendSpace + xAxisLabelSpace + brushSpace;
17462
17467
  if (!data && !isLoading) return null;
17463
17468
  if (isLoading) {
17464
- return /* @__PURE__ */ jsxRuntime.jsx(
17469
+ return /* @__PURE__ */ jsxRuntime.jsx(ChartWrapper, { className, children: /* @__PURE__ */ jsxRuntime.jsx(
17465
17470
  NoData_default,
17466
17471
  {
17467
17472
  title,
17468
17473
  isLoading: true,
17469
17474
  loadingMessage: typeof title === "string" ? `${title} \u2014 Carregando` : "Carregando",
17470
17475
  paddingLeft: CONTAINER_PADDING_LEFT + finalChartLeftMargin,
17471
- height
17476
+ height: "100%"
17472
17477
  }
17473
- );
17478
+ ) });
17474
17479
  }
17475
17480
  if (Array.isArray(data) && data.length === 0) {
17476
- return /* @__PURE__ */ jsxRuntime.jsx(
17481
+ return /* @__PURE__ */ jsxRuntime.jsx(ChartWrapper, { className, children: /* @__PURE__ */ jsxRuntime.jsx(
17477
17482
  NoData_default,
17478
17483
  {
17479
17484
  title,
17480
17485
  paddingLeft: CONTAINER_PADDING_LEFT + finalChartLeftMargin,
17481
- height
17486
+ height: "100%"
17482
17487
  }
17483
- );
17488
+ ) });
17484
17489
  }
17485
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { ref: wrapperRef, className: wrapperClass, style: wrapperStyle, children: [
17486
- /* @__PURE__ */ jsxRuntime.jsxs(
17487
- "div",
17488
- {
17489
- className: "rounded-lg bg-card relative w-full max-w-full min-w-0 py-1",
17490
- style: usesFullHeight ? { height: "100%" } : void 0,
17491
- children: [
17492
- /* @__PURE__ */ jsxRuntime.jsx(
17493
- ChartHeader,
17494
- {
17495
- title,
17496
- titlePosition,
17497
- HORIZONTAL_PADDING_CLASS,
17498
- customLegend,
17499
- data,
17500
- allKeys,
17501
- processedData,
17502
- finalColors,
17503
- mapperConfig,
17504
- finalValueFormatter,
17505
- formatBR
17506
- }
17490
+ return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
17491
+ /* @__PURE__ */ jsxRuntime.jsx(ChartWrapper, { className, wrapperRef, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "h-full w-full flex flex-col rounded-lg bg-card py-1 overflow-hidden", children: [
17492
+ /* @__PURE__ */ jsxRuntime.jsx(
17493
+ ChartHeader,
17494
+ {
17495
+ title,
17496
+ titlePosition,
17497
+ HORIZONTAL_PADDING_CLASS,
17498
+ customLegend,
17499
+ data,
17500
+ allKeys,
17501
+ processedData,
17502
+ finalColors,
17503
+ mapperConfig,
17504
+ finalValueFormatter,
17505
+ formatBR
17506
+ }
17507
+ ),
17508
+ allKeys.length > 0 && (enableHighlights || enableShowOnly) && /* @__PURE__ */ jsxRuntime.jsx(
17509
+ ChartControls,
17510
+ {
17511
+ allKeys,
17512
+ mapperConfig,
17513
+ finalColors,
17514
+ highlightedSeries,
17515
+ toggleHighlight,
17516
+ showOnlyHighlighted,
17517
+ setShowOnlyHighlighted,
17518
+ highlightedSeriesSize: highlightedSeries.size,
17519
+ clearHighlights,
17520
+ enableHighlights,
17521
+ enableShowOnly,
17522
+ enablePeriodsDropdown,
17523
+ enableDraggableTooltips,
17524
+ processedData,
17525
+ onOpenPeriod: openTooltipForPeriod,
17526
+ rightOffset: finalChartRightMargin,
17527
+ activePeriods,
17528
+ containerClass: cn("flex items-center gap-2", teste),
17529
+ containerWidth: chartInnerWidth
17530
+ }
17531
+ ),
17532
+ !(allKeys.length > 0 && (enableHighlights || enableShowOnly)) && enablePeriodsDropdown && enableDraggableTooltips && /* @__PURE__ */ jsxRuntime.jsx(
17533
+ "div",
17534
+ {
17535
+ className: cn(
17536
+ "w-full flex justify-end mb-2",
17537
+ HORIZONTAL_PADDING_CLASS
17507
17538
  ),
17508
- allKeys.length > 0 && (enableHighlights || enableShowOnly) && /* @__PURE__ */ jsxRuntime.jsx(
17509
- ChartControls,
17539
+ style: {
17540
+ paddingRight: `${finalChartRightMargin}px`,
17541
+ maxWidth: `${chartInnerWidth}px`
17542
+ },
17543
+ children: /* @__PURE__ */ jsxRuntime.jsx(
17544
+ PeriodsDropdown_default,
17510
17545
  {
17511
- allKeys,
17512
- mapperConfig,
17513
- finalColors,
17514
- highlightedSeries,
17515
- toggleHighlight,
17516
- showOnlyHighlighted,
17517
- setShowOnlyHighlighted,
17518
- highlightedSeriesSize: highlightedSeries.size,
17519
- clearHighlights,
17520
- enableHighlights,
17521
- enableShowOnly,
17522
- enablePeriodsDropdown,
17523
- enableDraggableTooltips,
17524
17546
  processedData,
17525
17547
  onOpenPeriod: openTooltipForPeriod,
17526
- rightOffset: finalChartRightMargin,
17527
- activePeriods,
17528
- containerClass: cn("flex items-center gap-2", teste),
17529
- containerWidth: chartInnerWidth
17548
+ rightOffset: finalChartRightMargin
17530
17549
  }
17531
- ),
17532
- !(allKeys.length > 0 && (enableHighlights || enableShowOnly)) && enablePeriodsDropdown && enableDraggableTooltips && /* @__PURE__ */ jsxRuntime.jsx(
17533
- "div",
17534
- {
17535
- className: cn(
17536
- "w-full flex justify-end mb-2",
17537
- HORIZONTAL_PADDING_CLASS
17538
- ),
17539
- style: {
17540
- paddingRight: `${finalChartRightMargin}px`,
17541
- maxWidth: `${chartInnerWidth}px`
17542
- },
17543
- children: /* @__PURE__ */ jsxRuntime.jsx(
17544
- PeriodsDropdown_default,
17550
+ )
17551
+ }
17552
+ ),
17553
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1 min-h-0 relative overflow-hidden", children: /* @__PURE__ */ jsxRuntime.jsx(recharts.ResponsiveContainer, { width: "100%", height: "100%", children: /* @__PURE__ */ jsxRuntime.jsxs(
17554
+ recharts.ComposedChart,
17555
+ {
17556
+ data: processedData,
17557
+ margin: {
17558
+ top: 10,
17559
+ right: finalChartRightMargin,
17560
+ left: finalChartLeftMargin,
17561
+ bottom: 10
17562
+ },
17563
+ onClick: handleChartClick,
17564
+ children: [
17565
+ /* @__PURE__ */ jsxRuntime.jsx("defs", { children: seriesOrder.filter((s) => s.type === "area").map((s) => {
17566
+ const key = s.key;
17567
+ const color = finalColors[key];
17568
+ return /* @__PURE__ */ jsxRuntime.jsxs(
17569
+ "linearGradient",
17545
17570
  {
17546
- processedData,
17547
- onOpenPeriod: openTooltipForPeriod,
17548
- rightOffset: finalChartRightMargin
17549
- }
17550
- )
17551
- }
17552
- ),
17553
- /* @__PURE__ */ jsxRuntime.jsx(recharts.ResponsiveContainer, { width: "100%", height: responsiveHeight, children: /* @__PURE__ */ jsxRuntime.jsxs(
17554
- recharts.ComposedChart,
17555
- {
17556
- data: processedData,
17557
- margin: {
17558
- top: 10,
17559
- right: finalChartRightMargin,
17560
- left: finalChartLeftMargin,
17561
- bottom: bottomMargin
17562
- },
17563
- onClick: handleChartClick,
17564
- children: [
17565
- /* @__PURE__ */ jsxRuntime.jsx("defs", { children: seriesOrder.filter((s) => s.type === "area").map((s) => {
17566
- const key = s.key;
17567
- const color = finalColors[key];
17568
- return /* @__PURE__ */ jsxRuntime.jsxs(
17569
- "linearGradient",
17570
- {
17571
- id: `gradient-${key}`,
17572
- x1: "0",
17573
- y1: "0",
17574
- x2: "0",
17575
- y2: "0.8",
17576
- children: [
17577
- /* @__PURE__ */ jsxRuntime.jsx("stop", { offset: "0%", stopColor: color, stopOpacity: 0.8 }),
17578
- /* @__PURE__ */ jsxRuntime.jsx("stop", { offset: "90%", stopColor: color, stopOpacity: 0.1 })
17579
- ]
17580
- },
17581
- `gradient-${key}`
17582
- );
17583
- }) }),
17584
- showGrid && /* @__PURE__ */ jsxRuntime.jsx(
17585
- recharts.CartesianGrid,
17586
- {
17587
- strokeDasharray: "3 3",
17588
- stroke: gridColor || "hsl(var(--muted-foreground))",
17589
- opacity: 0.5
17590
- }
17591
- ),
17592
- /* @__PURE__ */ jsxRuntime.jsx(
17593
- recharts.XAxis,
17594
- {
17595
- dataKey: xAxisConfig.dataKey,
17596
- stroke: "hsl(var(--muted-foreground))",
17597
- fontSize: 12,
17598
- tickLine: false,
17599
- axisLine: false,
17600
- tickFormatter: (value) => {
17601
- if (categoryFormatter)
17602
- return categoryFormatter(value);
17603
- if (xAxisConfig.valueFormatter)
17604
- return xAxisConfig.valueFormatter(value);
17605
- return String(value ?? "");
17606
- },
17607
- label: xAxisLabel ? {
17608
- value: xAxisLabel,
17609
- position: "insideBottomRight",
17610
- offset: -5,
17611
- style: {
17612
- fontSize: 12,
17613
- fill: "hsl(var(--muted-foreground))",
17614
- fontWeight: 500
17571
+ id: `gradient-${key}`,
17572
+ x1: "0",
17573
+ y1: "0",
17574
+ x2: "0",
17575
+ y2: "0.8",
17576
+ children: [
17577
+ /* @__PURE__ */ jsxRuntime.jsx(
17578
+ "stop",
17579
+ {
17580
+ offset: "0%",
17581
+ stopColor: color,
17582
+ stopOpacity: 0.8
17583
+ }
17584
+ ),
17585
+ /* @__PURE__ */ jsxRuntime.jsx(
17586
+ "stop",
17587
+ {
17588
+ offset: "90%",
17589
+ stopColor: color,
17590
+ stopOpacity: 0.1
17615
17591
  }
17616
- } : void 0
17592
+ )
17593
+ ]
17594
+ },
17595
+ `gradient-${key}`
17596
+ );
17597
+ }) }),
17598
+ showGrid && /* @__PURE__ */ jsxRuntime.jsx(
17599
+ recharts.CartesianGrid,
17600
+ {
17601
+ strokeDasharray: "3 3",
17602
+ stroke: gridColor || "hsl(var(--muted-foreground))",
17603
+ opacity: 0.5
17604
+ }
17605
+ ),
17606
+ /* @__PURE__ */ jsxRuntime.jsx(
17607
+ recharts.XAxis,
17608
+ {
17609
+ dataKey: xAxisConfig.dataKey,
17610
+ stroke: "hsl(var(--muted-foreground))",
17611
+ fontSize: 12,
17612
+ tickLine: false,
17613
+ axisLine: false,
17614
+ tickFormatter: (value) => {
17615
+ if (categoryFormatter)
17616
+ return categoryFormatter(value);
17617
+ if (xAxisConfig.valueFormatter)
17618
+ return xAxisConfig.valueFormatter(
17619
+ value
17620
+ );
17621
+ return String(value ?? "");
17622
+ },
17623
+ label: xAxisLabel ? {
17624
+ value: xAxisLabel,
17625
+ position: "insideBottomRight",
17626
+ offset: -5,
17627
+ style: {
17628
+ fontSize: 12,
17629
+ fill: "hsl(var(--muted-foreground))",
17630
+ fontWeight: 500
17617
17631
  }
17618
- ),
17619
- /* @__PURE__ */ jsxRuntime.jsx(
17620
- recharts.YAxis,
17621
- {
17622
- yAxisId: "left",
17623
- width: yAxisTickWidth,
17624
- stroke: "hsl(var(--muted-foreground))",
17632
+ } : void 0
17633
+ }
17634
+ ),
17635
+ /* @__PURE__ */ jsxRuntime.jsx(
17636
+ recharts.YAxis,
17637
+ {
17638
+ yAxisId: "left",
17639
+ width: yAxisTickWidth,
17640
+ stroke: "hsl(var(--muted-foreground))",
17641
+ fontSize: 12,
17642
+ tickLine: false,
17643
+ axisLine: false,
17644
+ tickFormatter: yTickFormatter,
17645
+ domain: [Math.min(minLeftDataValue, 0), niceMaxLeft],
17646
+ tickCount: 6,
17647
+ label: yAxisLabel ? {
17648
+ value: yAxisLabel,
17649
+ angle: -90,
17650
+ position: "left",
17651
+ dx: leftYAxisLabelDx,
17652
+ style: {
17625
17653
  fontSize: 12,
17626
- tickLine: false,
17627
- axisLine: false,
17628
- tickFormatter: yTickFormatter,
17629
- domain: [Math.min(minLeftDataValue, 0), niceMaxLeft],
17630
- tickCount: 6,
17631
- label: yAxisLabel ? {
17632
- value: yAxisLabel,
17633
- angle: -90,
17634
- position: "left",
17635
- dx: leftYAxisLabelDx,
17636
- style: {
17637
- fontSize: 12,
17638
- fill: "hsl(var(--muted-foreground))",
17639
- fontWeight: 500,
17640
- textAnchor: "middle"
17641
- }
17642
- } : void 0
17654
+ fill: "hsl(var(--muted-foreground))",
17655
+ fontWeight: 500,
17656
+ textAnchor: "middle"
17643
17657
  }
17644
- ),
17645
- rightKeys.length > 0 && (() => {
17646
- const { rightAxisColor, rightTickFormatter } = fnConfigRightKeys(
17647
- biaxialConfigNormalized,
17648
- yTickFormatter,
17649
- finalColors
17650
- );
17651
- return /* @__PURE__ */ jsxRuntime.jsx(
17652
- recharts.YAxis,
17653
- {
17654
- yAxisId: "right",
17655
- width: finalChartRightMargin,
17656
- orientation: "right",
17657
- stroke: "hsl(var(--muted-foreground))",
17658
+ } : void 0
17659
+ }
17660
+ ),
17661
+ rightKeys.length > 0 && (() => {
17662
+ const { rightAxisColor, rightTickFormatter } = fnConfigRightKeys(
17663
+ biaxialConfigNormalized,
17664
+ yTickFormatter,
17665
+ finalColors
17666
+ );
17667
+ return /* @__PURE__ */ jsxRuntime.jsx(
17668
+ recharts.YAxis,
17669
+ {
17670
+ yAxisId: "right",
17671
+ width: finalChartRightMargin,
17672
+ orientation: "right",
17673
+ stroke: "hsl(var(--muted-foreground))",
17674
+ fontSize: 12,
17675
+ tickLine: false,
17676
+ axisLine: false,
17677
+ tick: { fill: rightAxisColor },
17678
+ tickFormatter: rightTickFormatter,
17679
+ domain: [Math.min(minRightDataValue, 0), niceMaxRight],
17680
+ tickCount: 6,
17681
+ label: biaxialConfigNormalized?.label ? {
17682
+ value: biaxialConfigNormalized.label,
17683
+ angle: -90,
17684
+ position: "right",
17685
+ dx: rightYAxisLabelDx,
17686
+ style: {
17658
17687
  fontSize: 12,
17659
- tickLine: false,
17660
- axisLine: false,
17661
- tick: { fill: rightAxisColor },
17662
- tickFormatter: rightTickFormatter,
17663
- domain: [Math.min(minRightDataValue, 0), niceMaxRight],
17664
- tickCount: 6,
17665
- label: biaxialConfigNormalized?.label ? {
17666
- value: biaxialConfigNormalized.label,
17667
- angle: -90,
17668
- position: "right",
17669
- dx: rightYAxisLabelDx,
17670
- style: {
17671
- fontSize: 12,
17672
- fill: "hsl(var(--muted-foreground))",
17673
- fontWeight: 500,
17674
- textAnchor: "middle"
17675
- }
17676
- } : void 0
17688
+ fill: "hsl(var(--muted-foreground))",
17689
+ fontWeight: 500,
17690
+ textAnchor: "middle"
17677
17691
  }
17678
- );
17679
- })(),
17680
- showTooltip && /* @__PURE__ */ jsxRuntime.jsx(
17681
- recharts.Tooltip,
17692
+ } : void 0
17693
+ }
17694
+ );
17695
+ })(),
17696
+ showTooltip && /* @__PURE__ */ jsxRuntime.jsx(
17697
+ recharts.Tooltip,
17698
+ {
17699
+ content: showTooltipTotal ? /* @__PURE__ */ jsxRuntime.jsx(
17700
+ TooltipWithTotal_default,
17682
17701
  {
17683
- content: showTooltipTotal ? /* @__PURE__ */ jsxRuntime.jsx(
17684
- TooltipWithTotal_default,
17685
- {
17686
- finalColors,
17687
- valueFormatter: finalValueFormatter,
17688
- categoryFormatter,
17689
- periodLabel
17690
- }
17691
- ) : /* @__PURE__ */ jsxRuntime.jsx(
17692
- TooltipSimple_default,
17693
- {
17694
- finalColors,
17695
- valueFormatter: finalValueFormatter,
17696
- categoryFormatter,
17697
- periodLabel
17698
- }
17699
- ),
17700
- cursor: { fill: "hsl(var(--muted))", opacity: 0.1 }
17702
+ finalColors,
17703
+ valueFormatter: finalValueFormatter,
17704
+ categoryFormatter,
17705
+ periodLabel
17701
17706
  }
17702
- ),
17703
- showLegend && /* @__PURE__ */ jsxRuntime.jsx(
17704
- recharts.Legend,
17707
+ ) : /* @__PURE__ */ jsxRuntime.jsx(
17708
+ TooltipSimple_default,
17705
17709
  {
17706
- iconSize: 12,
17707
- formatter: (value) => {
17708
- return /* @__PURE__ */ jsxRuntime.jsx("span", { className: "tracking-[0] rounded-sm", children: fnFormatterValueLegend(
17709
- value,
17710
- mapperConfig,
17711
- labelMap,
17712
- legendUppercase
17713
- ) });
17714
- }
17710
+ finalColors,
17711
+ valueFormatter: finalValueFormatter,
17712
+ categoryFormatter,
17713
+ periodLabel
17715
17714
  }
17716
17715
  ),
17717
- seriesOrder.map((s) => {
17718
- if (showOnlyHighlighted && !highlightedSeries.has(s.key))
17719
- return null;
17720
- const { label, color, key } = fnBuildConfigData(
17721
- s,
17722
- mapperConfig,
17723
- labelMap,
17724
- finalColors,
17725
- rightKeys,
17726
- biaxialConfigNormalized
17727
- );
17728
- if (s.type === "bar") {
17729
- return /* @__PURE__ */ jsxRuntime.jsx(
17730
- recharts.Bar,
17716
+ cursor: { fill: "hsl(var(--muted))", opacity: 0.1 }
17717
+ }
17718
+ ),
17719
+ showLegend && /* @__PURE__ */ jsxRuntime.jsx(
17720
+ recharts.Legend,
17721
+ {
17722
+ iconSize: 12,
17723
+ formatter: (value) => /* @__PURE__ */ jsxRuntime.jsx("span", { className: "tracking-[0] rounded-sm", children: fnFormatterValueLegend(
17724
+ value,
17725
+ mapperConfig,
17726
+ labelMap,
17727
+ legendUppercase
17728
+ ) })
17729
+ }
17730
+ ),
17731
+ seriesOrder.map((s) => {
17732
+ if (showOnlyHighlighted && !highlightedSeries.has(s.key))
17733
+ return null;
17734
+ const { label, color, key } = fnBuildConfigData(
17735
+ s,
17736
+ mapperConfig,
17737
+ labelMap,
17738
+ finalColors,
17739
+ rightKeys,
17740
+ biaxialConfigNormalized
17741
+ );
17742
+ if (s.type === "bar") {
17743
+ return /* @__PURE__ */ jsxRuntime.jsx(
17744
+ recharts.Bar,
17745
+ {
17746
+ dataKey: key,
17747
+ yAxisId: rightKeys.includes(key) ? "right" : "left",
17748
+ name: label,
17749
+ fill: color,
17750
+ radius: [4, 4, 0, 0],
17751
+ onClick: handleBarClick,
17752
+ className: "cursor-pointer",
17753
+ style: { opacity: getSeriesOpacity(key) },
17754
+ activeBar: /* @__PURE__ */ jsxRuntime.jsx(
17755
+ recharts.Rectangle,
17731
17756
  {
17732
- dataKey: key,
17733
- yAxisId: rightKeys.includes(key) ? "right" : "left",
17734
- name: label,
17735
17757
  fill: color,
17736
- radius: [4, 4, 0, 0],
17737
- onClick: handleBarClick,
17738
- className: "cursor-pointer",
17739
- style: { opacity: getSeriesOpacity(key) },
17740
- activeBar: /* @__PURE__ */ jsxRuntime.jsx(
17741
- recharts.Rectangle,
17742
- {
17743
- fill: color,
17744
- stroke: color,
17745
- strokeWidth: 2,
17746
- opacity: 0.8
17747
- }
17748
- ),
17749
- children: showLabels && labelsVisibility.bar !== false && highlightedSeries.size === 0 || highlightedSeries.has(key) ? /* @__PURE__ */ jsxRuntime.jsx(
17750
- recharts.LabelList,
17751
- {
17752
- dataKey: key,
17753
- content: (props) => {
17754
- if (!fnContentLabelList(props)) return null;
17755
- const inside = renderInsideBarLabel(
17756
- color,
17757
- finalValueFormatter
17758
- );
17759
- return inside(props);
17760
- },
17761
- offset: 0
17762
- }
17763
- ) : null
17764
- },
17765
- `bar-${key}`
17766
- );
17767
- }
17768
- if (s.type === "line") {
17769
- return /* @__PURE__ */ jsxRuntime.jsx(
17770
- recharts.Line,
17771
- {
17772
- dataKey: key,
17773
- yAxisId: rightKeys.includes(key) ? "right" : "left",
17774
- name: label,
17775
17758
  stroke: color,
17776
17759
  strokeWidth: 2,
17777
- dot: { r: 3 },
17778
- activeDot: { r: 6 },
17779
- onClick: handleSeriesClick,
17780
- className: "cursor-pointer pointer-events-auto",
17781
- style: { opacity: getSeriesOpacity(key) },
17782
- children: showLabels && labelsVisibility.line !== false && highlightedSeries.size === 0 || highlightedSeries.has(key) ? /* @__PURE__ */ jsxRuntime.jsx(
17783
- recharts.LabelList,
17784
- {
17785
- dataKey: key,
17786
- position: "top",
17787
- content: pillLabelRenderer_default(
17788
- color,
17789
- "filled",
17790
- (props) => formatLinePercentage(props.value)
17791
- ),
17792
- offset: 14
17793
- }
17794
- ) : null
17795
- },
17796
- `line-${key}`
17797
- );
17798
- }
17799
- if (s.type === "area") {
17800
- return /* @__PURE__ */ jsxRuntime.jsx(
17801
- recharts.Area,
17760
+ opacity: 0.8
17761
+ }
17762
+ ),
17763
+ children: showLabels && labelsVisibility.bar !== false && highlightedSeries.size === 0 || highlightedSeries.has(key) ? /* @__PURE__ */ jsxRuntime.jsx(
17764
+ recharts.LabelList,
17802
17765
  {
17803
- type: "monotone",
17804
17766
  dataKey: key,
17805
- yAxisId: rightKeys.includes(key) ? "right" : "left",
17806
- name: label,
17807
- stroke: color,
17808
- fill: `url(#gradient-${key})`,
17809
- fillOpacity: 1,
17810
- strokeWidth: 2,
17811
- onClick: handleSeriesClick,
17812
- className: "cursor-pointer pointer-events-auto",
17813
- style: { opacity: getSeriesOpacity(key) },
17814
- activeDot: {
17815
- r: 6,
17816
- fill: color,
17817
- stroke: "hsl(var(--background))",
17818
- strokeWidth: 2
17767
+ content: (props) => {
17768
+ if (!fnContentLabelList(props)) return null;
17769
+ const inside = renderInsideBarLabel(
17770
+ color,
17771
+ finalValueFormatter
17772
+ );
17773
+ return inside(props);
17819
17774
  },
17820
- children: showLabels && labelsVisibility.area !== false && highlightedSeries.size === 0 || highlightedSeries.has(key) ? /* @__PURE__ */ jsxRuntime.jsx(
17821
- recharts.LabelList,
17822
- {
17823
- dataKey: key,
17824
- position: "top",
17825
- content: pillLabelRenderer_default(
17826
- color,
17827
- "soft",
17828
- finalValueFormatter
17829
- ),
17830
- offset: 12
17831
- }
17832
- ) : null
17833
- },
17834
- `area-${key}`
17835
- );
17836
- }
17837
- return null;
17838
- })
17839
- ]
17840
- }
17841
- ) })
17842
- ]
17843
- }
17844
- ),
17775
+ offset: 0
17776
+ }
17777
+ ) : null
17778
+ },
17779
+ `bar-${key}`
17780
+ );
17781
+ }
17782
+ if (s.type === "line") {
17783
+ return /* @__PURE__ */ jsxRuntime.jsx(
17784
+ recharts.Line,
17785
+ {
17786
+ dataKey: key,
17787
+ yAxisId: rightKeys.includes(key) ? "right" : "left",
17788
+ name: label,
17789
+ stroke: color,
17790
+ strokeWidth: 2,
17791
+ dot: { r: 3 },
17792
+ activeDot: { r: 6 },
17793
+ onClick: handleSeriesClick,
17794
+ className: "cursor-pointer pointer-events-auto",
17795
+ style: { opacity: getSeriesOpacity(key) },
17796
+ children: showLabels && labelsVisibility.line !== false && highlightedSeries.size === 0 || highlightedSeries.has(key) ? /* @__PURE__ */ jsxRuntime.jsx(
17797
+ recharts.LabelList,
17798
+ {
17799
+ dataKey: key,
17800
+ position: "top",
17801
+ content: pillLabelRenderer_default(
17802
+ color,
17803
+ "filled",
17804
+ (props) => formatLinePercentage(props.value)
17805
+ ),
17806
+ offset: 14
17807
+ }
17808
+ ) : null
17809
+ },
17810
+ `line-${key}`
17811
+ );
17812
+ }
17813
+ if (s.type === "area") {
17814
+ return /* @__PURE__ */ jsxRuntime.jsx(
17815
+ recharts.Area,
17816
+ {
17817
+ type: "monotone",
17818
+ dataKey: key,
17819
+ yAxisId: rightKeys.includes(key) ? "right" : "left",
17820
+ name: label,
17821
+ stroke: color,
17822
+ fill: `url(#gradient-${key})`,
17823
+ fillOpacity: 1,
17824
+ strokeWidth: 2,
17825
+ onClick: handleSeriesClick,
17826
+ className: "cursor-pointer pointer-events-auto",
17827
+ style: { opacity: getSeriesOpacity(key) },
17828
+ activeDot: {
17829
+ r: 6,
17830
+ fill: color,
17831
+ stroke: "hsl(var(--background))",
17832
+ strokeWidth: 2
17833
+ },
17834
+ children: showLabels && labelsVisibility.area !== false && highlightedSeries.size === 0 || highlightedSeries.has(key) ? /* @__PURE__ */ jsxRuntime.jsx(
17835
+ recharts.LabelList,
17836
+ {
17837
+ dataKey: key,
17838
+ position: "top",
17839
+ content: pillLabelRenderer_default(
17840
+ color,
17841
+ "soft",
17842
+ finalValueFormatter
17843
+ ),
17844
+ offset: 12
17845
+ }
17846
+ ) : null
17847
+ },
17848
+ `area-${key}`
17849
+ );
17850
+ }
17851
+ return null;
17852
+ })
17853
+ ]
17854
+ }
17855
+ ) }) }),
17856
+ timeSeriesConfig && /* @__PURE__ */ jsxRuntime.jsx(
17857
+ Brush_default,
17858
+ {
17859
+ legend: timeSeriesLegend,
17860
+ data,
17861
+ startIndex,
17862
+ endIndex,
17863
+ onMouseDown: handleMouseDown,
17864
+ brushRef,
17865
+ xAxisKey: xAxisConfig.dataKey,
17866
+ seriesOrder,
17867
+ finalColors,
17868
+ brushHeight: timeSeriesConfig.height,
17869
+ brushColor: timeSeriesConfig.brushColor,
17870
+ miniChartOpacity: timeSeriesConfig.miniChartOpacity,
17871
+ showGrid,
17872
+ gridColor,
17873
+ margin: {
17874
+ left: finalChartLeftMargin,
17875
+ right: finalChartRightMargin
17876
+ }
17877
+ }
17878
+ )
17879
+ ] }) }),
17845
17880
  enableDraggableTooltips && activeTooltips.map((tooltip) => /* @__PURE__ */ jsxRuntime.jsx(
17846
17881
  DraggableTooltip_default,
17847
17882
  {
@@ -17875,29 +17910,6 @@ var Chart = ({
17875
17910
  position: "top-center",
17876
17911
  variant: "floating"
17877
17912
  }
17878
- ),
17879
- timeSeriesConfig && /* @__PURE__ */ jsxRuntime.jsx(
17880
- Brush_default,
17881
- {
17882
- legend: timeSeriesLegend,
17883
- data,
17884
- startIndex,
17885
- endIndex,
17886
- onMouseDown: handleMouseDown,
17887
- brushRef,
17888
- xAxisKey: xAxisConfig.dataKey,
17889
- seriesOrder,
17890
- finalColors,
17891
- brushHeight: timeSeriesConfig.height,
17892
- brushColor: timeSeriesConfig.brushColor,
17893
- miniChartOpacity: timeSeriesConfig.miniChartOpacity,
17894
- showGrid,
17895
- gridColor,
17896
- margin: {
17897
- left: finalChartLeftMargin,
17898
- right: finalChartRightMargin
17899
- }
17900
- }
17901
17913
  )
17902
17914
  ] });
17903
17915
  };
@@ -18392,9 +18404,7 @@ var HorizontalChart_default = HorizontalChart;
18392
18404
  var TimeSeries = ({
18393
18405
  data,
18394
18406
  xAxis,
18395
- chartHeight = 350,
18396
- height,
18397
- brushHeight,
18407
+ brushHeight = 60,
18398
18408
  className,
18399
18409
  start,
18400
18410
  end,
@@ -18406,21 +18416,21 @@ var TimeSeries = ({
18406
18416
  miniChartOpacity = 0.2,
18407
18417
  ...rest
18408
18418
  }) => {
18409
- const brushHeightValue = brushHeight ?? height ?? 60;
18410
18419
  const startIndex = defaultStartIndex ?? start ?? 0;
18411
18420
  const endIndex = defaultEndIndex ?? end;
18412
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("w-full flex flex-col", className), children: /* @__PURE__ */ jsxRuntime.jsx(
18421
+ const hasExplicitHeight = /\bh-/.test(className ?? "");
18422
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("w-full flex flex-col overflow-hidden", className), children: /* @__PURE__ */ jsxRuntime.jsx(
18413
18423
  Chart_default,
18414
18424
  {
18415
18425
  ...rest,
18416
18426
  data,
18417
18427
  xAxis,
18418
- height: chartHeight + brushHeightValue + 40,
18428
+ className: hasExplicitHeight ? "flex-1 min-h-0" : void 0,
18419
18429
  timeSeries: {
18420
18430
  start: startIndex,
18421
18431
  end: endIndex,
18422
18432
  onRangeChange,
18423
- height: brushHeightValue,
18433
+ height: brushHeight,
18424
18434
  brushColor,
18425
18435
  brushStroke,
18426
18436
  miniChartOpacity
@@ -18647,16 +18657,147 @@ function Leaderboard({
18647
18657
  }
18648
18658
  );
18649
18659
  }
18650
- var Lens = ({
18651
- children,
18652
- initialZoom = 1.5,
18653
- maxZoom = 4,
18654
- lensSize = 150,
18655
- isStatic = false,
18656
- position = { x: 200, y: 150 },
18657
- hovering,
18658
- setHovering
18659
- }) => {
18660
+ var ZoomImage = React32__namespace.forwardRef(
18661
+ ({
18662
+ className,
18663
+ src,
18664
+ alt,
18665
+ maxZoom = 2,
18666
+ transitionDuration = 0.3,
18667
+ borderRadius = 12,
18668
+ imageClassName,
18669
+ ...props
18670
+ }, ref) => {
18671
+ const mouseX = framerMotion.useMotionValue(50);
18672
+ const mouseY = framerMotion.useMotionValue(50);
18673
+ const zoomLevel = framerMotion.useMotionValue(1);
18674
+ const springConfig = { damping: 20, stiffness: 150, mass: 0.5 };
18675
+ const smoothMouseX = framerMotion.useSpring(mouseX, springConfig);
18676
+ const smoothMouseY = framerMotion.useSpring(mouseY, springConfig);
18677
+ const smoothZoomLevel = framerMotion.useSpring(zoomLevel, springConfig);
18678
+ const transformOrigin = framerMotion.useTransform(
18679
+ [smoothMouseX, smoothMouseY],
18680
+ ([latestX, latestY]) => `${latestX}% ${latestY}%`
18681
+ );
18682
+ const touchStartDist = React32__namespace.useRef(0);
18683
+ const touchStartZoom = React32__namespace.useRef(1);
18684
+ const isPinching = React32__namespace.useRef(false);
18685
+ const handleMouseMove = (e) => {
18686
+ if (isPinching.current) return;
18687
+ const { left, top, width, height } = e.currentTarget.getBoundingClientRect();
18688
+ const x = (e.clientX - left) / width * 100;
18689
+ const y = (e.clientY - top) / height * 100;
18690
+ mouseX.set(x);
18691
+ mouseY.set(y);
18692
+ };
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
+ };
18698
+ const handleMouseLeave = () => {
18699
+ if (!isPinching.current) {
18700
+ mouseX.set(50);
18701
+ mouseY.set(50);
18702
+ zoomLevel.set(1);
18703
+ }
18704
+ };
18705
+ const getDistance = (touches) => {
18706
+ const dx = touches[0].clientX - touches[1].clientX;
18707
+ const dy = touches[0].clientY - touches[1].clientY;
18708
+ return Math.sqrt(dx * dx + dy * dy);
18709
+ };
18710
+ const getCenter = (touches, rect) => {
18711
+ const x = (touches[0].clientX + touches[1].clientX) / 2;
18712
+ const y = (touches[0].clientY + touches[1].clientY) / 2;
18713
+ return {
18714
+ x: (x - rect.left) / rect.width * 100,
18715
+ y: (y - rect.top) / rect.height * 100
18716
+ };
18717
+ };
18718
+ const handleTouchStart = (e) => {
18719
+ if (e.touches.length === 2) {
18720
+ isPinching.current = true;
18721
+ touchStartDist.current = getDistance(e.touches);
18722
+ touchStartZoom.current = zoomLevel.get();
18723
+ const rect = e.currentTarget.getBoundingClientRect();
18724
+ const center = getCenter(e.touches, rect);
18725
+ mouseX.set(center.x);
18726
+ mouseY.set(center.y);
18727
+ }
18728
+ };
18729
+ const handleTouchMove = (e) => {
18730
+ if (e.touches.length === 2 && isPinching.current) {
18731
+ e.preventDefault();
18732
+ const dist = getDistance(e.touches);
18733
+ const rect = e.currentTarget.getBoundingClientRect();
18734
+ const scaleChange = dist / touchStartDist.current;
18735
+ const newZoom = Math.min(
18736
+ Math.max(1, touchStartZoom.current * scaleChange),
18737
+ maxZoom
18738
+ );
18739
+ zoomLevel.set(newZoom);
18740
+ const center = getCenter(e.touches, rect);
18741
+ mouseX.set(center.x);
18742
+ mouseY.set(center.y);
18743
+ }
18744
+ };
18745
+ const handleTouchEnd = (e) => {
18746
+ if (e.touches.length < 2) {
18747
+ if (isPinching.current) {
18748
+ isPinching.current = false;
18749
+ }
18750
+ }
18751
+ };
18752
+ return /* @__PURE__ */ jsxRuntime.jsx(
18753
+ framerMotion.motion.div,
18754
+ {
18755
+ ref,
18756
+ className: cn(
18757
+ "relative w-full h-full overflow-hidden touch-none",
18758
+ className
18759
+ ),
18760
+ style: { borderRadius: `${borderRadius}px` },
18761
+ onMouseMove: handleMouseMove,
18762
+ onMouseLeave: handleMouseLeave,
18763
+ onWheel: handleWheel,
18764
+ onTouchStart: handleTouchStart,
18765
+ onTouchMove: handleTouchMove,
18766
+ onTouchEnd: handleTouchEnd,
18767
+ ...props,
18768
+ children: /* @__PURE__ */ jsxRuntime.jsx(
18769
+ framerMotion.motion.img,
18770
+ {
18771
+ src,
18772
+ alt,
18773
+ className: cn("w-full h-full object-cover", imageClassName),
18774
+ style: {
18775
+ borderRadius: `${borderRadius}px`,
18776
+ transformOrigin,
18777
+ scale: smoothZoomLevel
18778
+ },
18779
+ transition: {
18780
+ type: "spring",
18781
+ duration: transitionDuration,
18782
+ bounce: 0
18783
+ }
18784
+ }
18785
+ )
18786
+ }
18787
+ );
18788
+ }
18789
+ );
18790
+ ZoomImage.displayName = "ZoomImage";
18791
+ var Lens = ({
18792
+ children,
18793
+ initialZoom = 1.5,
18794
+ maxZoom = 4,
18795
+ lensSize = 150,
18796
+ isStatic = false,
18797
+ position = { x: 200, y: 150 },
18798
+ hovering,
18799
+ setHovering
18800
+ }) => {
18660
18801
  const containerRef = React32.useRef(null);
18661
18802
  const [localIsHovering, setLocalIsHovering] = React32.useState(false);
18662
18803
  const isHovering = hovering !== void 0 ? hovering : localIsHovering;
@@ -18793,137 +18934,73 @@ var Lens = ({
18793
18934
  }
18794
18935
  );
18795
18936
  };
18796
- var ZoomImage = React32__namespace.forwardRef(
18797
- ({
18798
- className,
18799
- src,
18800
- alt,
18801
- maxZoom = 2,
18802
- transitionDuration = 0.3,
18803
- borderRadius = 12,
18804
- imageClassName,
18805
- ...props
18806
- }, ref) => {
18807
- const mouseX = framerMotion.useMotionValue(50);
18808
- const mouseY = framerMotion.useMotionValue(50);
18809
- const zoomLevel = framerMotion.useMotionValue(1);
18810
- const springConfig = { damping: 20, stiffness: 150, mass: 0.5 };
18811
- const smoothMouseX = framerMotion.useSpring(mouseX, springConfig);
18812
- const smoothMouseY = framerMotion.useSpring(mouseY, springConfig);
18813
- const smoothZoomLevel = framerMotion.useSpring(zoomLevel, springConfig);
18814
- const transformOrigin = framerMotion.useTransform(
18815
- [smoothMouseX, smoothMouseY],
18816
- ([latestX, latestY]) => `${latestX}% ${latestY}%`
18817
- );
18818
- const touchStartDist = React32__namespace.useRef(0);
18819
- const touchStartZoom = React32__namespace.useRef(1);
18820
- const isPinching = React32__namespace.useRef(false);
18821
- const handleMouseMove = (e) => {
18822
- if (isPinching.current) return;
18823
- const { left, top, width, height } = e.currentTarget.getBoundingClientRect();
18824
- const x = (e.clientX - left) / width * 100;
18825
- const y = (e.clientY - top) / height * 100;
18826
- mouseX.set(x);
18827
- mouseY.set(y);
18828
- };
18829
- const handleWheel = (e) => {
18830
- const delta = -e.deltaY * 5e-3;
18831
- const newZoom = Math.min(Math.max(1, zoomLevel.get() + delta), maxZoom);
18832
- zoomLevel.set(newZoom);
18833
- };
18834
- const handleMouseLeave = () => {
18835
- if (!isPinching.current) {
18836
- mouseX.set(50);
18837
- mouseY.set(50);
18838
- zoomLevel.set(1);
18839
- }
18840
- };
18841
- const getDistance = (touches) => {
18842
- const dx = touches[0].clientX - touches[1].clientX;
18843
- const dy = touches[0].clientY - touches[1].clientY;
18844
- return Math.sqrt(dx * dx + dy * dy);
18845
- };
18846
- const getCenter = (touches, rect) => {
18847
- const x = (touches[0].clientX + touches[1].clientX) / 2;
18848
- const y = (touches[0].clientY + touches[1].clientY) / 2;
18849
- return {
18850
- x: (x - rect.left) / rect.width * 100,
18851
- y: (y - rect.top) / rect.height * 100
18852
- };
18853
- };
18854
- const handleTouchStart = (e) => {
18855
- if (e.touches.length === 2) {
18856
- isPinching.current = true;
18857
- touchStartDist.current = getDistance(e.touches);
18858
- touchStartZoom.current = zoomLevel.get();
18859
- const rect = e.currentTarget.getBoundingClientRect();
18860
- const center = getCenter(e.touches, rect);
18861
- mouseX.set(center.x);
18862
- mouseY.set(center.y);
18863
- }
18864
- };
18865
- const handleTouchMove = (e) => {
18866
- if (e.touches.length === 2 && isPinching.current) {
18867
- e.preventDefault();
18868
- const dist = getDistance(e.touches);
18869
- const rect = e.currentTarget.getBoundingClientRect();
18870
- const scaleChange = dist / touchStartDist.current;
18871
- const newZoom = Math.min(
18872
- Math.max(1, touchStartZoom.current * scaleChange),
18873
- maxZoom
18874
- );
18875
- zoomLevel.set(newZoom);
18876
- const center = getCenter(e.touches, rect);
18877
- mouseX.set(center.x);
18878
- mouseY.set(center.y);
18879
- }
18880
- };
18881
- const handleTouchEnd = (e) => {
18882
- if (e.touches.length < 2) {
18883
- if (isPinching.current) {
18884
- isPinching.current = false;
18937
+ function CarouselSkeleton({ className }) {
18938
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("w-full h-full lg:p-10 sm:p-4 p-2", className), children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-col gap-3 h-full", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "relative overflow-hidden rounded-lg h-full", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "w-full h-full bg-muted rounded-lg overflow-hidden relative", children: [
18939
+ /* @__PURE__ */ jsxRuntime.jsx(
18940
+ framerMotion.motion.div,
18941
+ {
18942
+ className: "absolute inset-0",
18943
+ style: {
18944
+ background: "linear-gradient(105deg, transparent 30%, hsl(var(--muted-foreground) / 0.08) 50%, transparent 70%)",
18945
+ backgroundSize: "200% 100%"
18946
+ },
18947
+ animate: { backgroundPositionX: ["200%", "-200%"] },
18948
+ transition: {
18949
+ duration: 1.6,
18950
+ ease: "linear",
18951
+ repeat: Infinity
18885
18952
  }
18886
18953
  }
18887
- };
18888
- return /* @__PURE__ */ jsxRuntime.jsx(
18954
+ ),
18955
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(
18889
18956
  framerMotion.motion.div,
18890
18957
  {
18891
- ref,
18892
- className: cn(
18893
- "relative w-full h-full overflow-hidden touch-none",
18894
- className
18895
- ),
18896
- style: { borderRadius: `${borderRadius}px` },
18897
- onMouseMove: handleMouseMove,
18898
- onMouseLeave: handleMouseLeave,
18899
- onWheel: handleWheel,
18900
- onTouchStart: handleTouchStart,
18901
- onTouchMove: handleTouchMove,
18902
- onTouchEnd: handleTouchEnd,
18903
- ...props,
18904
- children: /* @__PURE__ */ jsxRuntime.jsx(
18905
- framerMotion.motion.img,
18958
+ animate: { opacity: [0.3, 0.6, 0.3] },
18959
+ transition: {
18960
+ duration: 2,
18961
+ repeat: Infinity,
18962
+ ease: "easeInOut"
18963
+ },
18964
+ children: /* @__PURE__ */ jsxRuntime.jsxs(
18965
+ "svg",
18906
18966
  {
18907
- src,
18908
- alt,
18909
- className: cn("w-full h-full object-cover", imageClassName),
18910
- style: {
18911
- borderRadius: `${borderRadius}px`,
18912
- transformOrigin,
18913
- scale: smoothZoomLevel
18914
- },
18915
- transition: {
18916
- type: "spring",
18917
- duration: transitionDuration,
18918
- bounce: 0
18919
- }
18967
+ width: "48",
18968
+ height: "48",
18969
+ viewBox: "0 0 24 24",
18970
+ fill: "none",
18971
+ stroke: "currentColor",
18972
+ strokeWidth: "1",
18973
+ strokeLinecap: "round",
18974
+ strokeLinejoin: "round",
18975
+ className: "text-muted-foreground/30",
18976
+ children: [
18977
+ /* @__PURE__ */ jsxRuntime.jsx("rect", { x: "3", y: "3", width: "18", height: "18", rx: "2" }),
18978
+ /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "8.5", cy: "8.5", r: "1.5" }),
18979
+ /* @__PURE__ */ jsxRuntime.jsx("polyline", { points: "21 15 16 10 5 21" })
18980
+ ]
18920
18981
  }
18921
18982
  )
18922
18983
  }
18923
- );
18924
- }
18925
- );
18926
- ZoomImage.displayName = "ZoomImage";
18984
+ ) }),
18985
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute left-4 top-1/2 -translate-y-1/2 w-10 h-10 rounded-full bg-muted-foreground/10 border border-muted-foreground/10" }),
18986
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute right-4 top-1/2 -translate-y-1/2 w-10 h-10 rounded-full bg-muted-foreground/10 border border-muted-foreground/10" }),
18987
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute bottom-4 left-1/2 -translate-x-1/2 flex gap-2 items-center", children: [8, 32, 8, 8].map((w, i) => /* @__PURE__ */ jsxRuntime.jsx(
18988
+ framerMotion.motion.div,
18989
+ {
18990
+ className: "h-2 rounded-full bg-muted-foreground/20",
18991
+ style: { width: w },
18992
+ animate: { opacity: [0.4, 0.7, 0.4] },
18993
+ transition: {
18994
+ duration: 1.8,
18995
+ repeat: Infinity,
18996
+ ease: "easeInOut",
18997
+ delay: i * 0.15
18998
+ }
18999
+ },
19000
+ i
19001
+ )) })
19002
+ ] }) }) }) });
19003
+ }
18927
19004
  function CarouselBase({
18928
19005
  items,
18929
19006
  className,
@@ -18935,37 +19012,39 @@ function CarouselBase({
18935
19012
  showIndicators = true,
18936
19013
  autoPlay = false,
18937
19014
  autoPlayInterval = 3e3,
18938
- springConfig = {
18939
- stiffness: 300,
18940
- damping: 30
18941
- },
18942
19015
  zoomEffect = null,
18943
- download = false
19016
+ download = false,
19017
+ isLoading = false
18944
19018
  }) {
18945
19019
  const isMobile = useIsMobile();
18946
19020
  const [index, setIndex] = React32.useState(0);
18947
- const containerRef = React32.useRef(null);
18948
- const x = framerMotion.useMotionValue(0);
19021
+ const [emblaRef, emblaApi] = useEmblaCarousel__default.default({ loop: true });
18949
19022
  const [isDownloading, setIsDownloading] = React32.useState(false);
18950
19023
  const [downloadSuccess, setDownloadSuccess] = React32.useState(false);
18951
19024
  React32.useEffect(() => {
18952
- if (containerRef.current) {
18953
- const containerWidth = containerRef.current.offsetWidth || 1;
18954
- const targetX = -index * containerWidth;
18955
- framerMotion.animate(x, targetX, {
18956
- type: "spring",
18957
- stiffness: springConfig.stiffness,
18958
- damping: springConfig.damping
18959
- });
18960
- }
18961
- }, [index, x, springConfig.stiffness, springConfig.damping]);
19025
+ if (!emblaApi) return;
19026
+ const onSelect = () => {
19027
+ setIndex(emblaApi.selectedScrollSnap());
19028
+ };
19029
+ emblaApi.on("select", onSelect);
19030
+ emblaApi.on("reInit", onSelect);
19031
+ return () => {
19032
+ emblaApi.off("select", onSelect);
19033
+ emblaApi.off("reInit", onSelect);
19034
+ };
19035
+ }, [emblaApi]);
18962
19036
  React32.useEffect(() => {
18963
- if (!autoPlay || items.length <= 1) return;
19037
+ if (!autoPlay || items.length <= 1 || !emblaApi) return;
18964
19038
  const interval = setInterval(() => {
18965
- setIndex((i) => (i + 1) % items.length);
19039
+ emblaApi.scrollNext();
18966
19040
  }, autoPlayInterval);
18967
19041
  return () => clearInterval(interval);
18968
- }, [autoPlay, autoPlayInterval, items.length]);
19042
+ }, [autoPlay, autoPlayInterval, items.length, emblaApi]);
19043
+ React32.useEffect(() => {
19044
+ if (emblaApi && index !== emblaApi.selectedScrollSnap()) {
19045
+ emblaApi.scrollTo(index);
19046
+ }
19047
+ }, [index, emblaApi]);
18969
19048
  const handleDownload = async () => {
18970
19049
  if (isDownloading) return;
18971
19050
  setIsDownloading(true);
@@ -18990,21 +19069,39 @@ function CarouselBase({
18990
19069
  setIsDownloading(false);
18991
19070
  }
18992
19071
  };
18993
- return /* @__PURE__ */ jsxRuntime.jsx(
18994
- "div",
19072
+ if (isLoading) {
19073
+ return /* @__PURE__ */ jsxRuntime.jsx(framerMotion.AnimatePresence, { children: /* @__PURE__ */ jsxRuntime.jsx(
19074
+ framerMotion.motion.div,
19075
+ {
19076
+ initial: { opacity: 0 },
19077
+ animate: { opacity: 1 },
19078
+ exit: { opacity: 0 },
19079
+ transition: { duration: 0.3 },
19080
+ style: { width, height },
19081
+ className: "h-full",
19082
+ children: /* @__PURE__ */ jsxRuntime.jsx(CarouselSkeleton, { className })
19083
+ },
19084
+ "carousel-skeleton"
19085
+ ) });
19086
+ }
19087
+ return /* @__PURE__ */ jsxRuntime.jsx(framerMotion.AnimatePresence, { children: /* @__PURE__ */ jsxRuntime.jsx(
19088
+ framerMotion.motion.div,
18995
19089
  {
19090
+ initial: { opacity: 0 },
19091
+ animate: { opacity: 1 },
19092
+ transition: { duration: 0.4 },
18996
19093
  className: cn("w-full lg:p-10 sm:p-4 p-2", className),
18997
19094
  style: { width, height },
18998
19095
  children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-col gap-3 h-full", children: /* @__PURE__ */ jsxRuntime.jsxs(
18999
19096
  "div",
19000
19097
  {
19001
19098
  className: cn(
19002
- "relative overflow-hidden rounded-lg h-full",
19099
+ "relative overflow-hidden rounded-lg h-full cursor-grab active:cursor-grabbing",
19003
19100
  containerClassName
19004
19101
  ),
19005
- ref: containerRef,
19102
+ ref: emblaRef,
19006
19103
  children: [
19007
- /* @__PURE__ */ jsxRuntime.jsx(framerMotion.motion.div, { className: "flex h-full", style: { x }, children: items.map((item) => /* @__PURE__ */ jsxRuntime.jsx("div", { className: "shrink-0 w-full h-full", children: isMobile || zoomEffect === "scale" ? /* @__PURE__ */ jsxRuntime.jsx(
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(
19008
19105
  ZoomImage,
19009
19106
  {
19010
19107
  src: item.url,
@@ -19121,10 +19218,10 @@ function CarouselBase({
19121
19218
  /* @__PURE__ */ jsxRuntime.jsx(
19122
19219
  framerMotion.motion.button,
19123
19220
  {
19124
- disabled: index === 0,
19125
- onClick: () => setIndex((i) => Math.max(0, i - 1)),
19221
+ disabled: !emblaApi?.canScrollPrev(),
19222
+ onClick: () => emblaApi?.scrollPrev(),
19126
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
19127
- ${index === 0 ? "opacity-40 cursor-not-allowed" : "bg-secondary hover:scale-110 hover:opacity-100 opacity-70"}`,
19224
+ ${!emblaApi?.canScrollPrev() ? "opacity-40 cursor-not-allowed" : "bg-secondary hover:scale-110 hover:opacity-100 opacity-70"}`,
19128
19225
  children: /* @__PURE__ */ jsxRuntime.jsx(
19129
19226
  "svg",
19130
19227
  {
@@ -19148,10 +19245,10 @@ function CarouselBase({
19148
19245
  /* @__PURE__ */ jsxRuntime.jsx(
19149
19246
  framerMotion.motion.button,
19150
19247
  {
19151
- disabled: index === items.length - 1,
19152
- onClick: () => setIndex((i) => Math.min(items.length - 1, i + 1)),
19248
+ disabled: !emblaApi?.canScrollNext(),
19249
+ onClick: () => emblaApi?.scrollNext(),
19153
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
19154
- ${index === items.length - 1 ? "opacity-40 cursor-not-allowed" : "bg-secondary hover:scale-110 hover:opacity-100 opacity-70"}`,
19251
+ ${!emblaApi?.canScrollNext() ? "opacity-40 cursor-not-allowed" : "bg-secondary hover:scale-110 hover:opacity-100 opacity-70"}`,
19155
19252
  children: /* @__PURE__ */ jsxRuntime.jsx(
19156
19253
  "svg",
19157
19254
  {
@@ -19176,7 +19273,7 @@ function CarouselBase({
19176
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(
19177
19274
  "button",
19178
19275
  {
19179
- onClick: () => setIndex(i),
19276
+ onClick: () => emblaApi?.scrollTo(i),
19180
19277
  className: `h-2 rounded-full transition-all ${i === index ? "w-8 bg-white" : "w-2 bg-white/50"}`
19181
19278
  },
19182
19279
  i
@@ -19184,8 +19281,240 @@ function CarouselBase({
19184
19281
  ]
19185
19282
  }
19186
19283
  ) })
19284
+ },
19285
+ "carousel-content"
19286
+ ) });
19287
+ }
19288
+ function useMediaQuery(query) {
19289
+ const [value, setValue] = React32__namespace.useState(false);
19290
+ React32__namespace.useEffect(() => {
19291
+ function onChange(event) {
19292
+ setValue(event.matches);
19293
+ }
19294
+ const result = window.matchMedia(query);
19295
+ result.addEventListener("change", onChange);
19296
+ setValue(result.matches);
19297
+ return () => result.removeEventListener("change", onChange);
19298
+ }, [query]);
19299
+ return value;
19300
+ }
19301
+ var FULL_CIRCLE = 360;
19302
+ var START_ANGLE = -90;
19303
+ function degToRad(deg) {
19304
+ return deg * Math.PI / 180;
19305
+ }
19306
+ function polarToCartesian(radius, angleDeg) {
19307
+ const rad = degToRad(angleDeg);
19308
+ return { x: Math.cos(rad) * radius, y: Math.sin(rad) * radius };
19309
+ }
19310
+ function slicePath(index, total, wedgeRadius, innerRadius) {
19311
+ if (total <= 0) return "";
19312
+ const anglePerSlice = FULL_CIRCLE / total;
19313
+ const midDeg = START_ANGLE + anglePerSlice * index;
19314
+ const halfSlice = anglePerSlice / 2;
19315
+ const startDeg = midDeg - halfSlice;
19316
+ const endDeg = midDeg + halfSlice;
19317
+ const outerStart = polarToCartesian(wedgeRadius, startDeg);
19318
+ const outerEnd = polarToCartesian(wedgeRadius, endDeg);
19319
+ const innerStart = polarToCartesian(innerRadius, startDeg);
19320
+ const innerEnd = polarToCartesian(innerRadius, endDeg);
19321
+ const largeArcFlag = anglePerSlice > 180 ? 1 : 0;
19322
+ return `M ${outerStart.x} ${outerStart.y} A ${wedgeRadius} ${wedgeRadius} 0 ${largeArcFlag} 1 ${outerEnd.x} ${outerEnd.y} L ${innerEnd.x} ${innerEnd.y} A ${innerRadius} ${innerRadius} 0 ${largeArcFlag} 0 ${innerStart.x} ${innerStart.y} Z`;
19323
+ }
19324
+ function RadialMenu({
19325
+ children,
19326
+ menuItems,
19327
+ size = 240,
19328
+ iconSize = 24,
19329
+ bandWidth = 60,
19330
+ innerGap = 16,
19331
+ outerGap = 12,
19332
+ outerRingWidth = 8,
19333
+ onSelect
19334
+ }) {
19335
+ const isMobile = useMediaQuery("(max-width: 768px)");
19336
+ const radius = size / 2;
19337
+ const outerRingOuterRadius = radius;
19338
+ const outerRingInnerRadius = outerRingOuterRadius - outerRingWidth;
19339
+ const wedgeOuterRadius = outerRingInnerRadius - outerGap;
19340
+ const wedgeInnerRadius = wedgeOuterRadius - bandWidth;
19341
+ const iconRingRadius = (wedgeOuterRadius + wedgeInnerRadius) / 2;
19342
+ const centerRadius = Math.max(wedgeInnerRadius - innerGap, 0);
19343
+ const slice = 360 / menuItems.length;
19344
+ const [activeIndex, setActiveIndex] = React32__namespace.useState(null);
19345
+ const timerRef = React32__namespace.useRef(null);
19346
+ const isLongPress = React32__namespace.useRef(false);
19347
+ const handleTouchStart = (e) => {
19348
+ isLongPress.current = false;
19349
+ const touch = e.touches[0];
19350
+ const { clientX, clientY } = touch;
19351
+ timerRef.current = setTimeout(() => {
19352
+ isLongPress.current = true;
19353
+ const event = new MouseEvent("contextmenu", {
19354
+ bubbles: true,
19355
+ cancelable: true,
19356
+ view: window,
19357
+ clientX,
19358
+ clientY,
19359
+ button: 2,
19360
+ buttons: 2
19361
+ });
19362
+ e.target.dispatchEvent(event);
19363
+ }, 1e3);
19364
+ };
19365
+ const handleTouchEnd = () => {
19366
+ if (timerRef.current) {
19367
+ clearTimeout(timerRef.current);
19187
19368
  }
19188
- );
19369
+ };
19370
+ const handleTouchMove = () => {
19371
+ if (timerRef.current) {
19372
+ clearTimeout(timerRef.current);
19373
+ }
19374
+ };
19375
+ const containerVariants = {
19376
+ hidden: { opacity: 0, scale: 0.8 },
19377
+ visible: {
19378
+ opacity: 1,
19379
+ scale: 1,
19380
+ transition: isMobile ? { duration: 0 } : {
19381
+ delayChildren: 0.05,
19382
+ staggerChildren: 0.03,
19383
+ type: "spring",
19384
+ stiffness: 300,
19385
+ damping: 24
19386
+ }
19387
+ },
19388
+ exit: {
19389
+ opacity: 0,
19390
+ scale: 0.8,
19391
+ transition: isMobile ? { duration: 0 } : { duration: 0.15 }
19392
+ }
19393
+ };
19394
+ const itemVariants2 = {
19395
+ hidden: { opacity: 0, scale: 0, rotate: -20 },
19396
+ visible: {
19397
+ opacity: 1,
19398
+ scale: 1,
19399
+ rotate: 0,
19400
+ transition: isMobile ? { duration: 0 } : { type: "spring", stiffness: 400, damping: 20 }
19401
+ }
19402
+ };
19403
+ return /* @__PURE__ */ jsxRuntime.jsxs(ContextMenuBase, { children: [
19404
+ /* @__PURE__ */ jsxRuntime.jsx(ContextMenuTriggerBase, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
19405
+ "div",
19406
+ {
19407
+ className: "select-none outline-none group touch-none",
19408
+ onTouchStart: handleTouchStart,
19409
+ onTouchEnd: handleTouchEnd,
19410
+ onTouchMove: handleTouchMove,
19411
+ children: children || /* @__PURE__ */ jsxRuntime.jsx("div", { className: "size-80 flex justify-center items-center border-2 border-dashed border-muted-foreground/20 rounded-xl bg-muted/5 text-muted-foreground hover:bg-muted/10 transition-colors", children: "Right-click or Long-press here (1s)" })
19412
+ }
19413
+ ) }),
19414
+ /* @__PURE__ */ jsxRuntime.jsx(
19415
+ ContextMenuContentBase,
19416
+ {
19417
+ className: "p-0 border-none bg-transparent shadow-none overflow-visible -translate-x-1/2 -translate-y-1/2",
19418
+ style: { width: size, height: size },
19419
+ children: /* @__PURE__ */ jsxRuntime.jsx(framerMotion.AnimatePresence, { mode: "wait", children: /* @__PURE__ */ jsxRuntime.jsxs(
19420
+ framerMotion.motion.div,
19421
+ {
19422
+ className: "relative size-full drop-shadow-xl will-change-transform",
19423
+ variants: containerVariants,
19424
+ initial: "hidden",
19425
+ animate: "visible",
19426
+ exit: "exit",
19427
+ children: [
19428
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute inset-0 rounded-full bg-background/5 blur-2xl -z-10" }),
19429
+ /* @__PURE__ */ jsxRuntime.jsxs(
19430
+ "svg",
19431
+ {
19432
+ className: "absolute inset-0 size-full overflow-visible",
19433
+ viewBox: `${-radius} ${-radius} ${radius * 2} ${radius * 2}`,
19434
+ children: [
19435
+ /* @__PURE__ */ jsxRuntime.jsx(
19436
+ framerMotion.motion.circle,
19437
+ {
19438
+ r: centerRadius,
19439
+ initial: { scale: 0 },
19440
+ animate: { scale: 1 },
19441
+ transition: isMobile ? { duration: 0 } : {
19442
+ type: "spring",
19443
+ stiffness: 300,
19444
+ delay: 0.2
19445
+ },
19446
+ className: "fill-background stroke-border stroke-1 shadow-inner"
19447
+ }
19448
+ ),
19449
+ menuItems.map((item, index) => {
19450
+ const Icon = item.icon;
19451
+ const midDeg = START_ANGLE + slice * index;
19452
+ const { x: iconX, y: iconY } = polarToCartesian(
19453
+ iconRingRadius,
19454
+ midDeg
19455
+ );
19456
+ const isActive = activeIndex === index;
19457
+ const ICON_BOX = iconSize * 2.5;
19458
+ return /* @__PURE__ */ jsxRuntime.jsxs(
19459
+ framerMotion.motion.g,
19460
+ {
19461
+ variants: itemVariants2,
19462
+ className: "cursor-pointer outline-none",
19463
+ onMouseEnter: () => setActiveIndex(index),
19464
+ onMouseLeave: () => setActiveIndex(null),
19465
+ onClick: () => onSelect?.(item),
19466
+ style: { originX: "0px", originY: "0px" },
19467
+ children: [
19468
+ /* @__PURE__ */ jsxRuntime.jsx(
19469
+ "path",
19470
+ {
19471
+ d: slicePath(
19472
+ index,
19473
+ menuItems.length,
19474
+ wedgeOuterRadius,
19475
+ wedgeInnerRadius
19476
+ ),
19477
+ className: cn(
19478
+ "transition-colors duration-200 stroke-1",
19479
+ isActive ? "fill-primary stroke-primary-foreground/20" : "fill-background/90 stroke-border/50 hover:fill-accent"
19480
+ )
19481
+ }
19482
+ ),
19483
+ /* @__PURE__ */ jsxRuntime.jsx(
19484
+ "foreignObject",
19485
+ {
19486
+ x: iconX - ICON_BOX / 2,
19487
+ y: iconY - ICON_BOX / 2,
19488
+ width: ICON_BOX,
19489
+ height: ICON_BOX,
19490
+ className: "pointer-events-none",
19491
+ children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "size-full flex items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(
19492
+ Icon,
19493
+ {
19494
+ size: iconSize,
19495
+ weight: isActive ? "fill" : "regular",
19496
+ className: cn(
19497
+ "transition-all duration-200",
19498
+ isActive ? "text-primary-foreground " : "text-muted-foreground"
19499
+ )
19500
+ }
19501
+ ) })
19502
+ }
19503
+ )
19504
+ ]
19505
+ },
19506
+ item.id
19507
+ );
19508
+ })
19509
+ ]
19510
+ }
19511
+ )
19512
+ ]
19513
+ }
19514
+ ) })
19515
+ }
19516
+ )
19517
+ ] });
19189
19518
  }
19190
19519
 
19191
19520
  exports.AddButton = AddButton;
@@ -19399,6 +19728,7 @@ exports.ProgressBase = ProgressBase;
19399
19728
  exports.ProgressCirclesBase = ProgressCirclesBase;
19400
19729
  exports.ProgressPanelsBase = ProgressPanelsBase;
19401
19730
  exports.ProgressSegmentsBase = ProgressSegmentsBase;
19731
+ exports.RadialMenu = RadialMenu;
19402
19732
  exports.RangePicker = RangePicker;
19403
19733
  exports.RefreshButton = RefreshButton;
19404
19734
  exports.SaveButton = SaveButton;