@mlw-packages/react-components 1.10.20 → 1.10.22

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
@@ -3485,58 +3485,100 @@ var ThemeIcon = ({ theme }) => {
3485
3485
  }
3486
3486
  ) });
3487
3487
  };
3488
+ function resolveOrigin(origin, buttonRef, cursorPos) {
3489
+ if (origin === "cursor" && cursorPos) {
3490
+ return cursorPos;
3491
+ }
3492
+ if (!buttonRef.current) {
3493
+ return { x: window.innerWidth / 2, y: window.innerHeight / 2 };
3494
+ }
3495
+ const rect = buttonRef.current.getBoundingClientRect();
3496
+ switch (origin) {
3497
+ case "top-left":
3498
+ return { x: rect.left, y: rect.top };
3499
+ case "top-right":
3500
+ return { x: rect.right, y: rect.top };
3501
+ case "center":
3502
+ default:
3503
+ return { x: rect.left + rect.width / 2, y: rect.top + rect.height / 2 };
3504
+ }
3505
+ }
3488
3506
  function ModeToggleBase({
3489
3507
  themes = ["light", "dark", "system"],
3490
3508
  className,
3491
3509
  directToggle = false,
3492
- variant = "ghost"
3510
+ variant = "ghost",
3511
+ showLabel = false,
3512
+ tooltip = false,
3513
+ animationOrigin = "center",
3514
+ transitionDuration = 400,
3515
+ storageKey,
3516
+ defaultTheme,
3517
+ onThemeChange
3493
3518
  }) {
3494
3519
  const [mounted, setMounted] = React32.useState(false);
3520
+ const [isTransitioning, setIsTransitioning] = React32.useState(false);
3521
+ const cursorPos = React32.useRef(null);
3495
3522
  const { setTheme, theme: currentTheme } = useTheme();
3496
3523
  const buttonRef = React32.useRef(null);
3497
3524
  React32.useEffect(() => {
3525
+ if (storageKey && defaultTheme) {
3526
+ const stored = localStorage.getItem(storageKey);
3527
+ if (!stored) setTheme(defaultTheme);
3528
+ } else if (defaultTheme && !localStorage.getItem("theme")) {
3529
+ setTheme(defaultTheme);
3530
+ }
3498
3531
  setMounted(true);
3499
- }, []);
3532
+ }, [defaultTheme, setTheme, storageKey]);
3500
3533
  const isDark = mounted && (currentTheme?.includes("dark") || currentTheme === "system" && typeof window !== "undefined" && window.matchMedia("(prefers-color-scheme: dark)").matches);
3534
+ const activeTheme = mounted ? currentTheme : defaultTheme;
3535
+ const tooltipText = tooltip === true ? themeLabels[activeTheme] ?? "Toggle theme" : typeof tooltip === "string" ? tooltip : null;
3501
3536
  const toggleTheme = async (newTheme) => {
3537
+ if (isTransitioning) return;
3502
3538
  if (!buttonRef.current) {
3503
3539
  setTheme(newTheme);
3540
+ onThemeChange?.(newTheme);
3504
3541
  return;
3505
3542
  }
3506
3543
  const supportsViewTransition = typeof document !== "undefined" && "startViewTransition" in document && typeof document.startViewTransition === "function";
3507
3544
  if (!supportsViewTransition) {
3508
3545
  setTheme(newTheme);
3546
+ onThemeChange?.(newTheme);
3509
3547
  return;
3510
3548
  }
3511
3549
  try {
3512
- const rect = buttonRef.current.getBoundingClientRect();
3513
- const x = rect.left + rect.width / 2;
3514
- const y = rect.top + rect.height / 2;
3550
+ setIsTransitioning(true);
3551
+ const { x, y } = resolveOrigin(
3552
+ animationOrigin,
3553
+ buttonRef,
3554
+ cursorPos.current
3555
+ );
3515
3556
  const endRadius = Math.hypot(
3516
3557
  Math.max(x, window.innerWidth - x),
3517
3558
  Math.max(y, window.innerHeight - y)
3518
3559
  );
3519
3560
  const transition = document.startViewTransition(async () => {
3520
3561
  setTheme(newTheme);
3562
+ onThemeChange?.(newTheme);
3521
3563
  });
3522
3564
  await transition.ready;
3523
- document.documentElement.animate(
3565
+ const animation = document.documentElement.animate(
3524
3566
  [
3525
- {
3526
- clipPath: `circle(0px at ${x}px ${y}px)`
3527
- },
3528
- {
3529
- clipPath: `circle(${Math.ceil(endRadius)}px at ${x}px ${y}px)`
3530
- }
3567
+ { clipPath: `circle(0px at ${x}px ${y}px)` },
3568
+ { clipPath: `circle(${Math.ceil(endRadius)}px at ${x}px ${y}px)` }
3531
3569
  ],
3532
3570
  {
3533
- duration: 400,
3571
+ duration: transitionDuration,
3534
3572
  easing: "cubic-bezier(0.4, 0, 0.2, 1)",
3535
3573
  pseudoElement: "::view-transition-new(root)"
3536
3574
  }
3537
3575
  );
3576
+ animation.onfinish = () => setIsTransitioning(false);
3577
+ animation.oncancel = () => setIsTransitioning(false);
3538
3578
  } catch {
3539
3579
  setTheme(newTheme);
3580
+ onThemeChange?.(newTheme);
3581
+ setIsTransitioning(false);
3540
3582
  }
3541
3583
  };
3542
3584
  const handleDirectToggle = () => {
@@ -3544,67 +3586,72 @@ function ModeToggleBase({
3544
3586
  const nextIndex = (currentIndex + 1) % themes.length;
3545
3587
  toggleTheme(themes[nextIndex]);
3546
3588
  };
3547
- if (directToggle) {
3548
- return /* @__PURE__ */ jsxRuntime.jsxs(
3549
- ButtonBase,
3589
+ const handleMouseMove = (e) => {
3590
+ cursorPos.current = { x: e.clientX, y: e.clientY };
3591
+ };
3592
+ const buttonContent = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
3593
+ /* @__PURE__ */ jsxRuntime.jsx(
3594
+ react.SunIcon,
3550
3595
  {
3551
- ref: buttonRef,
3552
- variant,
3553
- size: "icon",
3554
- className: cn("relative overflow-hidden group", className),
3555
- onClick: handleDirectToggle,
3556
- children: [
3557
- /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
3558
- /* @__PURE__ */ jsxRuntime.jsx(
3559
- react.SunIcon,
3560
- {
3561
- className: `h-[1.2rem] w-[1.2rem] transition-all duration-500 ${isDark ? "rotate-90 scale-0 opacity-0" : "rotate-0 scale-100 opacity-100 group-hover:rotate-12"}`
3562
- }
3563
- ),
3564
- /* @__PURE__ */ jsxRuntime.jsx(
3565
- react.MoonIcon,
3566
- {
3567
- className: `absolute h-[1.2rem] w-[1.2rem] transition-all duration-500 ${isDark ? "rotate-0 scale-100 opacity-100 group-hover:-rotate-12" : "rotate-90 scale-0 opacity-0"}`
3568
- }
3569
- )
3570
- ] }),
3571
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: "Toggle theme" })
3572
- ]
3596
+ className: `h-[1.2rem] w-[1.2rem] transition-all duration-500 ${isDark ? "rotate-90 scale-0 opacity-0" : "rotate-0 scale-100 opacity-100 group-hover:rotate-12"}`
3573
3597
  }
3598
+ ),
3599
+ /* @__PURE__ */ jsxRuntime.jsx(
3600
+ react.MoonIcon,
3601
+ {
3602
+ className: `absolute h-[1.2rem] w-[1.2rem] transition-all duration-500 ${isDark ? "rotate-0 scale-100 opacity-100 group-hover:-rotate-12" : "rotate-90 scale-0 opacity-0"}`
3603
+ }
3604
+ ),
3605
+ showLabel && mounted && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ml-5 text-sm font-medium", children: themeLabels[activeTheme] }),
3606
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: "Toggle theme" })
3607
+ ] });
3608
+ const wrapWithTooltip = (node) => {
3609
+ if (!tooltipText) return node;
3610
+ return /* @__PURE__ */ jsxRuntime.jsx(TooltipProviderBase, { children: /* @__PURE__ */ jsxRuntime.jsxs(TooltipBase, { children: [
3611
+ /* @__PURE__ */ jsxRuntime.jsx(TooltipTriggerBase, { asChild: true, children: node }),
3612
+ /* @__PURE__ */ jsxRuntime.jsx(TooltipContentBase, { children: tooltipText })
3613
+ ] }) });
3614
+ };
3615
+ if (directToggle) {
3616
+ return wrapWithTooltip(
3617
+ /* @__PURE__ */ jsxRuntime.jsx(
3618
+ ButtonBase,
3619
+ {
3620
+ ref: buttonRef,
3621
+ variant,
3622
+ size: showLabel ? "default" : "icon",
3623
+ className: cn("relative overflow-hidden group", className),
3624
+ onClick: handleDirectToggle,
3625
+ onMouseMove: handleMouseMove,
3626
+ onKeyDown: (e) => {
3627
+ if (e.repeat && (e.key === "Enter" || e.key === " ")) {
3628
+ e.preventDefault();
3629
+ }
3630
+ },
3631
+ children: buttonContent
3632
+ }
3633
+ )
3574
3634
  );
3575
3635
  }
3576
3636
  return /* @__PURE__ */ jsxRuntime.jsxs(DropDownMenuBase, { children: [
3577
- /* @__PURE__ */ jsxRuntime.jsx(DropDownMenuTriggerBase, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(
3578
- ButtonBase,
3579
- {
3580
- ref: buttonRef,
3581
- variant,
3582
- size: "icon",
3583
- className: cn("relative overflow-hidden group", className),
3584
- children: [
3585
- /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
3586
- /* @__PURE__ */ jsxRuntime.jsx(
3587
- react.SunIcon,
3588
- {
3589
- className: `h-[1.2rem] w-[1.2rem] transition-all duration-500 ${isDark ? "rotate-90 scale-0 opacity-0" : "rotate-0 scale-100 opacity-100 group-hover:rotate-12"}`
3590
- }
3591
- ),
3592
- /* @__PURE__ */ jsxRuntime.jsx(
3593
- react.MoonIcon,
3594
- {
3595
- className: `absolute h-[1.2rem] w-[1.2rem] transition-all duration-500 ${isDark ? "rotate-0 scale-100 opacity-100 group-hover:-rotate-12" : "rotate-90 scale-0 opacity-0"}`
3596
- }
3597
- )
3598
- ] }),
3599
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: "Toggle theme" })
3600
- ]
3601
- }
3637
+ /* @__PURE__ */ jsxRuntime.jsx(DropDownMenuTriggerBase, { asChild: true, children: wrapWithTooltip(
3638
+ /* @__PURE__ */ jsxRuntime.jsx(
3639
+ ButtonBase,
3640
+ {
3641
+ ref: buttonRef,
3642
+ variant,
3643
+ size: showLabel ? "default" : "icon",
3644
+ className: cn("relative overflow-hidden group", className),
3645
+ onMouseMove: handleMouseMove,
3646
+ children: buttonContent
3647
+ }
3648
+ )
3602
3649
  ) }),
3603
3650
  /* @__PURE__ */ jsxRuntime.jsx(
3604
3651
  DropDownMenuContentBase,
3605
3652
  {
3606
3653
  align: "end",
3607
- className: "border-border bg-popover text-popover-foreground min-w-[140px] ",
3654
+ className: "border-border bg-popover text-popover-foreground min-w-[140px]",
3608
3655
  children: themes.map((theme) => {
3609
3656
  const isActive = currentTheme === theme;
3610
3657
  return /* @__PURE__ */ jsxRuntime.jsxs(
@@ -9669,7 +9716,8 @@ function DayViewAgenda({
9669
9716
  events,
9670
9717
  onEventSelect,
9671
9718
  showUndatedEvents,
9672
- noTime = false
9719
+ noTime = false,
9720
+ onEventCreate
9673
9721
  }) {
9674
9722
  const hours = React32.useMemo(() => {
9675
9723
  const dayStart = dateFns.startOfDay(currentDate);
@@ -9919,6 +9967,7 @@ function DayViewAgenda({
9919
9967
  const startTime = new Date(currentDate);
9920
9968
  startTime.setHours(hourValue);
9921
9969
  startTime.setMinutes(quarter * 15);
9970
+ if (onEventCreate) onEventCreate(startTime);
9922
9971
  },
9923
9972
  time: quarterHourTime
9924
9973
  },
@@ -10181,7 +10230,8 @@ function EventAgenda({
10181
10230
  onlyMonth,
10182
10231
  onlyWeek,
10183
10232
  onlyAgenda,
10184
- onlyYear
10233
+ onlyYear,
10234
+ allowCellClick = false
10185
10235
  }) {
10186
10236
  const lockedView = onlyDay ? "day" : onlyMonth ? "month" : onlyWeek ? "week" : onlyAgenda ? "agenda" : onlyYear ? "year" : void 0;
10187
10237
  const [currentDate, setCurrentDate] = React32.useState(
@@ -10344,7 +10394,13 @@ function EventAgenda({
10344
10394
  currentDate,
10345
10395
  events,
10346
10396
  onEventSelect: handleEventSelect,
10347
- noTime
10397
+ noTime,
10398
+ onEventCreate: allowCellClick ? (d) => onEventUpdate?.({
10399
+ start: d,
10400
+ end: d,
10401
+ title: "Novo Evento",
10402
+ id: crypto.randomUUID()
10403
+ }) : void 0
10348
10404
  }
10349
10405
  ),
10350
10406
  activeView === "week" && /* @__PURE__ */ jsxRuntime.jsx(
@@ -10353,7 +10409,13 @@ function EventAgenda({
10353
10409
  currentDate,
10354
10410
  events,
10355
10411
  onEventSelect: handleEventSelect,
10356
- noTime
10412
+ noTime,
10413
+ onEventCreate: allowCellClick ? (d) => onEventUpdate?.({
10414
+ start: d,
10415
+ end: d,
10416
+ title: "Novo Evento",
10417
+ id: crypto.randomUUID()
10418
+ }) : void 0
10357
10419
  }
10358
10420
  ),
10359
10421
  activeView === "day" && /* @__PURE__ */ jsxRuntime.jsx(
@@ -10362,7 +10424,13 @@ function EventAgenda({
10362
10424
  currentDate,
10363
10425
  events,
10364
10426
  onEventSelect: handleEventSelect,
10365
- noTime
10427
+ noTime,
10428
+ onEventCreate: allowCellClick ? (d) => onEventUpdate?.({
10429
+ start: d,
10430
+ end: d,
10431
+ title: "Novo Evento",
10432
+ id: crypto.randomUUID()
10433
+ }) : void 0
10366
10434
  }
10367
10435
  ),
10368
10436
  activeView === "agenda" && /* @__PURE__ */ jsxRuntime.jsx(
@@ -10371,7 +10439,13 @@ function EventAgenda({
10371
10439
  currentDate,
10372
10440
  events,
10373
10441
  onEventSelect: handleEventSelect,
10374
- noTime
10442
+ noTime,
10443
+ onEventCreate: allowCellClick ? (d) => onEventUpdate?.({
10444
+ start: d,
10445
+ end: d,
10446
+ title: "Novo Evento",
10447
+ id: crypto.randomUUID()
10448
+ }) : void 0
10375
10449
  }
10376
10450
  ),
10377
10451
  activeView === "year" && /* @__PURE__ */ jsxRuntime.jsx(
@@ -10634,7 +10708,8 @@ function MonthViewAgenda({
10634
10708
  events,
10635
10709
  onEventSelect,
10636
10710
  showUndatedEvents,
10637
- noTime = false
10711
+ noTime = false,
10712
+ onEventCreate
10638
10713
  }) {
10639
10714
  const days = React32.useMemo(() => {
10640
10715
  const monthStart = dateFns.startOfMonth(currentDate);
@@ -10777,6 +10852,7 @@ function MonthViewAgenda({
10777
10852
  onClick: () => {
10778
10853
  const t = new Date(day);
10779
10854
  t.setHours(DefaultStartHourAgenda, 0, 0);
10855
+ if (onEventCreate) onEventCreate(t);
10780
10856
  },
10781
10857
  children: [
10782
10858
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -16115,7 +16191,8 @@ var DraggableTooltipComponent = ({
16115
16191
  highlightedSeries,
16116
16192
  toggleHighlight,
16117
16193
  finalColors,
16118
- valueFormatter
16194
+ valueFormatter,
16195
+ seriesTypeMap
16119
16196
  ]
16120
16197
  ),
16121
16198
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-3 pt-2 border-t", children: /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "text-xs text-muted-foreground flex items-center gap-1", children: [
@@ -16409,74 +16486,106 @@ var SystemTooltip = ({
16409
16486
  const [localPos, setLocalPos] = React32.useState(position);
16410
16487
  const [dragging, setDragging] = React32.useState(false);
16411
16488
  const offsetRef = React32.useRef({ x: 0, y: 0 });
16412
- const lastMouse = React32.useRef({ x: 0, y: 0 });
16413
- React32.useEffect(() => setLocalPos(position), [position]);
16489
+ const lastPos = React32.useRef({ x: 0, y: 0 });
16490
+ const tooltipRef = React32.useRef(null);
16491
+ const currentPosRef = React32.useRef(position);
16492
+ React32.useEffect(() => {
16493
+ currentPosRef.current = position;
16494
+ setLocalPos(position);
16495
+ }, [position]);
16414
16496
  React32.useEffect(() => {
16415
16497
  let rafId = null;
16416
- const handleMouseMove = (e) => {
16417
- if (!dragging) return;
16418
- lastMouse.current = { x: e.clientX, y: e.clientY };
16498
+ const applyMove = (clientX, clientY) => {
16499
+ lastPos.current = { x: clientX, y: clientY };
16419
16500
  if (rafId) cancelAnimationFrame(rafId);
16420
16501
  rafId = requestAnimationFrame(() => {
16421
- const newLeft = lastMouse.current.x - offsetRef.current.x;
16422
- const newTop = lastMouse.current.y - offsetRef.current.y;
16423
- const rawPosition = {
16424
- top: Math.max(0, Math.min(newTop, window.innerHeight - 200)),
16425
- left: Math.max(0, Math.min(newLeft, window.innerWidth - 320))
16502
+ const p = {
16503
+ top: Math.max(
16504
+ 0,
16505
+ Math.min(
16506
+ lastPos.current.y - offsetRef.current.y,
16507
+ window.innerHeight - 200
16508
+ )
16509
+ ),
16510
+ left: Math.max(
16511
+ 0,
16512
+ Math.min(
16513
+ lastPos.current.x - offsetRef.current.x,
16514
+ window.innerWidth - 320
16515
+ )
16516
+ )
16426
16517
  };
16427
- setLocalPos(rawPosition);
16428
- if (onPositionChange) onPositionChange(id, rawPosition);
16518
+ currentPosRef.current = p;
16519
+ if (tooltipRef.current) {
16520
+ tooltipRef.current.style.top = `${p.top}px`;
16521
+ tooltipRef.current.style.left = `${p.left}px`;
16522
+ }
16523
+ onPositionChange?.(id, p);
16429
16524
  });
16430
16525
  };
16431
- const handleMouseUp = () => {
16432
- if (dragging) {
16433
- setDragging(false);
16434
- if (rafId) cancelAnimationFrame(rafId);
16435
- }
16526
+ const stopDrag = () => {
16527
+ if (!dragging) return;
16528
+ setDragging(false);
16529
+ setLocalPos(currentPosRef.current);
16530
+ if (rafId) cancelAnimationFrame(rafId);
16531
+ };
16532
+ const handleMouseMove = (e) => {
16533
+ if (dragging) applyMove(e.clientX, e.clientY);
16534
+ };
16535
+ const handleTouchMove = (e) => {
16536
+ if (!dragging || !e.touches[0]) return;
16537
+ applyMove(e.touches[0].clientX, e.touches[0].clientY);
16436
16538
  };
16437
16539
  if (dragging) {
16438
16540
  document.addEventListener("mousemove", handleMouseMove, {
16439
16541
  passive: true
16440
16542
  });
16441
- document.addEventListener("mouseup", handleMouseUp);
16543
+ document.addEventListener("mouseup", stopDrag);
16544
+ document.addEventListener("touchmove", handleTouchMove, {
16545
+ passive: true
16546
+ });
16547
+ document.addEventListener("touchend", stopDrag);
16548
+ document.addEventListener("touchcancel", stopDrag);
16442
16549
  document.body.style.cursor = "grabbing";
16443
16550
  document.body.style.userSelect = "none";
16444
16551
  }
16445
16552
  return () => {
16446
16553
  if (rafId) cancelAnimationFrame(rafId);
16447
16554
  document.removeEventListener("mousemove", handleMouseMove);
16448
- document.removeEventListener("mouseup", handleMouseUp);
16555
+ document.removeEventListener("mouseup", stopDrag);
16556
+ document.removeEventListener("touchmove", handleTouchMove);
16557
+ document.removeEventListener("touchend", stopDrag);
16558
+ document.removeEventListener("touchcancel", stopDrag);
16449
16559
  document.body.style.cursor = "";
16450
16560
  document.body.style.userSelect = "";
16451
16561
  };
16452
16562
  }, [dragging, id, onPositionChange]);
16453
- const handleMouseDownLocal = React32.useCallback(
16454
- (e) => {
16455
- e.preventDefault();
16456
- e.stopPropagation();
16457
- const rect = e.currentTarget.closest(".fixed")?.getBoundingClientRect();
16563
+ const startDrag = React32.useCallback(
16564
+ (clientX, clientY, e) => {
16565
+ const rect = tooltipRef.current?.getBoundingClientRect();
16458
16566
  if (!rect) return;
16459
- offsetRef.current = { x: e.clientX - rect.left, y: e.clientY - rect.top };
16567
+ offsetRef.current = { x: clientX - rect.left, y: clientY - rect.top };
16460
16568
  setDragging(true);
16461
16569
  onMouseDown?.(id, e);
16462
16570
  },
16463
16571
  [id, onMouseDown]
16464
16572
  );
16573
+ const handleMouseDownLocal = React32.useCallback(
16574
+ (e) => {
16575
+ e.preventDefault();
16576
+ e.stopPropagation();
16577
+ startDrag(e.clientX, e.clientY, e);
16578
+ },
16579
+ [startDrag]
16580
+ );
16465
16581
  const handleTouchStartLocal = React32.useCallback(
16466
16582
  (e) => {
16467
16583
  e.stopPropagation();
16468
16584
  const touch = e.touches[0];
16469
16585
  if (!touch) return;
16470
- const rect = e.currentTarget.closest(".fixed")?.getBoundingClientRect();
16471
- if (!rect) return;
16472
- offsetRef.current = {
16473
- x: touch.clientX - rect.left,
16474
- y: touch.clientY - rect.top
16475
- };
16476
- setDragging(true);
16477
- onMouseDown?.(id, e);
16586
+ startDrag(touch.clientX, touch.clientY, e);
16478
16587
  },
16479
- [id, onMouseDown]
16588
+ [startDrag]
16480
16589
  );
16481
16590
  const handleConnClick = React32.useCallback(
16482
16591
  (e, conn) => {
@@ -16524,15 +16633,13 @@ var SystemTooltip = ({
16524
16633
  return /* @__PURE__ */ jsxRuntime.jsx(framerMotion.AnimatePresence, { children: /* @__PURE__ */ jsxRuntime.jsxs(
16525
16634
  framerMotion.motion.div,
16526
16635
  {
16636
+ ref: tooltipRef,
16527
16637
  className: "fixed bg-card/95 backdrop-blur-md border border-border/50 rounded-xl shadow-2xl z-[10000] w-80 overflow-hidden",
16528
16638
  variants: tooltipVariants2,
16529
16639
  initial: "hidden",
16530
16640
  animate: "visible",
16531
16641
  exit: "exit",
16532
- style: {
16533
- top: localPos.top,
16534
- left: localPos.left
16535
- },
16642
+ style: { top: localPos.top, left: localPos.left },
16536
16643
  onClick: (e) => e.stopPropagation(),
16537
16644
  children: [
16538
16645
  /* @__PURE__ */ jsxRuntime.jsxs(
@@ -16547,7 +16654,7 @@ var SystemTooltip = ({
16547
16654
  },
16548
16655
  children: [
16549
16656
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 px-3", children: [
16550
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "rounded", children: /* @__PURE__ */ jsxRuntime.jsx(react.DotsSixVerticalIcon, { size: 16, className: "text-primary" }) }),
16657
+ /* @__PURE__ */ jsxRuntime.jsx(react.DotsSixVerticalIcon, { size: 16, className: "text-primary" }),
16551
16658
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs font-semibold text-muted-foreground uppercase tracking-wider", children: title })
16552
16659
  ] }),
16553
16660
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -16573,22 +16680,19 @@ var SystemTooltip = ({
16573
16680
  ] }) }),
16574
16681
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "px-3 pb-4 space-y-4 max-h-[300px] overflow-y-auto [&::-webkit-scrollbar]:w-1 [&::-webkit-scrollbar-track]:bg-transparent [&::-webkit-scrollbar-thumb]:bg-muted-foreground/20 [&::-webkit-scrollbar-thumb]:rounded-full hover:[&::-webkit-scrollbar-thumb]:bg-muted-foreground/40 transition-colors", children: [
16575
16682
  /* @__PURE__ */ jsxRuntime.jsx(SeparatorBase, { className: "w-full" }),
16576
- isLoading ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
16577
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2", children: [
16578
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 px-1", children: [
16579
- /* @__PURE__ */ jsxRuntime.jsx(SkeletonBase, { className: "w-1.5 h-1.5 rounded-full" }),
16580
- /* @__PURE__ */ jsxRuntime.jsx(SkeletonBase, { className: "h-3 w-16" })
16581
- ] }),
16582
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-1", children: [1, 2, 3].map((i) => /* @__PURE__ */ jsxRuntime.jsx(SkeletonBase, { className: "h-10 w-full rounded-lg" }, i)) })
16683
+ isLoading ? /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: [1, 2].map((g) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2", children: [
16684
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 px-1", children: [
16685
+ /* @__PURE__ */ jsxRuntime.jsx(SkeletonBase, { className: "w-1.5 h-1.5 rounded-full" }),
16686
+ /* @__PURE__ */ jsxRuntime.jsx(SkeletonBase, { className: "h-3 w-16" })
16583
16687
  ] }),
16584
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2", children: [
16585
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 px-1", children: [
16586
- /* @__PURE__ */ jsxRuntime.jsx(SkeletonBase, { className: "w-1.5 h-1.5 rounded-full" }),
16587
- /* @__PURE__ */ jsxRuntime.jsx(SkeletonBase, { className: "h-3 w-16" })
16588
- ] }),
16589
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-1", children: [1, 2].map((i) => /* @__PURE__ */ jsxRuntime.jsx(SkeletonBase, { className: "h-10 w-full rounded-lg" }, i)) })
16590
- ] })
16591
- ] }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
16688
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-1", children: [1, 2, 3].map((i) => /* @__PURE__ */ jsxRuntime.jsx(
16689
+ SkeletonBase,
16690
+ {
16691
+ className: "h-10 w-full rounded-lg"
16692
+ },
16693
+ i
16694
+ )) })
16695
+ ] }, g)) }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
16592
16696
  entries.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2", children: [
16593
16697
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 px-1", children: [
16594
16698
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-1.5 h-1.5 rounded-full bg-emerald-500" }),
@@ -16603,7 +16707,7 @@ var SystemTooltip = ({
16603
16707
  ] }),
16604
16708
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-1", children: renderConnections(exits, "blue") })
16605
16709
  ] }),
16606
- data.connections.length === 0 && !isLoading && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-col items-center justify-center p-6 text-center", children: /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted-foreground", children: "Nenhuma conex\xE3o encontrada" }) })
16710
+ data.connections.length === 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-col items-center justify-center p-6 text-center", children: /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted-foreground", children: "Nenhuma conex\xE3o encontrada" }) })
16607
16711
  ] })
16608
16712
  ] })
16609
16713
  ]
@@ -19986,6 +20090,308 @@ function processNeo4jData(integrations, targetSystemName) {
19986
20090
  connections
19987
20091
  };
19988
20092
  }
20093
+ var AnimatedNumber = ({ value }) => {
20094
+ const [displayed, setDisplayed] = React32__namespace.default.useState(value);
20095
+ const prevRef = React32__namespace.default.useRef(value);
20096
+ React32__namespace.default.useEffect(() => {
20097
+ const start = prevRef.current;
20098
+ const end = value;
20099
+ if (start === end) return;
20100
+ const duration = 420;
20101
+ const startTime = performance.now();
20102
+ const tick = (now) => {
20103
+ const elapsed = now - startTime;
20104
+ const progress = Math.min(elapsed / duration, 1);
20105
+ const eased = progress === 1 ? 1 : 1 - Math.pow(2, -10 * progress);
20106
+ setDisplayed(Math.round(start + (end - start) * eased));
20107
+ if (progress < 1) requestAnimationFrame(tick);
20108
+ else prevRef.current = end;
20109
+ };
20110
+ requestAnimationFrame(tick);
20111
+ }, [value]);
20112
+ return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: displayed });
20113
+ };
20114
+ var Callout = ({
20115
+ sx,
20116
+ sy,
20117
+ mx,
20118
+ my,
20119
+ ex,
20120
+ ey,
20121
+ fill,
20122
+ name,
20123
+ value,
20124
+ percent,
20125
+ isRight
20126
+ }) => /* @__PURE__ */ jsxRuntime.jsx(framerMotion.AnimatePresence, { children: /* @__PURE__ */ jsxRuntime.jsxs(
20127
+ framerMotion.motion.g,
20128
+ {
20129
+ initial: { opacity: 0 },
20130
+ animate: { opacity: 1 },
20131
+ exit: { opacity: 0 },
20132
+ transition: { duration: 0.18 },
20133
+ className: "z-9999",
20134
+ children: [
20135
+ /* @__PURE__ */ jsxRuntime.jsx(
20136
+ framerMotion.motion.path,
20137
+ {
20138
+ d: `M${sx},${sy}L${mx},${my}L${ex},${ey}`,
20139
+ stroke: fill,
20140
+ fill: "none",
20141
+ strokeWidth: 1.5,
20142
+ strokeLinecap: "round",
20143
+ initial: { pathLength: 0, opacity: 0 },
20144
+ animate: { pathLength: 1, opacity: 1 },
20145
+ exit: { pathLength: 0, opacity: 0 },
20146
+ transition: { duration: 0.32, ease: "easeInOut" }
20147
+ }
20148
+ ),
20149
+ /* @__PURE__ */ jsxRuntime.jsx(
20150
+ framerMotion.motion.circle,
20151
+ {
20152
+ cx: ex,
20153
+ cy: ey,
20154
+ r: 3,
20155
+ fill,
20156
+ initial: { scale: 0, opacity: 0 },
20157
+ animate: { scale: 1, opacity: 1 },
20158
+ exit: { scale: 0, opacity: 0 }
20159
+ }
20160
+ ),
20161
+ /* @__PURE__ */ jsxRuntime.jsx(
20162
+ "foreignObject",
20163
+ {
20164
+ x: isRight ? ex + 10 : ex - 90,
20165
+ y: ey - 24,
20166
+ width: 90,
20167
+ height: 48,
20168
+ style: { overflow: "visible" },
20169
+ children: /* @__PURE__ */ jsxRuntime.jsxs(
20170
+ framerMotion.motion.div,
20171
+ {
20172
+ initial: {
20173
+ opacity: 0,
20174
+ x: isRight ? -14 : 14,
20175
+ scale: 0.88,
20176
+ filter: "blur(4px)"
20177
+ },
20178
+ animate: { opacity: 1, x: 0, scale: 1, filter: "blur(0px)" },
20179
+ exit: {
20180
+ opacity: 0,
20181
+ x: isRight ? -8 : 8,
20182
+ scale: 0.92,
20183
+ filter: "blur(3px)"
20184
+ },
20185
+ transition: {
20186
+ type: "spring",
20187
+ stiffness: 460,
20188
+ damping: 26,
20189
+ mass: 0.8
20190
+ },
20191
+ style: { pointerEvents: "none" },
20192
+ children: [
20193
+ /* @__PURE__ */ jsxRuntime.jsxs(
20194
+ framerMotion.motion.div,
20195
+ {
20196
+ style: {
20197
+ fontSize: 15,
20198
+ fontWeight: 800,
20199
+ color: "#333",
20200
+ lineHeight: 1
20201
+ },
20202
+ initial: { y: 6, opacity: 0 },
20203
+ animate: { y: 0, opacity: 1 },
20204
+ exit: { y: -4, opacity: 0 },
20205
+ transition: {
20206
+ delay: 0.06,
20207
+ type: "spring",
20208
+ stiffness: 400,
20209
+ damping: 22
20210
+ },
20211
+ children: [
20212
+ "PV ",
20213
+ /* @__PURE__ */ jsxRuntime.jsx(AnimatedNumber, { value })
20214
+ ]
20215
+ }
20216
+ ),
20217
+ /* @__PURE__ */ jsxRuntime.jsxs(
20218
+ framerMotion.motion.div,
20219
+ {
20220
+ style: { fontSize: 11, color: "#999", marginTop: 5 },
20221
+ initial: { y: 6, opacity: 0 },
20222
+ animate: { y: 0, opacity: 1 },
20223
+ exit: { y: -4, opacity: 0 },
20224
+ transition: {
20225
+ delay: 0.12,
20226
+ type: "spring",
20227
+ stiffness: 400,
20228
+ damping: 22
20229
+ },
20230
+ children: [
20231
+ "Rate ",
20232
+ (percent * 100).toFixed(2),
20233
+ "%"
20234
+ ]
20235
+ }
20236
+ )
20237
+ ]
20238
+ },
20239
+ name
20240
+ )
20241
+ }
20242
+ )
20243
+ ]
20244
+ },
20245
+ name
20246
+ ) });
20247
+ var renderActiveShape = (props) => {
20248
+ const RADIAN = Math.PI / 180;
20249
+ const {
20250
+ cx,
20251
+ cy,
20252
+ midAngle,
20253
+ innerRadius,
20254
+ outerRadius,
20255
+ startAngle,
20256
+ endAngle,
20257
+ fill,
20258
+ payload,
20259
+ percent,
20260
+ value
20261
+ } = props;
20262
+ const sin = Math.sin(-RADIAN * (midAngle ?? 0));
20263
+ const cos = Math.cos(-RADIAN * (midAngle ?? 0));
20264
+ const sx = (cx ?? 0) + ((outerRadius ?? 0) + 10) * cos;
20265
+ const sy = (cy ?? 0) + ((outerRadius ?? 0) + 10) * sin;
20266
+ const mx = (cx ?? 0) + ((outerRadius ?? 0) + 30) * cos;
20267
+ const my = (cy ?? 0) + ((outerRadius ?? 0) + 30) * sin;
20268
+ const ex = mx + (cos >= 0 ? 1 : -1) * 22;
20269
+ const ey = my;
20270
+ return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
20271
+ /* @__PURE__ */ jsxRuntime.jsx("text", { x: cx, y: cy, dy: 8, textAnchor: "middle", fill, children: payload?.name }),
20272
+ /* @__PURE__ */ jsxRuntime.jsx(
20273
+ recharts.Sector,
20274
+ {
20275
+ cx,
20276
+ cy,
20277
+ innerRadius,
20278
+ outerRadius,
20279
+ startAngle,
20280
+ endAngle,
20281
+ fill
20282
+ }
20283
+ ),
20284
+ /* @__PURE__ */ jsxRuntime.jsx(
20285
+ recharts.Sector,
20286
+ {
20287
+ cx,
20288
+ cy,
20289
+ startAngle,
20290
+ endAngle,
20291
+ innerRadius: (outerRadius ?? 0) + 6,
20292
+ outerRadius: (outerRadius ?? 0) + 10,
20293
+ fill
20294
+ }
20295
+ ),
20296
+ /* @__PURE__ */ jsxRuntime.jsx(
20297
+ Callout,
20298
+ {
20299
+ sx,
20300
+ sy,
20301
+ mx,
20302
+ my,
20303
+ ex,
20304
+ ey,
20305
+ fill: fill ?? "#8884d8",
20306
+ name: payload?.name,
20307
+ value,
20308
+ percent: percent ?? 0,
20309
+ isRight: cos >= 0
20310
+ }
20311
+ )
20312
+ ] });
20313
+ };
20314
+ var PieChartComponent = ({
20315
+ data,
20316
+ width = 400,
20317
+ height = 300,
20318
+ innerRadius = 60,
20319
+ outerRadius = 80,
20320
+ showLegend = true,
20321
+ showTooltip = true,
20322
+ title,
20323
+ titlePosition = "left",
20324
+ className
20325
+ }) => {
20326
+ const [activeIndex, setActiveIndex] = React32.useState(0);
20327
+ const finalColors = Object.fromEntries(
20328
+ data.map((d) => [d.name, d.color || "#8884d8"])
20329
+ );
20330
+ return /* @__PURE__ */ jsxRuntime.jsxs(
20331
+ "div",
20332
+ {
20333
+ className: cn(
20334
+ "w-full overflow-hidden min-w-0 rounded-lg border-border bg-card",
20335
+ className
20336
+ ),
20337
+ tabIndex: -1,
20338
+ children: [
20339
+ title && /* @__PURE__ */ jsxRuntime.jsx(
20340
+ ChartHeader,
20341
+ {
20342
+ title,
20343
+ titlePosition,
20344
+ HORIZONTAL_PADDING_CLASS: "px-6",
20345
+ data,
20346
+ allKeys: data.map((d) => d.name),
20347
+ processedData: data,
20348
+ finalColors,
20349
+ mapperConfig: Object.fromEntries(
20350
+ data.map((d) => [
20351
+ d.name,
20352
+ { label: d.name, color: d.color || "#8884d8" }
20353
+ ])
20354
+ )
20355
+ }
20356
+ ),
20357
+ /* @__PURE__ */ jsxRuntime.jsx(recharts.ResponsiveContainer, { width: "100%", height, children: /* @__PURE__ */ jsxRuntime.jsxs(
20358
+ recharts.PieChart,
20359
+ {
20360
+ width: typeof width === "number" ? width : 400,
20361
+ height,
20362
+ margin: { top: 20, right: 80, bottom: 20, left: 80 },
20363
+ children: [
20364
+ /* @__PURE__ */ jsxRuntime.jsx(
20365
+ recharts.Pie,
20366
+ {
20367
+ activeIndex,
20368
+ activeShape: renderActiveShape,
20369
+ data,
20370
+ dataKey: "value",
20371
+ nameKey: "name",
20372
+ cx: "50%",
20373
+ cy: "50%",
20374
+ innerRadius,
20375
+ outerRadius,
20376
+ fill: "#8884d8",
20377
+ onMouseEnter: (_, index) => setActiveIndex(index),
20378
+ onMouseLeave: () => setActiveIndex(void 0),
20379
+ onClick: (e) => {
20380
+ if (e && e.target && typeof e.target.blur === "function") e.target.blur();
20381
+ },
20382
+ children: data.map((entry, index) => /* @__PURE__ */ jsxRuntime.jsx(recharts.Cell, { fill: entry.color || "#8884d8" }, `cell-${index}`))
20383
+ }
20384
+ ),
20385
+ showLegend && /* @__PURE__ */ jsxRuntime.jsx(recharts.Legend, {}),
20386
+ showTooltip && /* @__PURE__ */ jsxRuntime.jsx(recharts.Tooltip, { content: () => null })
20387
+ ]
20388
+ }
20389
+ ) })
20390
+ ]
20391
+ }
20392
+ );
20393
+ };
20394
+ var PieChart_default = PieChartComponent;
19989
20395
  function NumericInput({
19990
20396
  value,
19991
20397
  onChange,
@@ -20980,12 +21386,23 @@ function CarouselBase({
20980
21386
  setDownloadSuccess(false);
20981
21387
  const currentItem = items[index];
20982
21388
  try {
20983
- const response = await fetch(currentItem.url);
21389
+ const response = await fetch(currentItem.url, { mode: "cors" });
21390
+ if (!response.ok) throw new Error("Erro ao baixar imagem");
20984
21391
  const blob = await response.blob();
20985
21392
  const url = window.URL.createObjectURL(blob);
20986
21393
  const link = document.createElement("a");
20987
21394
  link.href = url;
20988
- link.download = currentItem.title || "image";
21395
+ let ext = "";
21396
+ try {
21397
+ const urlObj = new URL(currentItem.url, window.location.href);
21398
+ const path = urlObj.pathname;
21399
+ ext = path.substring(path.lastIndexOf("."));
21400
+ if (!ext || ext.length > 6) ext = "";
21401
+ } catch {
21402
+ }
21403
+ let filename = currentItem.title || "image";
21404
+ if (ext && !filename.endsWith(ext)) filename += ext;
21405
+ link.download = filename;
20989
21406
  document.body.appendChild(link);
20990
21407
  link.click();
20991
21408
  document.body.removeChild(link);
@@ -20994,6 +21411,9 @@ function CarouselBase({
20994
21411
  setDownloadSuccess(true);
20995
21412
  setTimeout(() => setDownloadSuccess(false), 2e3);
20996
21413
  } catch (error) {
21414
+ alert(
21415
+ "Erro ao baixar imagem. Verifique a URL ou permiss\xF5es do servidor."
21416
+ );
20997
21417
  console.error("Error downloading image:", error);
20998
21418
  setIsDownloading(false);
20999
21419
  }
@@ -21035,8 +21455,13 @@ function CarouselBase({
21035
21455
  {
21036
21456
  src: item.url,
21037
21457
  alt: item.title,
21038
- className: cn("w-full h-full select-none"),
21039
- imageClassName,
21458
+ className: cn(
21459
+ "w-full h-full select-none object-contain"
21460
+ ),
21461
+ imageClassName: cn(
21462
+ "object-contain w-full h-full",
21463
+ imageClassName
21464
+ ),
21040
21465
  borderRadius: 8,
21041
21466
  maxZoom: 3
21042
21467
  }
@@ -21850,6 +22275,22 @@ function GroupLabel({ group }) {
21850
22275
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[11px] font-semibold text-muted-foreground uppercase tracking-widest", children: group.label })
21851
22276
  ] });
21852
22277
  }
22278
+ function HighlightText({ text, query }) {
22279
+ if (!query || !query.trim()) return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: text });
22280
+ const terms = query.split(/[, ]+/).map((t) => t.trim()).filter((t) => t.length > 0);
22281
+ if (terms.length === 0) return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: text });
22282
+ const escapedTerms = terms.map(
22283
+ (t) => t.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")
22284
+ );
22285
+ const regex = new RegExp(`(${escapedTerms.join("|")})`, "gi");
22286
+ const parts = text.split(regex);
22287
+ return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: parts.map((part, i) => {
22288
+ const isMatch = terms.some(
22289
+ (t) => t.toLowerCase() === part.toLowerCase()
22290
+ );
22291
+ return isMatch ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-primary font-semibold", children: part }, i) : /* @__PURE__ */ jsxRuntime.jsx("span", { children: part }, i);
22292
+ }) });
22293
+ }
21853
22294
  function mapBadgeVariantToColor(variant) {
21854
22295
  if (!variant) return void 0;
21855
22296
  switch (variant) {
@@ -21876,44 +22317,61 @@ function mapBadgeVariantToColor(variant) {
21876
22317
  function CommandItemRow({
21877
22318
  item,
21878
22319
  isActive,
22320
+ isSelected,
22321
+ multiSelect,
21879
22322
  onSelect,
21880
- onHover
22323
+ onToggleSelection,
22324
+ onHover,
22325
+ searchQuery
21881
22326
  }) {
21882
22327
  return /* @__PURE__ */ jsxRuntime.jsxs(
21883
22328
  framerMotion.motion.button,
21884
22329
  {
21885
22330
  layout: true,
21886
- onClick: onSelect,
22331
+ onClick: (e) => {
22332
+ if (multiSelect && onToggleSelection && (e.ctrlKey || e.metaKey || e.shiftKey)) {
22333
+ onToggleSelection(e);
22334
+ } else {
22335
+ onSelect(e);
22336
+ }
22337
+ },
21887
22338
  onMouseEnter: onHover,
21888
22339
  className: `
21889
- w-full flex items-center gap-1 px-2 py-1 rounded-md text-left cursor-pointer
22340
+ w-full flex items-center gap-1 px-2 py-1 rounded-md text-left cursor-pointer
21890
22341
  transition-colors duration-75 group relative
21891
- ${isActive ? "text-accent-foreground hover:bg-accent" : "hover:bg-accent hover:text-accent-foreground"}
22342
+ ${isActive ? "text-accent-foreground bg-accent" : "hover:bg-accent hover:text-accent-foreground"}
21892
22343
  `,
21893
22344
  children: [
21894
22345
  item.icon && /* @__PURE__ */ jsxRuntime.jsx(
21895
22346
  "span",
21896
22347
  {
21897
22348
  className: `relative flex-shrink-0 w-8 h-8 flex items-center justify-center rounded-md text-base
21898
- ${isActive ? "bg-primary/20 text-primary" : "bg-muted text-muted-foreground group-hover:text-foreground"}`,
22349
+ ${isSelected ? "bg-primary text-primary-foreground" : isActive ? "bg-primary/20 text-primary" : "bg-muted text-muted-foreground group-hover:text-foreground"}`,
21899
22350
  children: item.icon
21900
22351
  }
21901
22352
  ),
21902
22353
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative flex-1 min-w-0 px-1", children: [
21903
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-3 flex-wrap", children: [
22354
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-3 flex-wrap", children: [
21904
22355
  /* @__PURE__ */ jsxRuntime.jsx(
21905
22356
  "span",
21906
22357
  {
21907
22358
  className: `text-sm font-medium truncate ${isActive ? "text-foreground" : "text-foreground/80"}`,
21908
- children: item.label
22359
+ children: /* @__PURE__ */ jsxRuntime.jsx(HighlightText, { text: item.label, query: searchQuery })
21909
22360
  }
21910
22361
  ),
21911
22362
  item.badge && /* @__PURE__ */ jsxRuntime.jsx(Badge, { color: mapBadgeVariantToColor(item.badgeVariant), children: item.badge.toUpperCase() })
21912
22363
  ] }),
21913
- item.description && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted-foreground truncate", children: item.description })
22364
+ item.description && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted-foreground truncate", children: /* @__PURE__ */ jsxRuntime.jsx(HighlightText, { text: item.description, query: searchQuery }) })
21914
22365
  ] }),
21915
22366
  item.shortcut && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "relative hidden sm:flex items-center gap-1 flex-shrink-0", children: item.shortcut.map((k, i) => /* @__PURE__ */ jsxRuntime.jsx(Kbd, { children: k }, i)) }),
21916
- isActive && /* @__PURE__ */ jsxRuntime.jsx(
22367
+ isSelected && /* @__PURE__ */ jsxRuntime.jsx(
22368
+ framerMotion.motion.div,
22369
+ {
22370
+ layoutId: `selected-indicator-${item.id}`,
22371
+ className: "absolute left-0 top-1/2 -translate-y-1/2 w-1 h-2/3 bg-primary rounded-r-md"
22372
+ }
22373
+ ),
22374
+ isActive && !isSelected && /* @__PURE__ */ jsxRuntime.jsx(
21917
22375
  react.CaretRightIcon,
21918
22376
  {
21919
22377
  className: "relative w-4 h-4 text-primary flex-shrink-0",
@@ -21933,22 +22391,40 @@ function useCommandPalette({
21933
22391
  recentItems = [],
21934
22392
  onRecentItemsChange,
21935
22393
  maxRecentItems = 5,
21936
- multiSearch = false
22394
+ multiSearch = false,
22395
+ multiSelect = false,
22396
+ onSelectMultiple
21937
22397
  }) {
21938
22398
  const [query, setQuery] = React32__namespace.useState("");
21939
22399
  const [activeIndex, setActiveIndex] = React32__namespace.useState(0);
21940
22400
  const [page, setPage] = React32__namespace.useState(0);
22401
+ const [selectedItemIds, setSelectedItemIds] = React32__namespace.useState(
22402
+ /* @__PURE__ */ new Set()
22403
+ );
22404
+ const toggleSelection = React32__namespace.useCallback((id) => {
22405
+ setSelectedItemIds((prev) => {
22406
+ const next = new Set(prev);
22407
+ if (next.has(id)) next.delete(id);
22408
+ else next.add(id);
22409
+ return next;
22410
+ });
22411
+ }, []);
22412
+ const clearSelection = React32__namespace.useCallback(
22413
+ () => setSelectedItemIds(/* @__PURE__ */ new Set()),
22414
+ []
22415
+ );
21941
22416
  const baseGroups = React32__namespace.useMemo(
21942
22417
  () => normaliseGroups(items, groups),
21943
22418
  [items, groups]
21944
22419
  );
21945
- React32__namespace.useEffect(() => {
22420
+ React32.useEffect(() => {
21946
22421
  if (open) {
21947
22422
  setQuery("");
21948
22423
  setActiveIndex(0);
21949
22424
  setPage(0);
22425
+ clearSelection();
21950
22426
  }
21951
- }, [open]);
22427
+ }, [open, clearSelection]);
21952
22428
  const searchTerms = React32__namespace.useMemo(() => {
21953
22429
  const parts = query.split(",");
21954
22430
  if (parts.length <= 1 && !multiSearch) return [];
@@ -22011,12 +22487,35 @@ function useCommandPalette({
22011
22487
  () => displayedGroups.flatMap((g) => g.items),
22012
22488
  [displayedGroups]
22013
22489
  );
22490
+ const selectedItems = React32.useMemo(
22491
+ () => allFlatItems.filter((i) => selectedItemIds.has(i.id)),
22492
+ [allFlatItems, selectedItemIds]
22493
+ );
22014
22494
  const pageItemCount = flatItems.length;
22015
22495
  React32.useEffect(() => {
22016
22496
  setActiveIndex((i) => Math.min(i, Math.max(pageItemCount - 1, 0)));
22017
22497
  }, [pageItemCount]);
22018
- function handleSelect(item) {
22498
+ function executeBulkAction() {
22499
+ if (!onSelectMultiple || selectedItems.length === 0) return;
22500
+ onSelectMultiple(selectedItems);
22501
+ onOpenChange?.(false);
22502
+ }
22503
+ function handleSelect(item, event) {
22019
22504
  if (!item) return;
22505
+ if (multiSelect) {
22506
+ if (event && ("ctrlKey" in event || "metaKey" in event || "shiftKey" in event) && (event.ctrlKey || event.metaKey || event.shiftKey)) {
22507
+ toggleSelection(item.id);
22508
+ return;
22509
+ }
22510
+ if (selectedItems.length > 0) {
22511
+ const itemsToSubmit = selectedItemIds.has(item.id) ? selectedItems : [...selectedItems, item];
22512
+ if (onSelectMultiple) {
22513
+ onSelectMultiple(itemsToSubmit);
22514
+ }
22515
+ onOpenChange?.(false);
22516
+ return;
22517
+ }
22518
+ }
22020
22519
  item.onSelect();
22021
22520
  onOpenChange?.(false);
22022
22521
  if (onRecentItemsChange) {
@@ -22049,12 +22548,26 @@ function useCommandPalette({
22049
22548
  }
22050
22549
  } else if (e.key === "Enter") {
22051
22550
  e.preventDefault();
22052
- handleSelect(flatItems[activeIndex]);
22551
+ if (multiSelect && (e.ctrlKey || e.metaKey)) {
22552
+ executeBulkAction();
22553
+ return;
22554
+ }
22555
+ handleSelect(flatItems[activeIndex], e);
22053
22556
  }
22054
22557
  };
22055
22558
  document.addEventListener("keydown", handler);
22056
22559
  return () => document.removeEventListener("keydown", handler);
22057
- }, [open, flatItems, activeIndex, pageItemCount, page, totalPages]);
22560
+ }, [
22561
+ open,
22562
+ flatItems,
22563
+ activeIndex,
22564
+ pageItemCount,
22565
+ page,
22566
+ totalPages,
22567
+ executeBulkAction,
22568
+ handleSelect,
22569
+ multiSelect
22570
+ ]);
22058
22571
  return {
22059
22572
  query,
22060
22573
  setQuery,
@@ -22070,6 +22583,10 @@ function useCommandPalette({
22070
22583
  totalItems,
22071
22584
  totalPages,
22072
22585
  handleSelect,
22586
+ selectedItemIds,
22587
+ toggleSelection,
22588
+ selectedItems,
22589
+ executeBulkAction,
22073
22590
  isEmpty: totalItems === 0 && query.trim().length > 0,
22074
22591
  showList: query.trim() !== "" || recentItems.length > 0
22075
22592
  };
@@ -22129,8 +22646,12 @@ var VirtualResultList = React32.memo(
22129
22646
  displayedGroups,
22130
22647
  flatItems,
22131
22648
  activeIndex,
22649
+ multiSelect,
22650
+ selectedItemIds,
22132
22651
  onHover,
22133
- onSelect
22652
+ onSelect,
22653
+ onToggleSelection,
22654
+ searchQuery
22134
22655
  }) => {
22135
22656
  const rows = React32.useMemo(() => {
22136
22657
  const acc = [];
@@ -22168,7 +22689,7 @@ var VirtualResultList = React32.memo(
22168
22689
  ref: listRef,
22169
22690
  className: "overflow-y-auto overscroll-contain px-2 py-1 [&::-webkit-scrollbar]:w-1.5 [&::-webkit-scrollbar-track]:bg-transparent [&::-webkit-scrollbar-thumb]:bg-muted-foreground/30 [&::-webkit-scrollbar-thumb]:rounded-full hover:[&::-webkit-scrollbar-thumb]:bg-muted-foreground/50 transition-colors",
22170
22691
  style: { maxHeight: `min(${LIST_MAX_HEIGHT}px, 60vh)` },
22171
- children: /* @__PURE__ */ jsxRuntime.jsx("div", { style: { height: totalSize, position: "relative" }, children: virtualItems.map((vItem) => {
22692
+ children: /* @__PURE__ */ jsxRuntime.jsx("div", { style: { height: totalSize, position: "relative", width: "100%" }, children: virtualItems.map((vItem) => {
22172
22693
  const row = rows[vItem.index];
22173
22694
  return /* @__PURE__ */ jsxRuntime.jsx(
22174
22695
  "div",
@@ -22177,17 +22698,22 @@ var VirtualResultList = React32.memo(
22177
22698
  ref: virtualizer.measureElement,
22178
22699
  style: {
22179
22700
  position: "absolute",
22180
- top: vItem.start,
22701
+ top: 0,
22181
22702
  left: 0,
22182
- right: 0
22703
+ width: "100%",
22704
+ transform: `translateY(${vItem.start}px)`
22183
22705
  },
22184
22706
  children: row.kind === "label" ? /* @__PURE__ */ jsxRuntime.jsx(GroupLabel, { group: row.group }) : /* @__PURE__ */ jsxRuntime.jsx("div", { "data-active": row.globalIdx === activeIndex, children: /* @__PURE__ */ jsxRuntime.jsx(
22185
22707
  CommandItemRow,
22186
22708
  {
22187
22709
  item: row.item,
22188
22710
  isActive: row.globalIdx === activeIndex,
22711
+ isSelected: selectedItemIds.has(row.item.id),
22712
+ multiSelect,
22189
22713
  onHover: () => onHover(row.globalIdx),
22190
- onSelect: () => onSelect(row.item)
22714
+ onSelect: (e) => onSelect(row.item, e),
22715
+ onToggleSelection: (e) => onToggleSelection(row.item.id, e),
22716
+ searchQuery
22191
22717
  }
22192
22718
  ) })
22193
22719
  },
@@ -22199,30 +22725,55 @@ var VirtualResultList = React32.memo(
22199
22725
  }
22200
22726
  );
22201
22727
  VirtualResultList.displayName = "VirtualResultList";
22202
- var FooterBar = React32.memo(({ footer, totalItems }) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between px-4 py-2 border-t border-border bg-muted/30", children: [
22203
- footer ?? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-4 text-[11px] text-muted-foreground", children: [
22204
- /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "flex items-center gap-1.5", children: [
22205
- /* @__PURE__ */ jsxRuntime.jsx(react.ArrowElbowDownRightIcon, { className: "w-3 h-3" }),
22206
- "Selecionar"
22207
- ] }),
22208
- /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "flex items-center gap-1.5", children: [
22209
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-mono", children: "\u2191\u2193" }),
22210
- "Navegar"
22211
- ] }),
22212
- /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "flex items-center gap-1.5", children: [
22213
- /* @__PURE__ */ jsxRuntime.jsx(react.ArrowBendUpLeftIcon, { className: "w-3 h-3" }),
22214
- "Fechar"
22215
- ] })
22216
- ] }),
22217
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-1.5 text-[11px] text-muted-foreground", children: [
22218
- /* @__PURE__ */ jsxRuntime.jsx(react.CommandIcon, { className: "w-3 h-3" }),
22219
- /* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
22220
- totalItems,
22221
- " resultado",
22222
- totalItems !== 1 ? "s" : ""
22728
+ var FooterBar = React32.memo(
22729
+ ({
22730
+ footer,
22731
+ totalItems,
22732
+ selectedCount = 0,
22733
+ executeBulkAction
22734
+ }) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between px-4 py-2 border-t border-border bg-muted/30", children: [
22735
+ footer ?? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-4 text-[11px] text-muted-foreground", children: selectedCount > 0 ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
22736
+ /* @__PURE__ */ jsxRuntime.jsxs(
22737
+ "button",
22738
+ {
22739
+ onClick: executeBulkAction,
22740
+ className: "flex items-center gap-1.5 text-primary hover:text-primary/80 transition-colors font-medium cursor-pointer",
22741
+ children: [
22742
+ /* @__PURE__ */ jsxRuntime.jsx(react.CommandIcon, { className: "w-3 h-3" }),
22743
+ " Confirmar (",
22744
+ selectedCount,
22745
+ ")"
22746
+ ]
22747
+ }
22748
+ ),
22749
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "flex items-center gap-1.5", children: [
22750
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-mono text-[10px] px-1 bg-muted rounded border", children: "Ctrl+Enter" }),
22751
+ "Finalizar sele\xE7\xE3o"
22752
+ ] })
22753
+ ] }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
22754
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "flex items-center gap-1.5", children: [
22755
+ /* @__PURE__ */ jsxRuntime.jsx(react.ArrowElbowDownRightIcon, { className: "w-3 h-3" }),
22756
+ "Selecionar"
22757
+ ] }),
22758
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "flex items-center gap-1.5", children: [
22759
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-mono", children: "\u2191\u2193" }),
22760
+ "Navegar"
22761
+ ] }),
22762
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "flex items-center gap-1.5", children: [
22763
+ /* @__PURE__ */ jsxRuntime.jsx(react.ArrowBendUpLeftIcon, { className: "w-3 h-3" }),
22764
+ "Fechar"
22765
+ ] })
22766
+ ] }) }),
22767
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-1.5 text-[11px] text-muted-foreground", children: [
22768
+ /* @__PURE__ */ jsxRuntime.jsx(react.CommandIcon, { className: "w-3 h-3" }),
22769
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
22770
+ totalItems,
22771
+ " resultado",
22772
+ totalItems !== 1 ? "s" : ""
22773
+ ] })
22223
22774
  ] })
22224
22775
  ] })
22225
- ] }));
22776
+ );
22226
22777
  FooterBar.displayName = "FooterBar";
22227
22778
  function CommandPalette(props) {
22228
22779
  const {
@@ -22232,6 +22783,7 @@ function CommandPalette(props) {
22232
22783
  footer,
22233
22784
  debounceDelay = 300,
22234
22785
  multiSearch = false,
22786
+ multiSelect = false,
22235
22787
  emptyMessage = "Nenhum resultado encontrado.",
22236
22788
  shortcut = { key: "k", ctrl: true }
22237
22789
  } = props;
@@ -22248,13 +22800,16 @@ function CommandPalette(props) {
22248
22800
  flatItems,
22249
22801
  totalItems,
22250
22802
  handleSelect,
22803
+ selectedItemIds,
22804
+ toggleSelection,
22805
+ executeBulkAction,
22251
22806
  isEmpty,
22252
22807
  showList
22253
22808
  } = useCommandPalette({
22254
22809
  ...props,
22255
- open: isMobile ? true : props.open
22810
+ open: props.open
22256
22811
  });
22257
- useKeyboardShortcut(shortcut.key, () => onOpenChange(!open), {
22812
+ useKeyboardShortcut(shortcut.key, () => onOpenChange?.(!open), {
22258
22813
  ctrl: shortcut.ctrl,
22259
22814
  meta: shortcut.meta,
22260
22815
  shift: shortcut.shift,
@@ -22263,7 +22818,7 @@ function CommandPalette(props) {
22263
22818
  React32.useEffect(() => {
22264
22819
  if (!open) return;
22265
22820
  const handleEscape = (e) => {
22266
- if (e.key === "Escape") onOpenChange(false);
22821
+ if (e.key === "Escape") onOpenChange?.(false);
22267
22822
  };
22268
22823
  document.addEventListener("keydown", handleEscape);
22269
22824
  return () => document.removeEventListener("keydown", handleEscape);
@@ -22290,11 +22845,11 @@ function CommandPalette(props) {
22290
22845
  (val) => {
22291
22846
  setQuery(val);
22292
22847
  setActiveIndex(0);
22293
- if (!open && val.trim() !== "") onOpenChange(true);
22848
+ if (!open && val.trim() !== "") onOpenChange?.(true);
22294
22849
  },
22295
22850
  [setQuery, setActiveIndex, open, onOpenChange]
22296
22851
  );
22297
- const handleClose = React32.useCallback(() => onOpenChange(false), [onOpenChange]);
22852
+ const handleClose = React32.useCallback(() => onOpenChange?.(false), [onOpenChange]);
22298
22853
  const handleClearQuery = React32.useCallback(() => setQuery(""), [setQuery]);
22299
22854
  const searchPlaceholder = multiSearch ? "Buscar\u2026 (separe termos por v\xEDrgula)" : placeholder;
22300
22855
  const sharedListProps = {
@@ -22304,49 +22859,65 @@ function CommandPalette(props) {
22304
22859
  displayedGroups,
22305
22860
  flatItems,
22306
22861
  activeIndex,
22862
+ multiSelect,
22863
+ selectedItemIds,
22307
22864
  onHover: setActiveIndex,
22308
- onSelect: handleSelect
22865
+ onSelect: handleSelect,
22866
+ onToggleSelection: toggleSelection,
22867
+ searchQuery: query
22309
22868
  };
22310
22869
  if (isMobile) {
22311
- return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
22312
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "fixed top-0 left-0 right-0 z-[100] px-3 py-2 bg-background", children: /* @__PURE__ */ jsxRuntime.jsx(
22313
- DebouncedInput,
22870
+ return /* @__PURE__ */ jsxRuntime.jsx(framerMotion.AnimatePresence, { children: open && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
22871
+ /* @__PURE__ */ jsxRuntime.jsxs(
22872
+ framerMotion.motion.div,
22314
22873
  {
22315
- ref: inputRef,
22316
- value: query,
22317
- debounce: debounceDelay,
22318
- onChange: handleQueryChangeMobile,
22319
- placeholder: searchPlaceholder
22874
+ initial: { opacity: 0, y: -20 },
22875
+ animate: { opacity: 1, y: 0 },
22876
+ exit: { opacity: 0, y: -20 },
22877
+ className: "fixed top-0 left-0 right-0 z-[100] px-4 py-3 bg-background border-b border-border shadow-sm flex items-center gap-3",
22878
+ children: [
22879
+ /* @__PURE__ */ jsxRuntime.jsx(react.MagnifyingGlassIcon, { className: "w-5 h-5 text-muted-foreground" }),
22880
+ /* @__PURE__ */ jsxRuntime.jsx(
22881
+ DebouncedInput,
22882
+ {
22883
+ ref: inputRef,
22884
+ value: query,
22885
+ debounce: debounceDelay,
22886
+ onChange: handleQueryChangeMobile,
22887
+ placeholder: searchPlaceholder,
22888
+ className: "flex-1 bg-transparent border-none shadow-none focus-visible:ring-0 p-0 text-base"
22889
+ }
22890
+ ),
22891
+ query && /* @__PURE__ */ jsxRuntime.jsx(ButtonBase, { variant: "ghost", size: "icon", onClick: handleClearQuery, className: "h-8 w-8", children: /* @__PURE__ */ jsxRuntime.jsx(react.XIcon, { className: "w-4 h-4" }) })
22892
+ ]
22320
22893
  }
22321
- ) }),
22322
- /* @__PURE__ */ jsxRuntime.jsx(framerMotion.AnimatePresence, { children: showList && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
22323
- /* @__PURE__ */ jsxRuntime.jsx(
22324
- framerMotion.motion.div,
22325
- {
22326
- initial: { opacity: 0 },
22327
- animate: { opacity: 1 },
22328
- exit: { opacity: 0 },
22329
- transition: ANIMATION.overlay,
22330
- className: "fixed inset-0 z-[98] bg-background/60 backdrop-blur-[2px]",
22331
- onClick: handleClose
22332
- }
22333
- ),
22334
- /* @__PURE__ */ jsxRuntime.jsxs(
22335
- framerMotion.motion.div,
22336
- {
22337
- initial: { opacity: 0, y: -6 },
22338
- animate: { opacity: 1, y: 0 },
22339
- exit: { opacity: 0, y: -6 },
22340
- transition: ANIMATION.mobilePanel,
22341
- className: "fixed left-3 right-3 z-[99] bg-popover border border-border rounded-lg shadow-2xl shadow-black/20 dark:shadow-black/50 overflow-hidden top-14",
22342
- children: [
22343
- /* @__PURE__ */ jsxRuntime.jsx(SearchBadges, { terms: searchTerms }),
22344
- /* @__PURE__ */ jsxRuntime.jsx(VirtualResultList, { ...sharedListProps })
22345
- ]
22346
- }
22347
- )
22348
- ] }) })
22349
- ] });
22894
+ ),
22895
+ /* @__PURE__ */ jsxRuntime.jsx(
22896
+ framerMotion.motion.div,
22897
+ {
22898
+ initial: { opacity: 0 },
22899
+ animate: { opacity: 1 },
22900
+ exit: { opacity: 0 },
22901
+ transition: ANIMATION.overlay,
22902
+ className: "fixed inset-0 z-[98] bg-background/80 backdrop-blur-md",
22903
+ onClick: handleClose
22904
+ }
22905
+ ),
22906
+ showList && /* @__PURE__ */ jsxRuntime.jsxs(
22907
+ framerMotion.motion.div,
22908
+ {
22909
+ initial: { opacity: 0, y: 10 },
22910
+ animate: { opacity: 1, y: 0 },
22911
+ exit: { opacity: 0, y: 10 },
22912
+ transition: ANIMATION.mobilePanel,
22913
+ className: "fixed inset-x-0 bottom-0 top-[60px] z-[99] bg-background overflow-hidden flex flex-col",
22914
+ children: [
22915
+ /* @__PURE__ */ jsxRuntime.jsx(SearchBadges, { terms: searchTerms }),
22916
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1 overflow-hidden", children: /* @__PURE__ */ jsxRuntime.jsx(VirtualResultList, { ...sharedListProps }) })
22917
+ ]
22918
+ }
22919
+ )
22920
+ ] }) });
22350
22921
  }
22351
22922
  return /* @__PURE__ */ jsxRuntime.jsx(framerMotion.AnimatePresence, { children: open && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
22352
22923
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -22355,8 +22926,7 @@ function CommandPalette(props) {
22355
22926
  initial: { opacity: 0 },
22356
22927
  animate: { opacity: 1 },
22357
22928
  exit: { opacity: 0 },
22358
- transition: ANIMATION.overlay,
22359
- className: "fixed inset-0 z-[100] bg-background/80 backdrop-blur-sm",
22929
+ className: "fixed inset-0 z-[99] bg-black/40 backdrop-blur-sm",
22360
22930
  onClick: handleClose
22361
22931
  }
22362
22932
  ),
@@ -22367,17 +22937,11 @@ function CommandPalette(props) {
22367
22937
  animate: { opacity: 1, scale: 1, y: 0 },
22368
22938
  exit: { opacity: 0, scale: 0.96, y: -8 },
22369
22939
  transition: ANIMATION.panel,
22370
- className: "fixed z-[100] top-12 -translate-x-1/2 -translate-y-1/2 w-full max-w-xl rounded-xl border border-border overflow-hidden shadow-2xl shadow-black/20 dark:shadow-black/60 bg-popover/95 backdrop-blur-xl",
22940
+ className: "fixed z-[100] top-4 -translate-x-1/2 w-full max-w-xl rounded-xl border border-border overflow-hidden shadow-2xl shadow-black/20 dark:shadow-black/60 bg-popover/95 backdrop-blur-xl",
22371
22941
  style: { maxHeight: "min(600px, 80vh)" },
22372
22942
  children: [
22373
22943
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-3 px-4 py-2 border-b border-border", children: [
22374
- /* @__PURE__ */ jsxRuntime.jsx(
22375
- react.MagnifyingGlassIcon,
22376
- {
22377
- className: "w-4 h-4 text-muted-foreground flex-shrink-0",
22378
- weight: "bold"
22379
- }
22380
- ),
22944
+ /* @__PURE__ */ jsxRuntime.jsx(react.MagnifyingGlassIcon, { className: "w-4 h-4 text-muted-foreground flex-shrink-0", weight: "bold" }),
22381
22945
  /* @__PURE__ */ jsxRuntime.jsx(
22382
22946
  DebouncedInput,
22383
22947
  {
@@ -22402,7 +22966,15 @@ function CommandPalette(props) {
22402
22966
  ] }),
22403
22967
  /* @__PURE__ */ jsxRuntime.jsx(SearchBadges, { terms: searchTerms }),
22404
22968
  showList && /* @__PURE__ */ jsxRuntime.jsx(VirtualResultList, { ...sharedListProps }),
22405
- /* @__PURE__ */ jsxRuntime.jsx(FooterBar, { footer, totalItems })
22969
+ /* @__PURE__ */ jsxRuntime.jsx(
22970
+ FooterBar,
22971
+ {
22972
+ footer,
22973
+ totalItems,
22974
+ selectedCount: selectedItemIds.size,
22975
+ executeBulkAction
22976
+ }
22977
+ )
22406
22978
  ]
22407
22979
  }
22408
22980
  )
@@ -22623,6 +23195,7 @@ exports.NoData = NoData_default;
22623
23195
  exports.NotificationButton = NotificationButton;
22624
23196
  exports.NumericInput = NumericInput;
22625
23197
  exports.PeriodsDropdown = PeriodsDropdown_default;
23198
+ exports.PieChartComponent = PieChart_default;
22626
23199
  exports.PopoverAnchorBase = PopoverAnchorBase;
22627
23200
  exports.PopoverBase = PopoverBase;
22628
23201
  exports.PopoverContentBase = PopoverContentBase;