@mlw-packages/react-components 1.10.19 → 1.10.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -1,11 +1,11 @@
1
1
  import './index.css';
2
2
  import * as React32 from 'react';
3
- import React32__default, { forwardRef, useState, useEffect, createContext, useRef, useCallback, memo, useMemo, useId, useContext, useLayoutEffect } from 'react';
3
+ import React32__default, { forwardRef, useState, useEffect, createContext, memo, useMemo, useRef, useCallback, useId, useContext, useLayoutEffect } from 'react';
4
4
  import { Slot } from '@radix-ui/react-slot';
5
5
  import { cva } from 'class-variance-authority';
6
6
  import { clsx } from 'clsx';
7
7
  import { twMerge } from 'tailwind-merge';
8
- import { XIcon, CircleNotchIcon, MagnifyingGlassIcon, CaretUpIcon, CaretDownIcon, CheckIcon, CaretRightIcon, CircleIcon, CloudArrowUpIcon, MinusIcon, CaretUpDownIcon, PencilSimpleIcon, ArrowsLeftRightIcon, FloppyDiskIcon, PlusIcon, TrashIcon, SidebarSimpleIcon, ArrowElbowDownRightIcon, ArrowBendUpLeftIcon, CommandIcon, FilePdfIcon, FileDocIcon, FileXlsIcon, FilePptIcon, FileCsvIcon, FileTextIcon, FileImageIcon, FileVideoIcon, FileAudioIcon, FileZipIcon, FileIcon, DotsSixVerticalIcon, CopyIcon, InfoIcon, WarningIcon, XCircleIcon, CheckCircleIcon, SunIcon, MoonIcon, CaretLeftIcon, DownloadSimpleIcon, UploadSimpleIcon, ArrowClockwiseIcon, ArrowLeftIcon, GearIcon, BellIcon, DotsThreeIcon, FunnelIcon, HeartIcon, StarIcon, EyeIcon, EyeSlashIcon, LockIcon, LockOpenIcon, FolderIcon, ArrowRightIcon as ArrowRightIcon$1, ArrowsOutIcon, DownloadIcon, CalendarBlankIcon, CalendarIcon, MapPinIcon, CalendarDotsIcon, ClockIcon, AlignLeftIcon, CaretLeft, CaretRight, ArrowDownIcon, ClockUserIcon, EyeSlash, Eye, ArrowUpRightIcon, ArrowDownRightIcon, FunnelSimpleIcon, PencilIcon, ClockCounterClockwiseIcon, FileArchiveIcon, TerminalIcon, CodeIcon, CalendarDotIcon as CalendarDotIcon$1, DesktopIcon } from '@phosphor-icons/react';
8
+ import { XIcon, CircleNotchIcon, MagnifyingGlassIcon, CaretUpIcon, CaretDownIcon, CheckIcon, CaretRightIcon, CircleIcon, CloudArrowUpIcon, MinusIcon, CaretUpDownIcon, PencilSimpleIcon, ArrowsLeftRightIcon, FloppyDiskIcon, PlusIcon, TrashIcon, SidebarSimpleIcon, CommandIcon, ArrowElbowDownRightIcon, ArrowBendUpLeftIcon, FilePdfIcon, FileDocIcon, FileXlsIcon, FilePptIcon, FileCsvIcon, FileTextIcon, FileImageIcon, FileVideoIcon, FileAudioIcon, FileZipIcon, FileIcon, DotsSixVerticalIcon, CopyIcon, InfoIcon, WarningIcon, XCircleIcon, CheckCircleIcon, CaretLeftIcon, DownloadSimpleIcon, UploadSimpleIcon, ArrowClockwiseIcon, ArrowLeftIcon, GearIcon, BellIcon, DotsThreeIcon, FunnelIcon, HeartIcon, StarIcon, EyeIcon, EyeSlashIcon, LockIcon, LockOpenIcon, FolderIcon, ArrowRightIcon as ArrowRightIcon$1, ArrowsOutIcon, DownloadIcon, CalendarBlankIcon, CalendarIcon, MapPinIcon, CalendarDotsIcon, SunIcon, ClockIcon, AlignLeftIcon, CaretLeft, CaretRight, ArrowDownIcon, ClockUserIcon, EyeSlash, Eye, ArrowUpRightIcon, ArrowDownRightIcon, FunnelSimpleIcon, PencilIcon, ClockCounterClockwiseIcon, FileArchiveIcon, TerminalIcon, CodeIcon, CalendarDotIcon as CalendarDotIcon$1, MoonIcon, DesktopIcon } from '@phosphor-icons/react';
9
9
  import * as AlertDialogPrimitive from '@radix-ui/react-alert-dialog';
10
10
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
11
11
  import * as DialogPrimitive from '@radix-ui/react-dialog';
@@ -3443,58 +3443,100 @@ var ThemeIcon = ({ theme }) => {
3443
3443
  }
3444
3444
  ) });
3445
3445
  };
3446
+ function resolveOrigin(origin, buttonRef, cursorPos) {
3447
+ if (origin === "cursor" && cursorPos) {
3448
+ return cursorPos;
3449
+ }
3450
+ if (!buttonRef.current) {
3451
+ return { x: window.innerWidth / 2, y: window.innerHeight / 2 };
3452
+ }
3453
+ const rect = buttonRef.current.getBoundingClientRect();
3454
+ switch (origin) {
3455
+ case "top-left":
3456
+ return { x: rect.left, y: rect.top };
3457
+ case "top-right":
3458
+ return { x: rect.right, y: rect.top };
3459
+ case "center":
3460
+ default:
3461
+ return { x: rect.left + rect.width / 2, y: rect.top + rect.height / 2 };
3462
+ }
3463
+ }
3446
3464
  function ModeToggleBase({
3447
3465
  themes = ["light", "dark", "system"],
3448
3466
  className,
3449
3467
  directToggle = false,
3450
- variant = "ghost"
3468
+ variant = "ghost",
3469
+ showLabel = false,
3470
+ tooltip = false,
3471
+ animationOrigin = "center",
3472
+ transitionDuration = 400,
3473
+ storageKey,
3474
+ defaultTheme,
3475
+ onThemeChange
3451
3476
  }) {
3452
3477
  const [mounted, setMounted] = useState(false);
3478
+ const [isTransitioning, setIsTransitioning] = useState(false);
3479
+ const cursorPos = useRef(null);
3453
3480
  const { setTheme, theme: currentTheme } = useTheme();
3454
3481
  const buttonRef = useRef(null);
3455
3482
  useEffect(() => {
3483
+ if (storageKey && defaultTheme) {
3484
+ const stored = localStorage.getItem(storageKey);
3485
+ if (!stored) setTheme(defaultTheme);
3486
+ } else if (defaultTheme && !localStorage.getItem("theme")) {
3487
+ setTheme(defaultTheme);
3488
+ }
3456
3489
  setMounted(true);
3457
- }, []);
3490
+ }, [defaultTheme, setTheme, storageKey]);
3458
3491
  const isDark = mounted && (currentTheme?.includes("dark") || currentTheme === "system" && typeof window !== "undefined" && window.matchMedia("(prefers-color-scheme: dark)").matches);
3492
+ const activeTheme = mounted ? currentTheme : defaultTheme;
3493
+ const tooltipText = tooltip === true ? themeLabels[activeTheme] ?? "Toggle theme" : typeof tooltip === "string" ? tooltip : null;
3459
3494
  const toggleTheme = async (newTheme) => {
3495
+ if (isTransitioning) return;
3460
3496
  if (!buttonRef.current) {
3461
3497
  setTheme(newTheme);
3498
+ onThemeChange?.(newTheme);
3462
3499
  return;
3463
3500
  }
3464
3501
  const supportsViewTransition = typeof document !== "undefined" && "startViewTransition" in document && typeof document.startViewTransition === "function";
3465
3502
  if (!supportsViewTransition) {
3466
3503
  setTheme(newTheme);
3504
+ onThemeChange?.(newTheme);
3467
3505
  return;
3468
3506
  }
3469
3507
  try {
3470
- const rect = buttonRef.current.getBoundingClientRect();
3471
- const x = rect.left + rect.width / 2;
3472
- const y = rect.top + rect.height / 2;
3508
+ setIsTransitioning(true);
3509
+ const { x, y } = resolveOrigin(
3510
+ animationOrigin,
3511
+ buttonRef,
3512
+ cursorPos.current
3513
+ );
3473
3514
  const endRadius = Math.hypot(
3474
3515
  Math.max(x, window.innerWidth - x),
3475
3516
  Math.max(y, window.innerHeight - y)
3476
3517
  );
3477
3518
  const transition = document.startViewTransition(async () => {
3478
3519
  setTheme(newTheme);
3520
+ onThemeChange?.(newTheme);
3479
3521
  });
3480
3522
  await transition.ready;
3481
- document.documentElement.animate(
3523
+ const animation = document.documentElement.animate(
3482
3524
  [
3483
- {
3484
- clipPath: `circle(0px at ${x}px ${y}px)`
3485
- },
3486
- {
3487
- clipPath: `circle(${Math.ceil(endRadius)}px at ${x}px ${y}px)`
3488
- }
3525
+ { clipPath: `circle(0px at ${x}px ${y}px)` },
3526
+ { clipPath: `circle(${Math.ceil(endRadius)}px at ${x}px ${y}px)` }
3489
3527
  ],
3490
3528
  {
3491
- duration: 400,
3529
+ duration: transitionDuration,
3492
3530
  easing: "cubic-bezier(0.4, 0, 0.2, 1)",
3493
3531
  pseudoElement: "::view-transition-new(root)"
3494
3532
  }
3495
3533
  );
3534
+ animation.onfinish = () => setIsTransitioning(false);
3535
+ animation.oncancel = () => setIsTransitioning(false);
3496
3536
  } catch {
3497
3537
  setTheme(newTheme);
3538
+ onThemeChange?.(newTheme);
3539
+ setIsTransitioning(false);
3498
3540
  }
3499
3541
  };
3500
3542
  const handleDirectToggle = () => {
@@ -3502,67 +3544,72 @@ function ModeToggleBase({
3502
3544
  const nextIndex = (currentIndex + 1) % themes.length;
3503
3545
  toggleTheme(themes[nextIndex]);
3504
3546
  };
3505
- if (directToggle) {
3506
- return /* @__PURE__ */ jsxs(
3507
- ButtonBase,
3547
+ const handleMouseMove = (e) => {
3548
+ cursorPos.current = { x: e.clientX, y: e.clientY };
3549
+ };
3550
+ const buttonContent = /* @__PURE__ */ jsxs(Fragment, { children: [
3551
+ /* @__PURE__ */ jsx(
3552
+ SunIcon,
3508
3553
  {
3509
- ref: buttonRef,
3510
- variant,
3511
- size: "icon",
3512
- className: cn("relative overflow-hidden group", className),
3513
- onClick: handleDirectToggle,
3514
- children: [
3515
- /* @__PURE__ */ jsxs(Fragment, { children: [
3516
- /* @__PURE__ */ jsx(
3517
- SunIcon,
3518
- {
3519
- 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"}`
3520
- }
3521
- ),
3522
- /* @__PURE__ */ jsx(
3523
- MoonIcon,
3524
- {
3525
- 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"}`
3526
- }
3527
- )
3528
- ] }),
3529
- /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Toggle theme" })
3530
- ]
3554
+ 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"}`
3531
3555
  }
3556
+ ),
3557
+ /* @__PURE__ */ jsx(
3558
+ MoonIcon,
3559
+ {
3560
+ 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"}`
3561
+ }
3562
+ ),
3563
+ showLabel && mounted && /* @__PURE__ */ jsx("span", { className: "ml-5 text-sm font-medium", children: themeLabels[activeTheme] }),
3564
+ /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Toggle theme" })
3565
+ ] });
3566
+ const wrapWithTooltip = (node) => {
3567
+ if (!tooltipText) return node;
3568
+ return /* @__PURE__ */ jsx(TooltipProviderBase, { children: /* @__PURE__ */ jsxs(TooltipBase, { children: [
3569
+ /* @__PURE__ */ jsx(TooltipTriggerBase, { asChild: true, children: node }),
3570
+ /* @__PURE__ */ jsx(TooltipContentBase, { children: tooltipText })
3571
+ ] }) });
3572
+ };
3573
+ if (directToggle) {
3574
+ return wrapWithTooltip(
3575
+ /* @__PURE__ */ jsx(
3576
+ ButtonBase,
3577
+ {
3578
+ ref: buttonRef,
3579
+ variant,
3580
+ size: showLabel ? "default" : "icon",
3581
+ className: cn("relative overflow-hidden group", className),
3582
+ onClick: handleDirectToggle,
3583
+ onMouseMove: handleMouseMove,
3584
+ onKeyDown: (e) => {
3585
+ if (e.repeat && (e.key === "Enter" || e.key === " ")) {
3586
+ e.preventDefault();
3587
+ }
3588
+ },
3589
+ children: buttonContent
3590
+ }
3591
+ )
3532
3592
  );
3533
3593
  }
3534
3594
  return /* @__PURE__ */ jsxs(DropDownMenuBase, { children: [
3535
- /* @__PURE__ */ jsx(DropDownMenuTriggerBase, { asChild: true, children: /* @__PURE__ */ jsxs(
3536
- ButtonBase,
3537
- {
3538
- ref: buttonRef,
3539
- variant,
3540
- size: "icon",
3541
- className: cn("relative overflow-hidden group", className),
3542
- children: [
3543
- /* @__PURE__ */ jsxs(Fragment, { children: [
3544
- /* @__PURE__ */ jsx(
3545
- SunIcon,
3546
- {
3547
- 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"}`
3548
- }
3549
- ),
3550
- /* @__PURE__ */ jsx(
3551
- MoonIcon,
3552
- {
3553
- 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"}`
3554
- }
3555
- )
3556
- ] }),
3557
- /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Toggle theme" })
3558
- ]
3559
- }
3595
+ /* @__PURE__ */ jsx(DropDownMenuTriggerBase, { asChild: true, children: wrapWithTooltip(
3596
+ /* @__PURE__ */ jsx(
3597
+ ButtonBase,
3598
+ {
3599
+ ref: buttonRef,
3600
+ variant,
3601
+ size: showLabel ? "default" : "icon",
3602
+ className: cn("relative overflow-hidden group", className),
3603
+ onMouseMove: handleMouseMove,
3604
+ children: buttonContent
3605
+ }
3606
+ )
3560
3607
  ) }),
3561
3608
  /* @__PURE__ */ jsx(
3562
3609
  DropDownMenuContentBase,
3563
3610
  {
3564
3611
  align: "end",
3565
- className: "border-border bg-popover text-popover-foreground min-w-[140px] ",
3612
+ className: "border-border bg-popover text-popover-foreground min-w-[140px]",
3566
3613
  children: themes.map((theme) => {
3567
3614
  const isActive = currentTheme === theme;
3568
3615
  return /* @__PURE__ */ jsxs(
@@ -3816,7 +3863,7 @@ var FileUploader = React32.forwardRef(
3816
3863
  showPreview = true,
3817
3864
  dropzoneText = "Arraste arquivos aqui ou clique para selecionar",
3818
3865
  dropzoneSubtext,
3819
- animate: animate2 = true,
3866
+ animate: animate3 = true,
3820
3867
  ...props
3821
3868
  }, ref) => {
3822
3869
  const [isDragging, setIsDragging] = React32.useState(false);
@@ -3969,7 +4016,7 @@ var FileUploader = React32.forwardRef(
3969
4016
  motion.p,
3970
4017
  {
3971
4018
  className: "mb-2 text-xs font-semibold text-foreground",
3972
- initial: animate2 ? { opacity: 0, y: -10 } : false,
4019
+ initial: animate3 ? { opacity: 0, y: -10 } : false,
3973
4020
  animate: { opacity: 1, y: 0 },
3974
4021
  transition: { delay: 0.1 },
3975
4022
  children: dropzoneText
@@ -3979,7 +4026,7 @@ var FileUploader = React32.forwardRef(
3979
4026
  motion.p,
3980
4027
  {
3981
4028
  className: "text-xs text-muted-foreground",
3982
- initial: animate2 ? { opacity: 0, y: -10 } : false,
4029
+ initial: animate3 ? { opacity: 0, y: -10 } : false,
3983
4030
  animate: { opacity: 1, y: 0 },
3984
4031
  transition: { delay: 0.2 },
3985
4032
  children: defaultSubtext
@@ -3989,7 +4036,7 @@ var FileUploader = React32.forwardRef(
3989
4036
  motion.div,
3990
4037
  {
3991
4038
  className: "py-2 w-full",
3992
- initial: animate2 ? { opacity: 0, y: 10 } : false,
4039
+ initial: animate3 ? { opacity: 0, y: 10 } : false,
3993
4040
  animate: { opacity: 1, y: 0 },
3994
4041
  transition: { delay: 0.3 },
3995
4042
  children: [
@@ -4004,7 +4051,7 @@ var FileUploader = React32.forwardRef(
4004
4051
  motion.div,
4005
4052
  {
4006
4053
  layout: true,
4007
- initial: animate2 ? { opacity: 0, x: -20 } : false,
4054
+ initial: animate3 ? { opacity: 0, x: -20 } : false,
4008
4055
  animate: { opacity: 1, x: 0 },
4009
4056
  exit: {
4010
4057
  opacity: 0,
@@ -4012,7 +4059,7 @@ var FileUploader = React32.forwardRef(
4012
4059
  transition: { duration: 0.2 }
4013
4060
  },
4014
4061
  transition: {
4015
- delay: animate2 ? index * 0.05 : 0,
4062
+ delay: animate3 ? index * 0.05 : 0,
4016
4063
  layout: { duration: 0.2 }
4017
4064
  },
4018
4065
  className: cn(
@@ -9627,7 +9674,8 @@ function DayViewAgenda({
9627
9674
  events,
9628
9675
  onEventSelect,
9629
9676
  showUndatedEvents,
9630
- noTime = false
9677
+ noTime = false,
9678
+ onEventCreate
9631
9679
  }) {
9632
9680
  const hours = useMemo(() => {
9633
9681
  const dayStart = startOfDay(currentDate);
@@ -9877,6 +9925,7 @@ function DayViewAgenda({
9877
9925
  const startTime = new Date(currentDate);
9878
9926
  startTime.setHours(hourValue);
9879
9927
  startTime.setMinutes(quarter * 15);
9928
+ if (onEventCreate) onEventCreate(startTime);
9880
9929
  },
9881
9930
  time: quarterHourTime
9882
9931
  },
@@ -10139,7 +10188,8 @@ function EventAgenda({
10139
10188
  onlyMonth,
10140
10189
  onlyWeek,
10141
10190
  onlyAgenda,
10142
- onlyYear
10191
+ onlyYear,
10192
+ allowCellClick = false
10143
10193
  }) {
10144
10194
  const lockedView = onlyDay ? "day" : onlyMonth ? "month" : onlyWeek ? "week" : onlyAgenda ? "agenda" : onlyYear ? "year" : void 0;
10145
10195
  const [currentDate, setCurrentDate] = useState(
@@ -10302,7 +10352,13 @@ function EventAgenda({
10302
10352
  currentDate,
10303
10353
  events,
10304
10354
  onEventSelect: handleEventSelect,
10305
- noTime
10355
+ noTime,
10356
+ onEventCreate: allowCellClick ? (d) => onEventUpdate?.({
10357
+ start: d,
10358
+ end: d,
10359
+ title: "Novo Evento",
10360
+ id: crypto.randomUUID()
10361
+ }) : void 0
10306
10362
  }
10307
10363
  ),
10308
10364
  activeView === "week" && /* @__PURE__ */ jsx(
@@ -10311,7 +10367,13 @@ function EventAgenda({
10311
10367
  currentDate,
10312
10368
  events,
10313
10369
  onEventSelect: handleEventSelect,
10314
- noTime
10370
+ noTime,
10371
+ onEventCreate: allowCellClick ? (d) => onEventUpdate?.({
10372
+ start: d,
10373
+ end: d,
10374
+ title: "Novo Evento",
10375
+ id: crypto.randomUUID()
10376
+ }) : void 0
10315
10377
  }
10316
10378
  ),
10317
10379
  activeView === "day" && /* @__PURE__ */ jsx(
@@ -10320,7 +10382,13 @@ function EventAgenda({
10320
10382
  currentDate,
10321
10383
  events,
10322
10384
  onEventSelect: handleEventSelect,
10323
- noTime
10385
+ noTime,
10386
+ onEventCreate: allowCellClick ? (d) => onEventUpdate?.({
10387
+ start: d,
10388
+ end: d,
10389
+ title: "Novo Evento",
10390
+ id: crypto.randomUUID()
10391
+ }) : void 0
10324
10392
  }
10325
10393
  ),
10326
10394
  activeView === "agenda" && /* @__PURE__ */ jsx(
@@ -10329,7 +10397,13 @@ function EventAgenda({
10329
10397
  currentDate,
10330
10398
  events,
10331
10399
  onEventSelect: handleEventSelect,
10332
- noTime
10400
+ noTime,
10401
+ onEventCreate: allowCellClick ? (d) => onEventUpdate?.({
10402
+ start: d,
10403
+ end: d,
10404
+ title: "Novo Evento",
10405
+ id: crypto.randomUUID()
10406
+ }) : void 0
10333
10407
  }
10334
10408
  ),
10335
10409
  activeView === "year" && /* @__PURE__ */ jsx(
@@ -10592,7 +10666,8 @@ function MonthViewAgenda({
10592
10666
  events,
10593
10667
  onEventSelect,
10594
10668
  showUndatedEvents,
10595
- noTime = false
10669
+ noTime = false,
10670
+ onEventCreate
10596
10671
  }) {
10597
10672
  const days = useMemo(() => {
10598
10673
  const monthStart = startOfMonth(currentDate);
@@ -10735,6 +10810,7 @@ function MonthViewAgenda({
10735
10810
  onClick: () => {
10736
10811
  const t = new Date(day);
10737
10812
  t.setHours(DefaultStartHourAgenda, 0, 0);
10813
+ if (onEventCreate) onEventCreate(t);
10738
10814
  },
10739
10815
  children: [
10740
10816
  /* @__PURE__ */ jsx(
@@ -16073,7 +16149,8 @@ var DraggableTooltipComponent = ({
16073
16149
  highlightedSeries,
16074
16150
  toggleHighlight,
16075
16151
  finalColors,
16076
- valueFormatter
16152
+ valueFormatter,
16153
+ seriesTypeMap
16077
16154
  ]
16078
16155
  ),
16079
16156
  /* @__PURE__ */ jsx("div", { className: "mt-3 pt-2 border-t", children: /* @__PURE__ */ jsxs("p", { className: "text-xs text-muted-foreground flex items-center gap-1", children: [
@@ -16367,74 +16444,106 @@ var SystemTooltip = ({
16367
16444
  const [localPos, setLocalPos] = useState(position);
16368
16445
  const [dragging, setDragging] = useState(false);
16369
16446
  const offsetRef = useRef({ x: 0, y: 0 });
16370
- const lastMouse = useRef({ x: 0, y: 0 });
16371
- useEffect(() => setLocalPos(position), [position]);
16447
+ const lastPos = useRef({ x: 0, y: 0 });
16448
+ const tooltipRef = useRef(null);
16449
+ const currentPosRef = useRef(position);
16450
+ useEffect(() => {
16451
+ currentPosRef.current = position;
16452
+ setLocalPos(position);
16453
+ }, [position]);
16372
16454
  useEffect(() => {
16373
16455
  let rafId = null;
16374
- const handleMouseMove = (e) => {
16375
- if (!dragging) return;
16376
- lastMouse.current = { x: e.clientX, y: e.clientY };
16456
+ const applyMove = (clientX, clientY) => {
16457
+ lastPos.current = { x: clientX, y: clientY };
16377
16458
  if (rafId) cancelAnimationFrame(rafId);
16378
16459
  rafId = requestAnimationFrame(() => {
16379
- const newLeft = lastMouse.current.x - offsetRef.current.x;
16380
- const newTop = lastMouse.current.y - offsetRef.current.y;
16381
- const rawPosition = {
16382
- top: Math.max(0, Math.min(newTop, window.innerHeight - 200)),
16383
- left: Math.max(0, Math.min(newLeft, window.innerWidth - 320))
16460
+ const p = {
16461
+ top: Math.max(
16462
+ 0,
16463
+ Math.min(
16464
+ lastPos.current.y - offsetRef.current.y,
16465
+ window.innerHeight - 200
16466
+ )
16467
+ ),
16468
+ left: Math.max(
16469
+ 0,
16470
+ Math.min(
16471
+ lastPos.current.x - offsetRef.current.x,
16472
+ window.innerWidth - 320
16473
+ )
16474
+ )
16384
16475
  };
16385
- setLocalPos(rawPosition);
16386
- if (onPositionChange) onPositionChange(id, rawPosition);
16476
+ currentPosRef.current = p;
16477
+ if (tooltipRef.current) {
16478
+ tooltipRef.current.style.top = `${p.top}px`;
16479
+ tooltipRef.current.style.left = `${p.left}px`;
16480
+ }
16481
+ onPositionChange?.(id, p);
16387
16482
  });
16388
16483
  };
16389
- const handleMouseUp = () => {
16390
- if (dragging) {
16391
- setDragging(false);
16392
- if (rafId) cancelAnimationFrame(rafId);
16393
- }
16484
+ const stopDrag = () => {
16485
+ if (!dragging) return;
16486
+ setDragging(false);
16487
+ setLocalPos(currentPosRef.current);
16488
+ if (rafId) cancelAnimationFrame(rafId);
16489
+ };
16490
+ const handleMouseMove = (e) => {
16491
+ if (dragging) applyMove(e.clientX, e.clientY);
16492
+ };
16493
+ const handleTouchMove = (e) => {
16494
+ if (!dragging || !e.touches[0]) return;
16495
+ applyMove(e.touches[0].clientX, e.touches[0].clientY);
16394
16496
  };
16395
16497
  if (dragging) {
16396
16498
  document.addEventListener("mousemove", handleMouseMove, {
16397
16499
  passive: true
16398
16500
  });
16399
- document.addEventListener("mouseup", handleMouseUp);
16501
+ document.addEventListener("mouseup", stopDrag);
16502
+ document.addEventListener("touchmove", handleTouchMove, {
16503
+ passive: true
16504
+ });
16505
+ document.addEventListener("touchend", stopDrag);
16506
+ document.addEventListener("touchcancel", stopDrag);
16400
16507
  document.body.style.cursor = "grabbing";
16401
16508
  document.body.style.userSelect = "none";
16402
16509
  }
16403
16510
  return () => {
16404
16511
  if (rafId) cancelAnimationFrame(rafId);
16405
16512
  document.removeEventListener("mousemove", handleMouseMove);
16406
- document.removeEventListener("mouseup", handleMouseUp);
16513
+ document.removeEventListener("mouseup", stopDrag);
16514
+ document.removeEventListener("touchmove", handleTouchMove);
16515
+ document.removeEventListener("touchend", stopDrag);
16516
+ document.removeEventListener("touchcancel", stopDrag);
16407
16517
  document.body.style.cursor = "";
16408
16518
  document.body.style.userSelect = "";
16409
16519
  };
16410
16520
  }, [dragging, id, onPositionChange]);
16411
- const handleMouseDownLocal = useCallback(
16412
- (e) => {
16413
- e.preventDefault();
16414
- e.stopPropagation();
16415
- const rect = e.currentTarget.closest(".fixed")?.getBoundingClientRect();
16521
+ const startDrag = useCallback(
16522
+ (clientX, clientY, e) => {
16523
+ const rect = tooltipRef.current?.getBoundingClientRect();
16416
16524
  if (!rect) return;
16417
- offsetRef.current = { x: e.clientX - rect.left, y: e.clientY - rect.top };
16525
+ offsetRef.current = { x: clientX - rect.left, y: clientY - rect.top };
16418
16526
  setDragging(true);
16419
16527
  onMouseDown?.(id, e);
16420
16528
  },
16421
16529
  [id, onMouseDown]
16422
16530
  );
16531
+ const handleMouseDownLocal = useCallback(
16532
+ (e) => {
16533
+ e.preventDefault();
16534
+ e.stopPropagation();
16535
+ startDrag(e.clientX, e.clientY, e);
16536
+ },
16537
+ [startDrag]
16538
+ );
16423
16539
  const handleTouchStartLocal = useCallback(
16424
16540
  (e) => {
16425
16541
  e.stopPropagation();
16426
16542
  const touch = e.touches[0];
16427
16543
  if (!touch) return;
16428
- const rect = e.currentTarget.closest(".fixed")?.getBoundingClientRect();
16429
- if (!rect) return;
16430
- offsetRef.current = {
16431
- x: touch.clientX - rect.left,
16432
- y: touch.clientY - rect.top
16433
- };
16434
- setDragging(true);
16435
- onMouseDown?.(id, e);
16544
+ startDrag(touch.clientX, touch.clientY, e);
16436
16545
  },
16437
- [id, onMouseDown]
16546
+ [startDrag]
16438
16547
  );
16439
16548
  const handleConnClick = useCallback(
16440
16549
  (e, conn) => {
@@ -16482,15 +16591,13 @@ var SystemTooltip = ({
16482
16591
  return /* @__PURE__ */ jsx(AnimatePresence, { children: /* @__PURE__ */ jsxs(
16483
16592
  motion.div,
16484
16593
  {
16594
+ ref: tooltipRef,
16485
16595
  className: "fixed bg-card/95 backdrop-blur-md border border-border/50 rounded-xl shadow-2xl z-[10000] w-80 overflow-hidden",
16486
16596
  variants: tooltipVariants2,
16487
16597
  initial: "hidden",
16488
16598
  animate: "visible",
16489
16599
  exit: "exit",
16490
- style: {
16491
- top: localPos.top,
16492
- left: localPos.left
16493
- },
16600
+ style: { top: localPos.top, left: localPos.left },
16494
16601
  onClick: (e) => e.stopPropagation(),
16495
16602
  children: [
16496
16603
  /* @__PURE__ */ jsxs(
@@ -16505,7 +16612,7 @@ var SystemTooltip = ({
16505
16612
  },
16506
16613
  children: [
16507
16614
  /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 px-3", children: [
16508
- /* @__PURE__ */ jsx("div", { className: "rounded", children: /* @__PURE__ */ jsx(DotsSixVerticalIcon, { size: 16, className: "text-primary" }) }),
16615
+ /* @__PURE__ */ jsx(DotsSixVerticalIcon, { size: 16, className: "text-primary" }),
16509
16616
  /* @__PURE__ */ jsx("span", { className: "text-xs font-semibold text-muted-foreground uppercase tracking-wider", children: title })
16510
16617
  ] }),
16511
16618
  /* @__PURE__ */ jsx(
@@ -16531,22 +16638,19 @@ var SystemTooltip = ({
16531
16638
  ] }) }),
16532
16639
  /* @__PURE__ */ 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: [
16533
16640
  /* @__PURE__ */ jsx(SeparatorBase, { className: "w-full" }),
16534
- isLoading ? /* @__PURE__ */ jsxs(Fragment, { children: [
16535
- /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
16536
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 px-1", children: [
16537
- /* @__PURE__ */ jsx(SkeletonBase, { className: "w-1.5 h-1.5 rounded-full" }),
16538
- /* @__PURE__ */ jsx(SkeletonBase, { className: "h-3 w-16" })
16539
- ] }),
16540
- /* @__PURE__ */ jsx("div", { className: "space-y-1", children: [1, 2, 3].map((i) => /* @__PURE__ */ jsx(SkeletonBase, { className: "h-10 w-full rounded-lg" }, i)) })
16641
+ isLoading ? /* @__PURE__ */ jsx(Fragment, { children: [1, 2].map((g) => /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
16642
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 px-1", children: [
16643
+ /* @__PURE__ */ jsx(SkeletonBase, { className: "w-1.5 h-1.5 rounded-full" }),
16644
+ /* @__PURE__ */ jsx(SkeletonBase, { className: "h-3 w-16" })
16541
16645
  ] }),
16542
- /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
16543
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 px-1", children: [
16544
- /* @__PURE__ */ jsx(SkeletonBase, { className: "w-1.5 h-1.5 rounded-full" }),
16545
- /* @__PURE__ */ jsx(SkeletonBase, { className: "h-3 w-16" })
16546
- ] }),
16547
- /* @__PURE__ */ jsx("div", { className: "space-y-1", children: [1, 2].map((i) => /* @__PURE__ */ jsx(SkeletonBase, { className: "h-10 w-full rounded-lg" }, i)) })
16548
- ] })
16549
- ] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
16646
+ /* @__PURE__ */ jsx("div", { className: "space-y-1", children: [1, 2, 3].map((i) => /* @__PURE__ */ jsx(
16647
+ SkeletonBase,
16648
+ {
16649
+ className: "h-10 w-full rounded-lg"
16650
+ },
16651
+ i
16652
+ )) })
16653
+ ] }, g)) }) : /* @__PURE__ */ jsxs(Fragment, { children: [
16550
16654
  entries.length > 0 && /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
16551
16655
  /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 px-1", children: [
16552
16656
  /* @__PURE__ */ jsx("div", { className: "w-1.5 h-1.5 rounded-full bg-emerald-500" }),
@@ -16561,7 +16665,7 @@ var SystemTooltip = ({
16561
16665
  ] }),
16562
16666
  /* @__PURE__ */ jsx("div", { className: "space-y-1", children: renderConnections(exits, "blue") })
16563
16667
  ] }),
16564
- data.connections.length === 0 && !isLoading && /* @__PURE__ */ jsx("div", { className: "flex flex-col items-center justify-center p-6 text-center", children: /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: "Nenhuma conex\xE3o encontrada" }) })
16668
+ data.connections.length === 0 && /* @__PURE__ */ jsx("div", { className: "flex flex-col items-center justify-center p-6 text-center", children: /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: "Nenhuma conex\xE3o encontrada" }) })
16565
16669
  ] })
16566
16670
  ] })
16567
16671
  ]
@@ -16583,6 +16687,13 @@ var useIsTruncated = (ref) => {
16583
16687
  }, [ref]);
16584
16688
  return truncated;
16585
16689
  };
16690
+ var SNAP_HEIGHTS = {
16691
+ collapsed: "80px",
16692
+ peek: "42dvh",
16693
+ full: "85dvh"
16694
+ };
16695
+ var VELOCITY_THRESHOLD = 500;
16696
+ var CLOSE_THRESHOLD = 50;
16586
16697
  var CopyData = ({ value }) => {
16587
16698
  const [copied, setCopied] = useState(false);
16588
16699
  const handleCopy = useCallback(() => {
@@ -16616,26 +16727,56 @@ var propertyLabels = {
16616
16727
  Destino: "Destino",
16617
16728
  Origem: "Origem"
16618
16729
  };
16619
- var IntegrationCard = ({ title, details }) => {
16730
+ var LongPressTooltip = ({ content, isMobile, children }) => {
16731
+ const [open, setOpen] = useState(false);
16732
+ const timerRef = useRef(null);
16733
+ const handleTouchStart = useCallback(() => {
16734
+ timerRef.current = setTimeout(() => setOpen(true), 1e3);
16735
+ }, []);
16736
+ const handleTouchEnd = useCallback(() => {
16737
+ if (timerRef.current) clearTimeout(timerRef.current);
16738
+ setTimeout(() => setOpen(false), 1500);
16739
+ }, []);
16740
+ useEffect(
16741
+ () => () => {
16742
+ if (timerRef.current) clearTimeout(timerRef.current);
16743
+ },
16744
+ []
16745
+ );
16746
+ return /* @__PURE__ */ jsx(TooltipProviderBase, { children: /* @__PURE__ */ jsxs(
16747
+ TooltipBase,
16748
+ {
16749
+ open: isMobile ? open : void 0,
16750
+ onOpenChange: isMobile ? setOpen : void 0,
16751
+ children: [
16752
+ /* @__PURE__ */ jsx(TooltipTriggerBase, { asChild: true, children: isMobile ? React32__default.cloneElement(children, {
16753
+ onTouchStart: handleTouchStart,
16754
+ onTouchEnd: handleTouchEnd,
16755
+ onTouchCancel: handleTouchEnd
16756
+ }) : children }),
16757
+ /* @__PURE__ */ jsx(TooltipContentBase, { sideOffset: 6, className: "z-[10001]", children: content })
16758
+ ]
16759
+ }
16760
+ ) });
16761
+ };
16762
+ var IntegrationCard = ({ title, details, isMobile }) => {
16620
16763
  const titleRef = useRef(null);
16621
16764
  const isTitleTruncated = useIsTruncated(titleRef);
16622
16765
  const blackList = ["id", "elementId", "identity"];
16623
16766
  const entries = details ? Object.entries(details).filter(
16624
16767
  ([key, value]) => value !== void 0 && value !== null && value !== "" && !blackList.includes(key)
16625
16768
  ) : [];
16769
+ const titleSpan = /* @__PURE__ */ jsx(
16770
+ "span",
16771
+ {
16772
+ ref: titleRef,
16773
+ className: "text-sm font-bold text-foreground truncate flex-1 min-w-0 cursor-default",
16774
+ children: title
16775
+ }
16776
+ );
16626
16777
  return /* @__PURE__ */ jsxs("div", { className: "rounded-lg border border-border/40 bg-muted/20 overflow-hidden", children: [
16627
16778
  /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 px-3 py-2 border-b border-border/30", children: [
16628
- /* @__PURE__ */ jsx(TooltipProviderBase, { children: /* @__PURE__ */ jsxs(TooltipBase, { children: [
16629
- /* @__PURE__ */ jsx(TooltipTriggerBase, { asChild: true, children: /* @__PURE__ */ jsx(
16630
- "span",
16631
- {
16632
- ref: titleRef,
16633
- className: "text-sm font-bold text-foreground truncate flex-1 min-w-0 cursor-default",
16634
- children: title
16635
- }
16636
- ) }),
16637
- isTitleTruncated && /* @__PURE__ */ jsx(TooltipContentBase, { sideOffset: 6, className: "z-[10001]", children: title })
16638
- ] }) }),
16779
+ isTitleTruncated ? /* @__PURE__ */ jsx(LongPressTooltip, { content: title, isMobile, children: titleSpan }) : titleSpan,
16639
16780
  entries.length > 0 && /* @__PURE__ */ jsx(
16640
16781
  CopyData,
16641
16782
  {
@@ -16655,69 +16796,59 @@ var IntegrationCard = ({ title, details }) => {
16655
16796
  }) })
16656
16797
  ] });
16657
16798
  };
16658
- var Name = ({
16659
- name,
16660
- description
16661
- }) => {
16799
+ var Name = ({ name, description, isMobile }) => {
16662
16800
  const nameRef = useRef(null);
16663
16801
  const descRef = useRef(null);
16664
16802
  const isNameTruncated = useIsTruncated(nameRef);
16665
16803
  const isDescTruncated = useIsTruncated(descRef);
16666
16804
  const showTooltip = isNameTruncated || isDescTruncated;
16667
- return /* @__PURE__ */ jsx(TooltipProviderBase, { children: /* @__PURE__ */ jsxs(TooltipBase, { children: [
16668
- /* @__PURE__ */ jsx(TooltipTriggerBase, { asChild: true, children: /* @__PURE__ */ jsxs("div", { className: "cursor-default min-w-0", children: [
16669
- /* @__PURE__ */ jsx(
16670
- "h3",
16671
- {
16672
- ref: nameRef,
16673
- className: "text-xl font-bold text-foreground tracking-tight truncate",
16674
- children: name
16675
- }
16676
- ),
16677
- description && /* @__PURE__ */ jsx(
16678
- "p",
16679
- {
16680
- ref: descRef,
16681
- className: "text-xs text-foreground/70 truncate mt-0.5",
16682
- children: description
16683
- }
16684
- )
16685
- ] }) }),
16686
- showTooltip && /* @__PURE__ */ jsxs(TooltipContentBase, { sideOffset: 8, className: "z-[10001]", children: [
16687
- /* @__PURE__ */ jsx("p", { className: "font-semibold", children: name }),
16688
- description && /* @__PURE__ */ jsx("p", { className: "text-xs text-foreground/70 mt-0.5", children: description })
16689
- ] })
16690
- ] }) });
16805
+ const content = /* @__PURE__ */ jsxs("div", { className: "cursor-default min-w-0", children: [
16806
+ /* @__PURE__ */ jsx(
16807
+ "h3",
16808
+ {
16809
+ ref: nameRef,
16810
+ className: "text-xl font-bold text-foreground tracking-tight truncate",
16811
+ children: name
16812
+ }
16813
+ ),
16814
+ description && /* @__PURE__ */ jsx("p", { ref: descRef, className: "text-xs text-foreground/70 truncate mt-0.5", children: description })
16815
+ ] });
16816
+ if (!showTooltip) return content;
16817
+ return /* @__PURE__ */ jsx(
16818
+ LongPressTooltip,
16819
+ {
16820
+ content: /* @__PURE__ */ jsxs(Fragment, { children: [
16821
+ /* @__PURE__ */ jsx("p", { className: "font-semibold", children: name }),
16822
+ description && /* @__PURE__ */ jsx("p", { className: "text-xs text-foreground/70 mt-0.5", children: description })
16823
+ ] }),
16824
+ isMobile,
16825
+ children: content
16826
+ }
16827
+ );
16691
16828
  };
16692
- var SystemNode = React32__default.forwardRef(
16693
- ({ label }, ref) => {
16694
- const innerRef = useRef(null);
16695
- const truncated = label.length > 9 ? label.substring(0, 9) + "\u2026" : label;
16696
- const needsTooltip = label.length > 9;
16697
- const setRefs = useCallback(
16698
- (node) => {
16699
- innerRef.current = node;
16700
- if (typeof ref === "function") ref(node);
16701
- else if (ref)
16702
- ref.current = node;
16703
- },
16704
- [ref]
16705
- );
16706
- const circle = /* @__PURE__ */ jsx(
16829
+ function SystemNodeInner({ label, isMobile }, ref) {
16830
+ const truncated = label.length > 9 ? label.substring(0, 9) + "\u2026" : label;
16831
+ const needsTooltip = label.length > 9;
16832
+ if (!needsTooltip) {
16833
+ return /* @__PURE__ */ jsx(
16707
16834
  "div",
16708
16835
  {
16709
- ref: setRefs,
16836
+ ref,
16710
16837
  className: "w-[76px] h-[76px] rounded-full bg-primary flex items-center justify-center shrink-0 z-10 cursor-default",
16711
16838
  children: /* @__PURE__ */ jsx("span", { className: "text-[10px] font-bold text-primary-foreground text-center px-2 leading-tight select-none", children: truncated })
16712
16839
  }
16713
16840
  );
16714
- if (!needsTooltip) return circle;
16715
- return /* @__PURE__ */ jsx(TooltipProviderBase, { children: /* @__PURE__ */ jsxs(TooltipBase, { children: [
16716
- /* @__PURE__ */ jsx(TooltipTriggerBase, { asChild: true, children: circle }),
16717
- /* @__PURE__ */ jsx(TooltipContentBase, { sideOffset: 8, className: "z-[10001]", children: label })
16718
- ] }) });
16719
16841
  }
16720
- );
16842
+ return /* @__PURE__ */ jsx(LongPressTooltip, { content: label, isMobile, children: /* @__PURE__ */ jsx(
16843
+ "div",
16844
+ {
16845
+ ref,
16846
+ className: "w-[76px] h-[76px] rounded-full bg-primary flex items-center justify-center shrink-0 z-10 cursor-default",
16847
+ children: /* @__PURE__ */ jsx("span", { className: "text-[10px] font-bold text-primary-foreground text-center px-2 leading-tight select-none", children: truncated })
16848
+ }
16849
+ ) });
16850
+ }
16851
+ var SystemNode = React32__default.forwardRef(SystemNodeInner);
16721
16852
  SystemNode.displayName = "SystemNode";
16722
16853
  var Beam = ({ isInput, containerRef, leftRef, rightRef }) => {
16723
16854
  const gradientId = useId();
@@ -16725,6 +16856,7 @@ var Beam = ({ isInput, containerRef, leftRef, rightRef }) => {
16725
16856
  const [svgSize, setSvgSize] = useState({ w: 0, h: 0 });
16726
16857
  useEffect(() => {
16727
16858
  let rafId;
16859
+ let running = true;
16728
16860
  const update = () => {
16729
16861
  const container = containerRef.current;
16730
16862
  const left = leftRef.current;
@@ -16737,39 +16869,31 @@ var Beam = ({ isInput, containerRef, leftRef, rightRef }) => {
16737
16869
  const cy1 = lr.top - cr.top + lr.height / 2;
16738
16870
  const cx2 = rr.left - cr.left + rr.width / 2;
16739
16871
  const cy2 = rr.top - cr.top + rr.height / 2;
16740
- const dx = cx2 - cx1, dy = cy2 - cy1;
16872
+ const dx = cx2 - cx1;
16873
+ const dy = cy2 - cy1;
16741
16874
  const dist = Math.sqrt(dx * dx + dy * dy);
16742
16875
  if (dist === 0) return;
16743
- const ux = dx / dist, uy = dy / dist;
16876
+ const ux = dx / dist;
16877
+ const uy = dy / dist;
16744
16878
  const r1 = lr.width / 2;
16745
16879
  const r2 = rr.width / 2;
16746
- setSvgSize({ w: cr.width, h: cr.height });
16747
- setPathD(
16748
- `M ${cx1 + ux * r1},${cy1 + uy * r1} L ${cx2 - ux * r2},${cy2 - uy * r2}`
16880
+ const newW = cr.width;
16881
+ const newH = cr.height;
16882
+ const newPath = `M ${cx1 + ux * r1},${cy1 + uy * r1} L ${cx2 - ux * r2},${cy2 - uy * r2}`;
16883
+ setSvgSize(
16884
+ (prev) => prev.w !== newW || prev.h !== newH ? { w: newW, h: newH } : prev
16749
16885
  );
16886
+ setPathD((prev) => prev !== newPath ? newPath : prev);
16750
16887
  };
16751
- const schedule = () => {
16752
- cancelAnimationFrame(rafId);
16753
- rafId = requestAnimationFrame(update);
16888
+ const loop = () => {
16889
+ if (!running) return;
16890
+ update();
16891
+ rafId = requestAnimationFrame(loop);
16754
16892
  };
16755
- requestAnimationFrame(() => requestAnimationFrame(update));
16756
- schedule();
16757
- const ro = new ResizeObserver(schedule);
16758
- if (containerRef.current) ro.observe(containerRef.current);
16759
- if (leftRef.current) ro.observe(leftRef.current);
16760
- if (rightRef.current) ro.observe(rightRef.current);
16761
- const mo = new MutationObserver(schedule);
16762
- if (containerRef.current) {
16763
- mo.observe(containerRef.current, {
16764
- attributes: true,
16765
- attributeFilter: ["class", "style"],
16766
- subtree: true
16767
- });
16768
- }
16893
+ rafId = requestAnimationFrame(loop);
16769
16894
  return () => {
16895
+ running = false;
16770
16896
  cancelAnimationFrame(rafId);
16771
- ro.disconnect();
16772
- mo.disconnect();
16773
16897
  };
16774
16898
  }, [containerRef, leftRef, rightRef]);
16775
16899
  const animX1 = isInput ? ["90%", "-10%"] : ["10%", "110%"];
@@ -16835,7 +16959,7 @@ var Beam = ({ isInput, containerRef, leftRef, rightRef }) => {
16835
16959
  }
16836
16960
  );
16837
16961
  };
16838
- var SystemsDiagram = ({ isInput, currentSystem, externalSystem }) => {
16962
+ var SystemsDiagram = ({ isInput, currentSystem, externalSystem, isMobile }) => {
16839
16963
  const containerRef = useRef(null);
16840
16964
  const leftRef = useRef(null);
16841
16965
  const rightRef = useRef(null);
@@ -16849,14 +16973,16 @@ var SystemsDiagram = ({ isInput, currentSystem, externalSystem }) => {
16849
16973
  SystemNode,
16850
16974
  {
16851
16975
  ref: leftRef,
16852
- label: isInput ? externalSystem : currentSystem
16976
+ label: isInput ? externalSystem : currentSystem,
16977
+ isMobile
16853
16978
  }
16854
16979
  ),
16855
16980
  /* @__PURE__ */ jsx(
16856
16981
  SystemNode,
16857
16982
  {
16858
16983
  ref: rightRef,
16859
- label: isInput ? currentSystem : externalSystem
16984
+ label: isInput ? currentSystem : externalSystem,
16985
+ isMobile
16860
16986
  }
16861
16987
  ),
16862
16988
  /* @__PURE__ */ jsx(
@@ -16872,47 +16998,84 @@ var SystemsDiagram = ({ isInput, currentSystem, externalSystem }) => {
16872
16998
  }
16873
16999
  );
16874
17000
  };
16875
- var BodyComponent = ({ data, isLoading, connections, isInput, externalSystem }) => /* @__PURE__ */ jsxs("div", { className: "px-3 py-3 space-y-3 max-h-[460px] 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: [
16876
- isLoading ? /* @__PURE__ */ jsxs("div", { className: "space-y-1.5", children: [
16877
- /* @__PURE__ */ jsx(SkeletonBase, { className: "h-6 w-3/4" }),
16878
- /* @__PURE__ */ jsx(SkeletonBase, { className: "h-3.5 w-1/2" })
16879
- ] }) : /* @__PURE__ */ jsx(Name, { name: data.name, description: data.description }),
16880
- isLoading ? /* @__PURE__ */ jsxs("div", { className: "space-y-3", children: [
16881
- /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between py-1", children: [
16882
- /* @__PURE__ */ jsx(SkeletonBase, { className: "w-[76px] h-[76px] rounded-full" }),
16883
- /* @__PURE__ */ jsx(SkeletonBase, { className: "w-[76px] h-[76px] rounded-full" })
16884
- ] }),
16885
- /* @__PURE__ */ jsx("div", { className: "border-t border-border/20" }),
16886
- [1, 2].map((i) => /* @__PURE__ */ jsxs(
16887
- "div",
16888
- {
16889
- className: "rounded-lg border border-border/20 overflow-hidden",
16890
- children: [
16891
- /* @__PURE__ */ jsx(SkeletonBase, { className: "h-8 w-full" }),
16892
- [1, 2, 3].map((j) => /* @__PURE__ */ jsx(SkeletonBase, { className: "h-7 w-full mt-px" }, j))
16893
- ]
17001
+ var BodyComponent = ({
17002
+ data,
17003
+ isLoading,
17004
+ connections,
17005
+ isInput,
17006
+ externalSystem,
17007
+ isMobile,
17008
+ scrollable
17009
+ }) => /* @__PURE__ */ jsxs("div", { className: "relative min-h-0 flex-1 overflow-hidden", children: [
17010
+ /* @__PURE__ */ jsx("div", { className: "absolute top-0 left-0 right-0 h-5 bg-gradient-to-b from-card to-transparent z-10 pointer-events-none" }),
17011
+ /* @__PURE__ */ jsxs(
17012
+ "div",
17013
+ {
17014
+ className: [
17015
+ "px-3 py-3 space-y-3",
17016
+ scrollable ? "overflow-y-auto overscroll-contain [&::-webkit-scrollbar]:w-1 [&::-webkit-scrollbar-track]:bg-transparent [&::-webkit-scrollbar-thumb]:bg-primary/20 [&::-webkit-scrollbar-thumb]:rounded-full" : "overflow-hidden",
17017
+ isMobile ? "max-h-[calc(85dvh-80px)]" : "max-h [&::-webkit-scrollbar]:hidden"
17018
+ ].join(" "),
17019
+ onPointerDownCapture: (e) => {
17020
+ if (scrollable) e.stopPropagation();
16894
17021
  },
16895
- i
16896
- ))
16897
- ] }) : connections.length === 0 ? /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground text-center", children: "Nenhuma conex\xE3o encontrada" }) : /* @__PURE__ */ jsxs(Fragment, { children: [
16898
- /* @__PURE__ */ jsx(
16899
- SystemsDiagram,
16900
- {
16901
- isInput,
16902
- currentSystem: data.name,
16903
- externalSystem
16904
- }
16905
- ),
16906
- /* @__PURE__ */ jsx("div", { className: "flex items-center", children: /* @__PURE__ */ jsx("span", { className: "text-[10px] font-bold text-muted-foreground uppercase -mb-2", children: isInput ? "Informa\xE7\xF5es de Entrada" : "Informa\xE7\xF5es de Sa\xEDda" }) }),
16907
- /* @__PURE__ */ jsx("div", { children: connections.map((conn) => /* @__PURE__ */ jsx(
16908
- IntegrationCard,
16909
- {
16910
- title: conn.name,
16911
- details: conn.integration
17022
+ onTouchStartCapture: (e) => {
17023
+ if (scrollable) e.stopPropagation();
16912
17024
  },
16913
- conn.id
16914
- )) })
16915
- ] })
17025
+ children: [
17026
+ isLoading ? /* @__PURE__ */ jsxs("div", { className: "space-y-1.5", children: [
17027
+ /* @__PURE__ */ jsx(SkeletonBase, { className: "h-6 w-3/4" }),
17028
+ /* @__PURE__ */ jsx(SkeletonBase, { className: "h-3.5 w-1/2" })
17029
+ ] }) : /* @__PURE__ */ jsx(
17030
+ Name,
17031
+ {
17032
+ name: data.name,
17033
+ description: data.description,
17034
+ isMobile
17035
+ }
17036
+ ),
17037
+ isLoading ? /* @__PURE__ */ jsxs("div", { className: "space-y-3", children: [
17038
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between py-1", children: [
17039
+ /* @__PURE__ */ jsx(SkeletonBase, { className: "w-[76px] h-[76px] rounded-full" }),
17040
+ /* @__PURE__ */ jsx(SkeletonBase, { className: "w-[76px] h-[76px] rounded-full" })
17041
+ ] }),
17042
+ /* @__PURE__ */ jsx("div", { className: "border-t border-border/20" }),
17043
+ [1, 2].map((i) => /* @__PURE__ */ jsxs(
17044
+ "div",
17045
+ {
17046
+ className: "rounded-lg border border-border/20 overflow-hidden",
17047
+ children: [
17048
+ /* @__PURE__ */ jsx(SkeletonBase, { className: "h-8 w-full" }),
17049
+ [1, 2, 3].map((j) => /* @__PURE__ */ jsx(SkeletonBase, { className: "h-7 w-full mt-px" }, j))
17050
+ ]
17051
+ },
17052
+ i
17053
+ ))
17054
+ ] }) : connections.length === 0 ? /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground text-center", children: "Nenhuma conex\xE3o encontrada" }) : /* @__PURE__ */ jsxs(Fragment, { children: [
17055
+ /* @__PURE__ */ jsx(
17056
+ SystemsDiagram,
17057
+ {
17058
+ isInput,
17059
+ currentSystem: data.name,
17060
+ externalSystem,
17061
+ isMobile
17062
+ }
17063
+ ),
17064
+ /* @__PURE__ */ jsx("div", { className: "flex items-center", children: /* @__PURE__ */ jsx("span", { className: "text-[10px] font-bold text-muted-foreground uppercase -mb-2", children: isInput ? "Informa\xE7\xF5es de Entrada" : "Informa\xE7\xF5es de Sa\xEDda" }) }),
17065
+ /* @__PURE__ */ jsx("div", { className: "space-y-2", children: connections.map((conn) => /* @__PURE__ */ jsx(
17066
+ IntegrationCard,
17067
+ {
17068
+ title: conn.name,
17069
+ details: conn.integration,
17070
+ isMobile
17071
+ },
17072
+ conn.id
17073
+ )) })
17074
+ ] })
17075
+ ]
17076
+ }
17077
+ ),
17078
+ /* @__PURE__ */ jsx("div", { className: "absolute bottom-0 left-0 right-0 h-5 bg-gradient-to-t from-card to-transparent z-10 pointer-events-none" })
16916
17079
  ] });
16917
17080
  var Body = React32__default.memo(BodyComponent);
16918
17081
  var modalVariants = {
@@ -16932,6 +17095,25 @@ var modalVariants = {
16932
17095
  transition: { type: "spring", stiffness: 400, damping: 28 }
16933
17096
  }
16934
17097
  };
17098
+ function resolveSnapPx(snap) {
17099
+ const vh = typeof window !== "undefined" ? window.innerHeight : 800;
17100
+ if (snap === "collapsed") return 80;
17101
+ if (snap === "peek") return vh * 0.42;
17102
+ return vh * 0.85;
17103
+ }
17104
+ function nearestSnap(heightPx) {
17105
+ const snaps = ["collapsed", "peek", "full"];
17106
+ let best = "peek";
17107
+ let bestDist = Infinity;
17108
+ for (const s of snaps) {
17109
+ const dist = Math.abs(resolveSnapPx(s) - heightPx);
17110
+ if (dist < bestDist) {
17111
+ bestDist = dist;
17112
+ best = s;
17113
+ }
17114
+ }
17115
+ return best;
17116
+ }
16935
17117
  var IntegrationModal = ({
16936
17118
  id,
16937
17119
  data,
@@ -17026,6 +17208,66 @@ var IntegrationModal = ({
17026
17208
  },
17027
17209
  [id, onMouseDown]
17028
17210
  );
17211
+ const [snap, setSnap] = useState("peek");
17212
+ const sheetHeight = useMotionValue(SNAP_HEIGHTS.peek);
17213
+ const snapTo = useCallback(
17214
+ (target) => {
17215
+ setSnap(target);
17216
+ animate(sheetHeight, SNAP_HEIGHTS[target], {
17217
+ type: "spring",
17218
+ stiffness: 320,
17219
+ damping: 36
17220
+ });
17221
+ },
17222
+ [sheetHeight]
17223
+ );
17224
+ useEffect(() => {
17225
+ if (isMobile) {
17226
+ sheetHeight.set("0px");
17227
+ animate(sheetHeight, SNAP_HEIGHTS.peek, {
17228
+ type: "spring",
17229
+ stiffness: 320,
17230
+ damping: 36
17231
+ });
17232
+ }
17233
+ }, [isMobile, sheetHeight]);
17234
+ const handleDragEnd = useCallback(
17235
+ (_, info) => {
17236
+ const vy = info.velocity.y;
17237
+ const dy = info.offset.y;
17238
+ const currentHeightStr = sheetHeight.get();
17239
+ const currentHeightPx = typeof currentHeightStr === "string" && currentHeightStr.endsWith("dvh") ? parseFloat(currentHeightStr) / 100 * window.innerHeight : parseFloat(currentHeightStr);
17240
+ const draggedHeightPx = currentHeightPx - dy;
17241
+ const collapsedPx = resolveSnapPx("collapsed");
17242
+ if (draggedHeightPx < collapsedPx - CLOSE_THRESHOLD || snap === "collapsed" && vy > VELOCITY_THRESHOLD) {
17243
+ onClose(id);
17244
+ return;
17245
+ }
17246
+ if (vy < -VELOCITY_THRESHOLD) {
17247
+ if (snap === "collapsed") {
17248
+ snapTo("peek");
17249
+ return;
17250
+ }
17251
+ if (snap === "peek") {
17252
+ snapTo("full");
17253
+ return;
17254
+ }
17255
+ }
17256
+ if (vy > VELOCITY_THRESHOLD) {
17257
+ if (snap === "full") {
17258
+ snapTo("peek");
17259
+ return;
17260
+ }
17261
+ if (snap === "peek") {
17262
+ snapTo("collapsed");
17263
+ return;
17264
+ }
17265
+ }
17266
+ const nearest = nearestSnap(draggedHeightPx);
17267
+ snapTo(nearest);
17268
+ },
17269
+ [id, onClose, snap, snapTo, sheetHeight]
17270
+ );
17029
17271
  const inputConnections = useMemo(
17030
17272
  () => data.connections.filter((c) => c.type === "entrada"),
17031
17273
  [data.connections]
@@ -17040,19 +17282,19 @@ var IntegrationModal = ({
17040
17282
  const header = /* @__PURE__ */ jsxs(
17041
17283
  "div",
17042
17284
  {
17043
- className: "flex items-center justify-between py-1 border-b border-border shrink-0 max-w-lg",
17044
- onMouseDown: handleMouseDownLocal,
17045
- onTouchStart: handleTouchStartLocal,
17285
+ className: "flex items-center justify-between py-1 border-b border-border shrink-0",
17286
+ onMouseDown: !isMobile ? handleMouseDownLocal : void 0,
17287
+ onTouchStart: !isMobile ? handleTouchStartLocal : void 0,
17046
17288
  style: {
17047
- touchAction: "none",
17048
- cursor: dragging ? "grabbing" : "grab"
17289
+ touchAction: isMobile ? "auto" : "none",
17290
+ cursor: isMobile ? "default" : dragging ? "grabbing" : "grab"
17049
17291
  },
17050
17292
  children: [
17051
17293
  /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 px-3", children: [
17052
- /* @__PURE__ */ jsx(DotsSixVerticalIcon, { size: 16, className: "text-primary" }),
17294
+ !isMobile && /* @__PURE__ */ jsx(DotsSixVerticalIcon, { size: 16, className: "text-primary" }),
17053
17295
  /* @__PURE__ */ jsx("span", { className: "text-xs font-semibold text-muted-foreground uppercase tracking-wider", children: title })
17054
17296
  ] }),
17055
- /* @__PURE__ */ jsx(
17297
+ !isMobile && /* @__PURE__ */ jsx(
17056
17298
  ButtonBase,
17057
17299
  {
17058
17300
  variant: "ghost",
@@ -17066,7 +17308,15 @@ var IntegrationModal = ({
17066
17308
  ]
17067
17309
  }
17068
17310
  );
17069
- const bodyProps = { data, isLoading, connections, isInput, externalSystem };
17311
+ const bodyProps = {
17312
+ data,
17313
+ isLoading,
17314
+ connections,
17315
+ isInput,
17316
+ externalSystem,
17317
+ isMobile,
17318
+ scrollable: isMobile ? snap === "full" : true
17319
+ };
17070
17320
  if (isMobile) {
17071
17321
  return /* @__PURE__ */ jsx(AnimatePresence, { children: /* @__PURE__ */ jsxs(Fragment, { children: [
17072
17322
  /* @__PURE__ */ jsx(
@@ -17083,17 +17333,42 @@ var IntegrationModal = ({
17083
17333
  /* @__PURE__ */ jsxs(
17084
17334
  motion.div,
17085
17335
  {
17086
- className: "fixed bottom-0 left-0 right-0 z-[10000] bg-card border-t border-border/50 rounded-t-2xl shadow-2xl flex flex-col min-h-0",
17087
- style: { maxHeight: "85dvh" },
17088
- initial: { y: "100%" },
17089
- animate: { y: 0 },
17090
- exit: { y: "100%" },
17091
- transition: { type: "spring", stiffness: 320, damping: 36 },
17336
+ className: [
17337
+ "fixed bottom-0 left-0 right-0 z-[10000] bg-card border-t border-border/50 shadow-2xl flex flex-col",
17338
+ snap === "full" ? "rounded-t-[10px]" : "rounded-t-2xl"
17339
+ ].join(" "),
17340
+ style: {
17341
+ height: sheetHeight,
17342
+ touchAction: "none",
17343
+ overscrollBehavior: "none",
17344
+ boxShadow: snap === "full" ? "0 -8px 40px 0 rgba(0,0,0,0.32), 0 -1px 0 0 hsl(var(--border))" : void 0
17345
+ },
17346
+ drag: "y",
17347
+ dragConstraints: { top: 0, bottom: 0 },
17348
+ dragElastic: { top: 0.05, bottom: 0.25 },
17349
+ dragMomentum: false,
17350
+ onDragEnd: handleDragEnd,
17351
+ exit: { height: 0, opacity: 0, transition: { duration: 0.25 } },
17092
17352
  onClick: (e) => e.stopPropagation(),
17093
17353
  children: [
17094
- /* @__PURE__ */ jsx("div", { className: "flex justify-center pt-2.5 pb-1 shrink-0", children: /* @__PURE__ */ jsx("div", { className: "w-10 h-1 rounded-full bg-border" }) }),
17354
+ snap !== "full" && /* @__PURE__ */ jsx(
17355
+ "div",
17356
+ {
17357
+ className: "flex justify-center pt-3 pb-1 shrink-0 touch-none",
17358
+ style: { touchAction: "none" },
17359
+ children: /* @__PURE__ */ jsx("div", { className: "w-10 h-1 rounded-full bg-muted-foreground/30" })
17360
+ }
17361
+ ),
17362
+ snap === "full" && /* @__PURE__ */ jsx(
17363
+ "div",
17364
+ {
17365
+ className: "flex items-center justify-between px-4 pt-3 pb-2 shrink-0 touch-none",
17366
+ style: { touchAction: "none" },
17367
+ children: /* @__PURE__ */ jsx("div", { className: "w-10 h-1 rounded-full bg-muted-foreground/30 mx-auto" })
17368
+ }
17369
+ ),
17095
17370
  header,
17096
- /* @__PURE__ */ jsx("div", { className: "flex-1 min-h-0 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: /* @__PURE__ */ jsx(Body, { ...bodyProps }) })
17371
+ /* @__PURE__ */ jsx(Body, { ...bodyProps })
17097
17372
  ]
17098
17373
  },
17099
17374
  `sheet-${id}`
@@ -21637,6 +21912,22 @@ function GroupLabel({ group }) {
21637
21912
  /* @__PURE__ */ jsx("span", { className: "text-[11px] font-semibold text-muted-foreground uppercase tracking-widest", children: group.label })
21638
21913
  ] });
21639
21914
  }
21915
+ function HighlightText({ text, query }) {
21916
+ if (!query || !query.trim()) return /* @__PURE__ */ jsx(Fragment, { children: text });
21917
+ const terms = query.split(/[, ]+/).map((t) => t.trim()).filter((t) => t.length > 0);
21918
+ if (terms.length === 0) return /* @__PURE__ */ jsx(Fragment, { children: text });
21919
+ const escapedTerms = terms.map(
21920
+ (t) => t.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")
21921
+ );
21922
+ const regex = new RegExp(`(${escapedTerms.join("|")})`, "gi");
21923
+ const parts = text.split(regex);
21924
+ return /* @__PURE__ */ jsx(Fragment, { children: parts.map((part, i) => {
21925
+ const isMatch = terms.some(
21926
+ (t) => t.toLowerCase() === part.toLowerCase()
21927
+ );
21928
+ return isMatch ? /* @__PURE__ */ jsx("span", { className: "text-primary font-semibold", children: part }, i) : /* @__PURE__ */ jsx("span", { children: part }, i);
21929
+ }) });
21930
+ }
21640
21931
  function mapBadgeVariantToColor(variant) {
21641
21932
  if (!variant) return void 0;
21642
21933
  switch (variant) {
@@ -21663,8 +21954,10 @@ function mapBadgeVariantToColor(variant) {
21663
21954
  function CommandItemRow({
21664
21955
  item,
21665
21956
  isActive,
21957
+ isSelected,
21666
21958
  onSelect,
21667
- onHover
21959
+ onHover,
21960
+ searchQuery
21668
21961
  }) {
21669
21962
  return /* @__PURE__ */ jsxs(
21670
21963
  motion.button,
@@ -21682,7 +21975,7 @@ function CommandItemRow({
21682
21975
  "span",
21683
21976
  {
21684
21977
  className: `relative flex-shrink-0 w-8 h-8 flex items-center justify-center rounded-md text-base
21685
- ${isActive ? "bg-primary/20 text-primary" : "bg-muted text-muted-foreground group-hover:text-foreground"}`,
21978
+ ${isSelected ? "bg-primary text-primary-foreground" : isActive ? "bg-primary/20 text-primary" : "bg-muted text-muted-foreground group-hover:text-foreground"}`,
21686
21979
  children: item.icon
21687
21980
  }
21688
21981
  ),
@@ -21692,15 +21985,22 @@ function CommandItemRow({
21692
21985
  "span",
21693
21986
  {
21694
21987
  className: `text-sm font-medium truncate ${isActive ? "text-foreground" : "text-foreground/80"}`,
21695
- children: item.label
21988
+ children: /* @__PURE__ */ jsx(HighlightText, { text: item.label, query: searchQuery })
21696
21989
  }
21697
21990
  ),
21698
21991
  item.badge && /* @__PURE__ */ jsx(Badge, { color: mapBadgeVariantToColor(item.badgeVariant), children: item.badge.toUpperCase() })
21699
21992
  ] }),
21700
- item.description && /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground truncate", children: item.description })
21993
+ item.description && /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground truncate", children: /* @__PURE__ */ jsx(HighlightText, { text: item.description, query: searchQuery }) })
21701
21994
  ] }),
21702
21995
  item.shortcut && /* @__PURE__ */ jsx("div", { className: "relative hidden sm:flex items-center gap-1 flex-shrink-0", children: item.shortcut.map((k, i) => /* @__PURE__ */ jsx(Kbd, { children: k }, i)) }),
21703
- isActive && /* @__PURE__ */ jsx(
21996
+ isSelected && /* @__PURE__ */ jsx(
21997
+ motion.div,
21998
+ {
21999
+ layoutId: `selected-indicator-${item.id}`,
22000
+ className: "absolute left-0 top-1/2 -translate-y-1/2 w-1 h-2/3 bg-primary rounded-r-md"
22001
+ }
22002
+ ),
22003
+ isActive && !isSelected && /* @__PURE__ */ jsx(
21704
22004
  CaretRightIcon,
21705
22005
  {
21706
22006
  className: "relative w-4 h-4 text-primary flex-shrink-0",
@@ -21720,22 +22020,40 @@ function useCommandPalette({
21720
22020
  recentItems = [],
21721
22021
  onRecentItemsChange,
21722
22022
  maxRecentItems = 5,
21723
- multiSearch = false
22023
+ multiSearch = false,
22024
+ multiSelect = false,
22025
+ onSelectMultiple
21724
22026
  }) {
21725
22027
  const [query, setQuery] = React32.useState("");
21726
22028
  const [activeIndex, setActiveIndex] = React32.useState(0);
21727
22029
  const [page, setPage] = React32.useState(0);
22030
+ const [selectedItemIds, setSelectedItemIds] = React32.useState(
22031
+ /* @__PURE__ */ new Set()
22032
+ );
22033
+ const toggleSelection = React32.useCallback((id) => {
22034
+ setSelectedItemIds((prev) => {
22035
+ const next = new Set(prev);
22036
+ if (next.has(id)) next.delete(id);
22037
+ else next.add(id);
22038
+ return next;
22039
+ });
22040
+ }, []);
22041
+ const clearSelection = React32.useCallback(
22042
+ () => setSelectedItemIds(/* @__PURE__ */ new Set()),
22043
+ []
22044
+ );
21728
22045
  const baseGroups = React32.useMemo(
21729
22046
  () => normaliseGroups(items, groups),
21730
22047
  [items, groups]
21731
22048
  );
21732
- React32.useEffect(() => {
22049
+ useEffect(() => {
21733
22050
  if (open) {
21734
22051
  setQuery("");
21735
22052
  setActiveIndex(0);
21736
22053
  setPage(0);
22054
+ clearSelection();
21737
22055
  }
21738
- }, [open]);
22056
+ }, [open, clearSelection]);
21739
22057
  const searchTerms = React32.useMemo(() => {
21740
22058
  const parts = query.split(",");
21741
22059
  if (parts.length <= 1 && !multiSearch) return [];
@@ -21798,12 +22116,35 @@ function useCommandPalette({
21798
22116
  () => displayedGroups.flatMap((g) => g.items),
21799
22117
  [displayedGroups]
21800
22118
  );
22119
+ const selectedItems = useMemo(
22120
+ () => allFlatItems.filter((i) => selectedItemIds.has(i.id)),
22121
+ [allFlatItems, selectedItemIds]
22122
+ );
21801
22123
  const pageItemCount = flatItems.length;
21802
22124
  useEffect(() => {
21803
22125
  setActiveIndex((i) => Math.min(i, Math.max(pageItemCount - 1, 0)));
21804
22126
  }, [pageItemCount]);
21805
- function handleSelect(item) {
22127
+ function executeBulkAction() {
22128
+ if (!onSelectMultiple || selectedItems.length === 0) return;
22129
+ onSelectMultiple(selectedItems);
22130
+ onOpenChange?.(false);
22131
+ }
22132
+ function handleSelect(item, event) {
21806
22133
  if (!item) return;
22134
+ if (multiSelect) {
22135
+ if (event && ("ctrlKey" in event || "metaKey" in event || "shiftKey" in event) && (event.ctrlKey || event.metaKey || event.shiftKey)) {
22136
+ toggleSelection(item.id);
22137
+ return;
22138
+ }
22139
+ if (selectedItems.length > 0) {
22140
+ const itemsToSubmit = selectedItemIds.has(item.id) ? selectedItems : [...selectedItems, item];
22141
+ if (onSelectMultiple) {
22142
+ onSelectMultiple(itemsToSubmit);
22143
+ }
22144
+ onOpenChange?.(false);
22145
+ return;
22146
+ }
22147
+ }
21807
22148
  item.onSelect();
21808
22149
  onOpenChange?.(false);
21809
22150
  if (onRecentItemsChange) {
@@ -21836,12 +22177,26 @@ function useCommandPalette({
21836
22177
  }
21837
22178
  } else if (e.key === "Enter") {
21838
22179
  e.preventDefault();
21839
- handleSelect(flatItems[activeIndex]);
22180
+ if (multiSelect && (e.ctrlKey || e.metaKey)) {
22181
+ executeBulkAction();
22182
+ return;
22183
+ }
22184
+ handleSelect(flatItems[activeIndex], e);
21840
22185
  }
21841
22186
  };
21842
22187
  document.addEventListener("keydown", handler);
21843
22188
  return () => document.removeEventListener("keydown", handler);
21844
- }, [open, flatItems, activeIndex, pageItemCount, page, totalPages]);
22189
+ }, [
22190
+ open,
22191
+ flatItems,
22192
+ activeIndex,
22193
+ pageItemCount,
22194
+ page,
22195
+ totalPages,
22196
+ executeBulkAction,
22197
+ handleSelect,
22198
+ multiSelect
22199
+ ]);
21845
22200
  return {
21846
22201
  query,
21847
22202
  setQuery,
@@ -21857,6 +22212,10 @@ function useCommandPalette({
21857
22212
  totalItems,
21858
22213
  totalPages,
21859
22214
  handleSelect,
22215
+ selectedItemIds,
22216
+ toggleSelection,
22217
+ selectedItems,
22218
+ executeBulkAction,
21860
22219
  isEmpty: totalItems === 0 && query.trim().length > 0,
21861
22220
  showList: query.trim() !== "" || recentItems.length > 0
21862
22221
  };
@@ -21916,8 +22275,12 @@ var VirtualResultList = memo(
21916
22275
  displayedGroups,
21917
22276
  flatItems,
21918
22277
  activeIndex,
22278
+ multiSelect,
22279
+ selectedItemIds,
21919
22280
  onHover,
21920
- onSelect
22281
+ onSelect,
22282
+ onToggleSelection,
22283
+ searchQuery
21921
22284
  }) => {
21922
22285
  const rows = useMemo(() => {
21923
22286
  const acc = [];
@@ -21973,8 +22336,12 @@ var VirtualResultList = memo(
21973
22336
  {
21974
22337
  item: row.item,
21975
22338
  isActive: row.globalIdx === activeIndex,
22339
+ isSelected: selectedItemIds.has(row.item.id),
22340
+ multiSelect,
21976
22341
  onHover: () => onHover(row.globalIdx),
21977
- onSelect: () => onSelect(row.item)
22342
+ onSelect: (e) => onSelect(row.item, e),
22343
+ onToggleSelection: (e) => onToggleSelection(row.item.id, e),
22344
+ searchQuery
21978
22345
  }
21979
22346
  ) })
21980
22347
  },
@@ -21986,30 +22353,55 @@ var VirtualResultList = memo(
21986
22353
  }
21987
22354
  );
21988
22355
  VirtualResultList.displayName = "VirtualResultList";
21989
- var FooterBar = memo(({ footer, totalItems }) => /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between px-4 py-2 border-t border-border bg-muted/30", children: [
21990
- footer ?? /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-4 text-[11px] text-muted-foreground", children: [
21991
- /* @__PURE__ */ jsxs("span", { className: "flex items-center gap-1.5", children: [
21992
- /* @__PURE__ */ jsx(ArrowElbowDownRightIcon, { className: "w-3 h-3" }),
21993
- "Selecionar"
21994
- ] }),
21995
- /* @__PURE__ */ jsxs("span", { className: "flex items-center gap-1.5", children: [
21996
- /* @__PURE__ */ jsx("span", { className: "font-mono", children: "\u2191\u2193" }),
21997
- "Navegar"
21998
- ] }),
21999
- /* @__PURE__ */ jsxs("span", { className: "flex items-center gap-1.5", children: [
22000
- /* @__PURE__ */ jsx(ArrowBendUpLeftIcon, { className: "w-3 h-3" }),
22001
- "Fechar"
22002
- ] })
22003
- ] }),
22004
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1.5 text-[11px] text-muted-foreground", children: [
22005
- /* @__PURE__ */ jsx(CommandIcon, { className: "w-3 h-3" }),
22006
- /* @__PURE__ */ jsxs("span", { children: [
22007
- totalItems,
22008
- " resultado",
22009
- totalItems !== 1 ? "s" : ""
22356
+ var FooterBar = memo(
22357
+ ({
22358
+ footer,
22359
+ totalItems,
22360
+ selectedCount = 0,
22361
+ executeBulkAction
22362
+ }) => /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between px-4 py-2 border-t border-border bg-muted/30", children: [
22363
+ footer ?? /* @__PURE__ */ jsx("div", { className: "flex items-center gap-4 text-[11px] text-muted-foreground", children: selectedCount > 0 ? /* @__PURE__ */ jsxs(Fragment, { children: [
22364
+ /* @__PURE__ */ jsxs(
22365
+ "button",
22366
+ {
22367
+ onClick: executeBulkAction,
22368
+ className: "flex items-center gap-1.5 text-primary hover:text-primary/80 transition-colors font-medium cursor-pointer",
22369
+ children: [
22370
+ /* @__PURE__ */ jsx(CommandIcon, { className: "w-3 h-3" }),
22371
+ " Confirmar (",
22372
+ selectedCount,
22373
+ ")"
22374
+ ]
22375
+ }
22376
+ ),
22377
+ /* @__PURE__ */ jsxs("span", { className: "flex items-center gap-1.5", children: [
22378
+ /* @__PURE__ */ jsx("span", { className: "font-mono", children: "Ctrl+Enter" }),
22379
+ "Finalizar sele\xE7\xE3o"
22380
+ ] })
22381
+ ] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
22382
+ /* @__PURE__ */ jsxs("span", { className: "flex items-center gap-1.5", children: [
22383
+ /* @__PURE__ */ jsx(ArrowElbowDownRightIcon, { className: "w-3 h-3" }),
22384
+ "Selecionar"
22385
+ ] }),
22386
+ /* @__PURE__ */ jsxs("span", { className: "flex items-center gap-1.5", children: [
22387
+ /* @__PURE__ */ jsx("span", { className: "font-mono", children: "\u2191\u2193" }),
22388
+ "Navegar"
22389
+ ] }),
22390
+ /* @__PURE__ */ jsxs("span", { className: "flex items-center gap-1.5", children: [
22391
+ /* @__PURE__ */ jsx(ArrowBendUpLeftIcon, { className: "w-3 h-3" }),
22392
+ "Fechar"
22393
+ ] })
22394
+ ] }) }),
22395
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1.5 text-[11px] text-muted-foreground", children: [
22396
+ /* @__PURE__ */ jsx(CommandIcon, { className: "w-3 h-3" }),
22397
+ /* @__PURE__ */ jsxs("span", { children: [
22398
+ totalItems,
22399
+ " resultado",
22400
+ totalItems !== 1 ? "s" : ""
22401
+ ] })
22010
22402
  ] })
22011
22403
  ] })
22012
- ] }));
22404
+ );
22013
22405
  FooterBar.displayName = "FooterBar";
22014
22406
  function CommandPalette(props) {
22015
22407
  const {
@@ -22019,6 +22411,7 @@ function CommandPalette(props) {
22019
22411
  footer,
22020
22412
  debounceDelay = 300,
22021
22413
  multiSearch = false,
22414
+ multiSelect = false,
22022
22415
  emptyMessage = "Nenhum resultado encontrado.",
22023
22416
  shortcut = { key: "k", ctrl: true }
22024
22417
  } = props;
@@ -22035,6 +22428,9 @@ function CommandPalette(props) {
22035
22428
  flatItems,
22036
22429
  totalItems,
22037
22430
  handleSelect,
22431
+ selectedItemIds,
22432
+ toggleSelection,
22433
+ executeBulkAction,
22038
22434
  isEmpty,
22039
22435
  showList
22040
22436
  } = useCommandPalette({
@@ -22091,8 +22487,12 @@ function CommandPalette(props) {
22091
22487
  displayedGroups,
22092
22488
  flatItems,
22093
22489
  activeIndex,
22490
+ multiSelect,
22491
+ selectedItemIds,
22094
22492
  onHover: setActiveIndex,
22095
- onSelect: handleSelect
22493
+ onSelect: handleSelect,
22494
+ onToggleSelection: toggleSelection,
22495
+ searchQuery: query
22096
22496
  };
22097
22497
  if (isMobile) {
22098
22498
  return /* @__PURE__ */ jsxs(Fragment, { children: [
@@ -22135,65 +22535,60 @@ function CommandPalette(props) {
22135
22535
  ] }) })
22136
22536
  ] });
22137
22537
  }
22138
- return /* @__PURE__ */ jsx(AnimatePresence, { children: open && /* @__PURE__ */ jsxs(Fragment, { children: [
22139
- /* @__PURE__ */ jsx(
22140
- motion.div,
22141
- {
22142
- initial: { opacity: 0 },
22143
- animate: { opacity: 1 },
22144
- exit: { opacity: 0 },
22145
- transition: ANIMATION.overlay,
22146
- className: "fixed inset-0 z-[100] bg-background/80 backdrop-blur-sm",
22147
- onClick: handleClose
22148
- }
22149
- ),
22150
- /* @__PURE__ */ jsxs(
22151
- motion.div,
22152
- {
22153
- initial: { opacity: 0, scale: 0.96, y: -8 },
22154
- animate: { opacity: 1, scale: 1, y: 0 },
22155
- exit: { opacity: 0, scale: 0.96, y: -8 },
22156
- transition: ANIMATION.panel,
22157
- 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",
22158
- style: { maxHeight: "min(600px, 80vh)" },
22159
- children: [
22160
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3 px-4 py-2 border-b border-border", children: [
22161
- /* @__PURE__ */ jsx(
22162
- MagnifyingGlassIcon,
22163
- {
22164
- className: "w-4 h-4 text-muted-foreground flex-shrink-0",
22165
- weight: "bold"
22166
- }
22167
- ),
22168
- /* @__PURE__ */ jsx(
22169
- DebouncedInput,
22170
- {
22171
- ref: inputRef,
22172
- value: query,
22173
- debounce: debounceDelay,
22174
- onChange: handleQueryChange,
22175
- placeholder: searchPlaceholder,
22176
- rightIcon: query ? /* @__PURE__ */ jsx(
22177
- ButtonBase,
22178
- {
22179
- variant: "ghost",
22180
- size: "icon",
22181
- onClick: handleClearQuery,
22182
- className: "text-muted-foreground hover:text-red-500 hover:bg-transparent transition-colors",
22183
- children: /* @__PURE__ */ jsx(XIcon, { className: "w-4 h-4" })
22184
- }
22185
- ) : void 0,
22186
- className: "flex-1 bg-transparent border-none focus-visible:ring-0 outline-none shadow-none px-0 h-7 text-sm caret-primary"
22187
- }
22188
- )
22189
- ] }),
22190
- /* @__PURE__ */ jsx(SearchBadges, { terms: searchTerms }),
22191
- showList && /* @__PURE__ */ jsx(VirtualResultList, { ...sharedListProps }),
22192
- /* @__PURE__ */ jsx(FooterBar, { footer, totalItems })
22193
- ]
22194
- }
22195
- )
22196
- ] }) });
22538
+ return /* @__PURE__ */ jsx(AnimatePresence, { children: open && /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs(
22539
+ motion.div,
22540
+ {
22541
+ initial: { opacity: 0, scale: 0.96, y: -8 },
22542
+ animate: { opacity: 1, scale: 1, y: 0 },
22543
+ exit: { opacity: 0, scale: 0.96, y: -8 },
22544
+ transition: ANIMATION.panel,
22545
+ 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",
22546
+ style: { maxHeight: "min(600px, 80vh)" },
22547
+ children: [
22548
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3 px-4 py-2 border-b border-border", children: [
22549
+ /* @__PURE__ */ jsx(
22550
+ MagnifyingGlassIcon,
22551
+ {
22552
+ className: "w-4 h-4 text-muted-foreground flex-shrink-0",
22553
+ weight: "bold"
22554
+ }
22555
+ ),
22556
+ /* @__PURE__ */ jsx(
22557
+ DebouncedInput,
22558
+ {
22559
+ ref: inputRef,
22560
+ value: query,
22561
+ debounce: debounceDelay,
22562
+ onChange: handleQueryChange,
22563
+ placeholder: searchPlaceholder,
22564
+ rightIcon: query ? /* @__PURE__ */ jsx(
22565
+ ButtonBase,
22566
+ {
22567
+ variant: "ghost",
22568
+ size: "icon",
22569
+ onClick: handleClearQuery,
22570
+ className: "text-muted-foreground hover:text-red-500 hover:bg-transparent transition-colors",
22571
+ children: /* @__PURE__ */ jsx(XIcon, { className: "w-4 h-4" })
22572
+ }
22573
+ ) : void 0,
22574
+ className: "flex-1 bg-transparent border-none focus-visible:ring-0 outline-none shadow-none px-0 h-7 text-sm caret-primary"
22575
+ }
22576
+ )
22577
+ ] }),
22578
+ /* @__PURE__ */ jsx(SearchBadges, { terms: searchTerms }),
22579
+ showList && /* @__PURE__ */ jsx(VirtualResultList, { ...sharedListProps }),
22580
+ /* @__PURE__ */ jsx(
22581
+ FooterBar,
22582
+ {
22583
+ footer,
22584
+ totalItems,
22585
+ selectedCount: selectedItemIds.size,
22586
+ executeBulkAction
22587
+ }
22588
+ )
22589
+ ]
22590
+ }
22591
+ ) }) });
22197
22592
  }
22198
22593
 
22199
22594
  export { AddButton, Agenda, AgendaDaysToShow, AgendaDaysToShowAgenda, AgendaView, AlertDialogActionBase, AlertDialogBase, AlertDialogCancelBase, AlertDialogContentBase, AlertDialogDescriptionBase, AlertDialogFooterBase, AlertDialogHeaderBase, AlertDialogOverlayBase, AlertDialogPortalBase, AlertDialogTitleBase, AlertDialogTriggerBase, AvatarBase, AvatarCombobox, AvatarFallbackBase, AvatarImageBase, BackButton, Badge, BreadcrumbBase, BreadcrumbEllipsisBase, BreadcrumbItemBase, BreadcrumbLinkBase, BreadcrumbListBase, BreadcrumbPageBase, BreadcrumbSeparatorBase, Brush_default as Brush, ButtonBase, ButtonGroupBase, CENTER_INDEX, CalendarBase, CalendarDndProvider, CalendarDndProviderAgenda, CardBase, CardContentBase, CardDescriptionBase, CardFooterBase, CardHeaderBase, CardTitleBase, CarouselBase, ChangeButton, Chart_default as Chart, ChartControls, ChartHeader, ChartTotalLegend_default as ChartTotalLegend, CheckButton, CheckboxBase, CheckboxTree, CircularProgress, CloseAllButton_default as CloseAllButton, CloseButton, CodeBlock, CollapsibleBase, CollapsibleContentBase, CollapsibleTriggerBase, Combobox, CommandBase, CommandDebouncedInputBase, CommandDialogBase, CommandEmptyBase, CommandGroupBase, CommandInputBase, CommandItemBase, CommandItemRow, CommandListBase, CommandPalette, CommandSeparatorBase, CommandShortcutBase, ContextMenuBase, ContextMenuCheckboxItemBase, ContextMenuContentBase, ContextMenuGroupBase, ContextMenuItemBase, ContextMenuLabelBase, ContextMenuPortalBase, ContextMenuRadioGroupBase, ContextMenuRadioItemBase, ContextMenuSeparatorBase, ContextMenuShortcutBase, ContextMenuSubBase, ContextMenuSubContentBase, ContextMenuSubTriggerBase, ContextMenuTriggerBase, ControlledCombobox, CopyButton, DateTimePicker, DayView, DayViewAgenda, DebouncedInput, DefaultEndHour, DefaultEndHourAgenda, DefaultStartHour, DefaultStartHourAgenda, DestructiveDialog, DialogBase, DialogCloseBase, DialogContentBase, DialogDescriptionBase, DialogFooterBase, DialogHeaderBase, DialogOverlayBase, DialogPortalBase, DialogTitleBase, DialogTriggerBase, DownloadButton, DraggableEvent2 as DraggableEvent, DraggableTooltip_default as DraggableTooltip, DrawerBase, DrawerCloseBase, DrawerContentBase, DrawerDescriptionBase, DrawerFooterBase, DrawerHeaderBase, DrawerOverlayBase, DrawerPortalBase, DrawerTitleBase, DrawerTriggerBase, DropDownMenuBase, DropDownMenuCheckboxItemBase, DropDownMenuContentBase, DropDownMenuGroupBase, DropDownMenuItemBase, DropDownMenuLabelBase, DropDownMenuPortalBase, DropDownMenuRadioGroupBase, DropDownMenuRadioItemBase, DropDownMenuSeparatorBase, DropDownMenuShortcutBase, DropDownMenuSubBase, DropDownMenuSubContentBase, DropDownMenuSubTriggerBase, DropDownMenuTriggerBase, DroppableCell, DroppableCellAgenda, EditButton, EndHour, EndHourAgenda, ErrorMessage_default as ErrorMessage, EventAgenda, EventCalendar, EventDetailModalAgenda, EventDialog, EventGap, EventGapAgenda, EventHeight, EventHeightAgenda, EventItem, EventItemAgenda, EventsPopup, FavoriteButton, FileAccept, FileUploader, FilterButton, GroupLabel, HideButton, Highlights_default as Highlights, HorizontalChart_default as HorizontalChart, HorizontalLegend_default as HorizontalLegend, HoverCardBase, HoverCardContentBase, HoverCardTriggerBase, ITEM_HEIGHT, InputBase, InputOTPBase, InputOTPGroupBase, InputOTPSeparatorBase, InputOTPSlotBase, IntegrationModal_default as IntegrationModal, Kbd, KbdGroup, LabelBase_default as LabelBase, Leaderboard, LikeButton, LoadingBase, LockButton, ModalBase, ModalCloseBase, ModalContentBase, ModalDescriptionBase, ModalFooterBase, ModalHeaderBase, ModalOverlayBase, ModalPortalBase, ModalTitleBase, ModalTriggerBase, ModeToggleBase, MonthView, MonthViewAgenda, MoreButton, MultiCombobox, MultiDayOverlay, MultiSelect, MultiSelectBase, MultiSelectContentBase, MultiSelectGroupBase, MultiSelectItemBase, MultiSelectSeparatorBase, MultiSelectTriggerBase, MultiSelectValueBase, NavigationMenuBase, NavigationMenuContentBase, NavigationMenuIndicatorBase, NavigationMenuItemBase, NavigationMenuLinkBase, NavigationMenuListBase, NavigationMenuTriggerBase, NavigationMenuViewportBase, NoData_default as NoData, NotificationButton, NumericInput, PeriodsDropdown_default as PeriodsDropdown, PopoverAnchorBase, PopoverBase, PopoverContentBase, PopoverTriggerBase, ProgressBase, ProgressCirclesBase, ProgressPanelsBase, ProgressSegmentsBase, RadialMenu, RangePicker, RefreshButton, SaveButton, ScrollAreaBase, ScrollBarBase, SearchButton, Select, SelectBase, SelectContentBase, SelectEmpty, SelectGroupBase, SelectItemBase, SelectLabelBase, SelectScrollDownButtonBase, SelectScrollUpButtonBase, SelectSeparatorBase, SelectTriggerBase, SelectValueBase, SeparatorBase, SettingsButton, SheetBase, SheetCloseBase, SheetContentBase, SheetDescriptionBase, SheetFooterBase, SheetHeaderBase, SheetOverlayBase, SheetPortalBase, SheetTitleBase, SheetTriggerBase, ShowOnly_default as ShowOnly, SidebarBase, SidebarContentBase, SidebarFooterBase, SidebarGroupActionBase, SidebarGroupBase, SidebarGroupContentBase, SidebarGroupLabelBase, SidebarHeaderBase, SidebarInputBase, SidebarInsetBase, SidebarMenuActionBase, SidebarMenuBadgeBase, SidebarMenuBase, SidebarMenuButtonBase, SidebarMenuItemBase, SidebarMenuSkeletonBase, SidebarMenuSubBase, SidebarMenuSubButtonBase, SidebarMenuSubItemBase, SidebarProviderBase, SidebarRailBase, SidebarSeparatorBase, SidebarTriggerBase, SkeletonBase, SlideBase, StartHour, StartHourAgenda, StatusIndicator, SwitchBase, SystemTooltip_default as SystemTooltip, TableBase, TableBodyBase, TableCaptionBase, TableCellBase, TableFooterBase, TableHeadBase, TableHeaderBase, TableRowBase, TabsBase, TabsContentBase, TabsListBase, TabsTriggerBase, TextAreaBase, ThemeProviderBase, TimePicker, TimePickerInput, TimeSeries_default as TimeSeries, Toaster, TooltipBase, TooltipContentBase, TooltipProviderBase, TooltipSimple_default as TooltipSimple, TooltipTriggerBase, TooltipWithTotal_default as TooltipWithTotal, UndatedEvents, UniversalTooltipRenderer, UnlockButton, UploadButton, UseSideBarBase, VISIBLE_ITEMS, ViewButton, VisibilityButton, WeekCellsHeight, WeekCellsHeightAgenda, WeekView, WeekViewAgenda, YearViewAgenda, adaptDataForTooltip, addHoursToDate, addHoursToDateAgenda, addMinutesToDateAgenda, badgeVariants, buttonVariantsBase, compactTick, computeChartWidth, computeNiceMax, computeYAxisTickWidth, convert12HourTo24Hour, createGroup, createItem, createValueFormatter, createYTickFormatter, detectDataFields, detectXAxis, display12HourValue, filterAndScore, formatDurationAgenda, formatDurationAgendaDays, formatFieldName, formatLinePercentage, generateAdditionalColors, generateColorMap, getAgendaEventsForDay, getAgendaEventsForDayAgenda, getAllEventsForDay, getAllEventsForDayAgenda, getArrowByType, getAutoColorAgenda, getBorderRadiusClasses, getBorderRadiusClassesAgenda, getDateByType, getEventColorClasses, getEventColorClassesAgenda, getEventEndDate, getEventStartDate, getEventsForDay, getEventsForDayAgenda, getItems, getMaxDataValue, getMinDataValue, getSpanningEventsForDay, getSpanningEventsForDayAgenda, getValid12Hour, getValidArrow12Hour, getValidArrowHour, getValidArrowMinuteOrSecond, getValidArrowNumber, getValidHour, getValidMinuteOrSecond, getValidNumber, isMultiDayEvent, isMultiDayEventAgenda, isValid12Hour, isValidHour, isValidMinuteOrSecond, niceCeil, normaliseGroups, normalizeAttendDate, normalizeStr, processIntegrationData, processNeo4jData, renderInsideBarLabel, pillLabelRenderer_default as renderPillLabel, resolveChartMargins, resolveContainerPaddingLeft, scoreMatch, set12Hours, setDateByType, setHours, setMinutes, setSeconds, sortEvents, sortEventsAgenda, startOfLocalDay, toast, unionGroups, useBiaxial, useCalendarDnd, useCalendarDndAgenda, useChartClick, useChartDimensions, useChartHighlights, useChartLayout, useChartMinMax, useChartTooltips, useCommandPalette, useCurrentTimeIndicator, useCurrentTimeIndicatorAgenda, useDrag, useEventVisibility, useEventVisibilityAgenda, useIsMobile, useIsTruncated, useOpenTooltipForPeriod, useProcessedData, useRecents, useSeriesOpacity, useTheme, useTimeSeriesRange, visualForItem };