@mlw-packages/react-components 1.10.8 → 1.10.10

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,6 +1,6 @@
1
1
  import './index.css';
2
2
  import * as React32 from 'react';
3
- import React32__default, { forwardRef, useState, useEffect, createContext, useMemo, useRef, useCallback, useId, useContext, useLayoutEffect } from 'react';
3
+ import React32__default, { forwardRef, useState, useEffect, createContext, useRef, useCallback, useMemo, 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';
@@ -627,7 +627,7 @@ var DialogOverlayBase = React32.forwardRef(({ className, testid: dataTestId = "d
627
627
  {
628
628
  ref,
629
629
  className: cn(
630
- "fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 ",
630
+ "fixed inset-0 z-[200] bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 ",
631
631
  className
632
632
  ),
633
633
  "data-testid": dataTestId,
@@ -645,7 +645,7 @@ var DialogContentBase = React32.forwardRef(
645
645
  {
646
646
  ref,
647
647
  className: cn(
648
- "fixed left-[50%] top-[50%] z-50 w-[90%] sm:w-lg grid translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg max-h-[100dvh] overflow-y-auto overflow-x-hidden rounded-md border-border",
648
+ "fixed left-[50%] top-[50%] z-[200] w-[90%] sm:w-lg grid translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg max-h-[100dvh] overflow-y-auto overflow-x-hidden rounded-md border-border",
649
649
  className
650
650
  ),
651
651
  "data-testid": dataTestId,
@@ -653,10 +653,16 @@ var DialogContentBase = React32.forwardRef(
653
653
  onWheel: userOnWheel,
654
654
  children: [
655
655
  children,
656
- /* @__PURE__ */ jsxs(DialogPrimitive.Close, { className: "absolute right-3 top-3 sm:right-4 sm:top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-n\n 0 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground z-10 touch-manipulation", children: [
657
- /* @__PURE__ */ jsx(XIcon, { className: "h-6 w-6 sm:h-4 sm:w-4 hover:text-red-500 font-extrabold" }),
658
- /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Close" })
659
- ] })
656
+ /* @__PURE__ */ jsxs(
657
+ DialogPrimitive.Close,
658
+ {
659
+ className: "absolute right-3 top-3 sm:right-4 sm:top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-n\n 0 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground z-10 touch-manipulation",
660
+ children: [
661
+ /* @__PURE__ */ jsx(XIcon, { className: "h-6 w-6 sm:h-4 sm:w-4 hover:text-red-500 font-extrabold" }),
662
+ /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Close" })
663
+ ]
664
+ }
665
+ )
660
666
  ]
661
667
  }
662
668
  )
@@ -3432,6 +3438,7 @@ var ThemeIcon = ({ theme }) => {
3432
3438
  function ModeToggleBase({
3433
3439
  themes = ["light", "dark", "system"],
3434
3440
  className,
3441
+ directToggle = false,
3435
3442
  variant = "ghost"
3436
3443
  }) {
3437
3444
  const [mounted, setMounted] = useState(false);
@@ -3482,6 +3489,40 @@ function ModeToggleBase({
3482
3489
  setTheme(newTheme);
3483
3490
  }
3484
3491
  };
3492
+ const handleDirectToggle = () => {
3493
+ const currentIndex = themes.indexOf(currentTheme);
3494
+ const nextIndex = (currentIndex + 1) % themes.length;
3495
+ toggleTheme(themes[nextIndex]);
3496
+ };
3497
+ if (directToggle) {
3498
+ return /* @__PURE__ */ jsxs(
3499
+ ButtonBase,
3500
+ {
3501
+ ref: buttonRef,
3502
+ variant,
3503
+ size: "icon",
3504
+ className: cn("relative overflow-hidden group", className),
3505
+ onClick: handleDirectToggle,
3506
+ children: [
3507
+ /* @__PURE__ */ jsxs(Fragment, { children: [
3508
+ /* @__PURE__ */ jsx(
3509
+ SunIcon,
3510
+ {
3511
+ 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"}`
3512
+ }
3513
+ ),
3514
+ /* @__PURE__ */ jsx(
3515
+ MoonIcon,
3516
+ {
3517
+ 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"}`
3518
+ }
3519
+ )
3520
+ ] }),
3521
+ /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Toggle theme" })
3522
+ ]
3523
+ }
3524
+ );
3525
+ }
3485
3526
  return /* @__PURE__ */ jsxs(DropDownMenuBase, { children: [
3486
3527
  /* @__PURE__ */ jsx(DropDownMenuTriggerBase, { asChild: true, children: /* @__PURE__ */ jsxs(
3487
3528
  ButtonBase,
@@ -8596,7 +8637,8 @@ function Agenda({
8596
8637
  currentDate,
8597
8638
  events,
8598
8639
  onEventSelect,
8599
- showUndatedEvents = true
8640
+ showUndatedEvents = true,
8641
+ noTime = false
8600
8642
  }) {
8601
8643
  const isValidDate5 = (d) => {
8602
8644
  try {
@@ -8665,6 +8707,7 @@ function Agenda({
8665
8707
  event,
8666
8708
  onClick: onEventSelect ? (e) => handleEventClick(event, e) : void 0,
8667
8709
  view: "agenda",
8710
+ noTime,
8668
8711
  className: onEventSelect ? void 0 : "hover:shadow-none hover:scale-100"
8669
8712
  },
8670
8713
  event.id
@@ -8929,6 +8972,9 @@ var StartHourAgenda = 0;
8929
8972
  var EndHourAgenda = 24;
8930
8973
  var DefaultStartHourAgenda = 9;
8931
8974
  var DefaultEndHourAgenda = 10;
8975
+ function startOfLocalDay(d) {
8976
+ return new Date(d.getFullYear(), d.getMonth(), d.getDate());
8977
+ }
8932
8978
  function getAutoColorAgenda(id) {
8933
8979
  const colors2 = [
8934
8980
  "sky",
@@ -9039,7 +9085,9 @@ function getSpanningEventsForDayAgenda(events, day) {
9039
9085
  const eventStart = getEventStartDate(event);
9040
9086
  const eventEnd = getEventEndDate(event);
9041
9087
  if (!eventStart || !eventEnd) return false;
9042
- return !isSameDay(day, eventStart) && (isSameDay(day, eventEnd) || day > eventStart && day < eventEnd);
9088
+ const startDay = startOfLocalDay(eventStart);
9089
+ const endDay = startOfLocalDay(eventEnd);
9090
+ return !isSameDay(day, eventStart) && (isSameDay(day, eventEnd) || day > startDay && day < endDay);
9043
9091
  });
9044
9092
  }
9045
9093
  function getAllEventsForDayAgenda(events, day) {
@@ -9047,7 +9095,9 @@ function getAllEventsForDayAgenda(events, day) {
9047
9095
  const eventStart = getEventStartDate(event);
9048
9096
  const eventEnd = getEventEndDate(event);
9049
9097
  if (!eventStart) return false;
9050
- return isSameDay(day, eventStart) || (eventEnd ? isSameDay(day, eventEnd) : false) || (eventEnd ? day > eventStart && day < eventEnd : false);
9098
+ const startDay = startOfLocalDay(eventStart);
9099
+ const endDay = eventEnd ? startOfLocalDay(eventEnd) : null;
9100
+ return isSameDay(day, eventStart) || (endDay ? isSameDay(day, eventEnd) : false) || (endDay ? day > startDay && day < endDay : false);
9051
9101
  });
9052
9102
  }
9053
9103
  function getAgendaEventsForDayAgenda(events, day) {
@@ -9055,7 +9105,9 @@ function getAgendaEventsForDayAgenda(events, day) {
9055
9105
  const eventStart = getEventStartDate(event);
9056
9106
  const eventEnd = getEventEndDate(event);
9057
9107
  if (!eventStart) return false;
9058
- return isSameDay(day, eventStart) || (eventEnd ? isSameDay(day, eventEnd) : false) || (eventEnd ? day > eventStart && day < eventEnd : false);
9108
+ const startDay = startOfLocalDay(eventStart);
9109
+ const endDay = eventEnd ? startOfLocalDay(eventEnd) : null;
9110
+ return isSameDay(day, eventStart) || (eventEnd ? isSameDay(day, eventEnd) : false) || (endDay ? day > startDay && day < endDay : false);
9059
9111
  }).sort((a, b) => getEventStartTimestamp(a) - getEventStartTimestamp(b));
9060
9112
  }
9061
9113
  function getEventStartDate(event) {
@@ -9226,6 +9278,7 @@ function EventItemAgenda({
9226
9278
  view,
9227
9279
  onClick,
9228
9280
  showTime,
9281
+ noTime = false,
9229
9282
  currentTime,
9230
9283
  isFirstDay = true,
9231
9284
  isLastDay = true,
@@ -9304,9 +9357,10 @@ function EventItemAgenda({
9304
9357
  ariaLabel,
9305
9358
  isFirstDay,
9306
9359
  isLastDay,
9360
+ noTime,
9307
9361
  onClick,
9308
9362
  children: children || /* @__PURE__ */ jsxs("span", { className: "flex items-center gap-2 truncate min-w-0", children: [
9309
- !event.allDay && hasValidTime && displayStart && /* @__PURE__ */ jsx("span", { className: "truncate text-sm sm:text-base md:text-lg lg:text-xl opacity-80 bg-white/10 px-2 rounded-full min-w-0", children: formatTimeWithOptionalMinutes(displayStart) }),
9363
+ !noTime && !event.allDay && hasValidTime && displayStart && /* @__PURE__ */ jsx("span", { className: "truncate text-sm sm:text-base md:text-lg lg:text-xl opacity-80 bg-white/10 px-2 rounded-full min-w-0", children: formatTimeWithOptionalMinutes(displayStart) }),
9310
9364
  /* @__PURE__ */ jsx(
9311
9365
  "span",
9312
9366
  {
@@ -9360,6 +9414,7 @@ function EventItemAgenda({
9360
9414
  ariaLabel,
9361
9415
  isFirstDay,
9362
9416
  isLastDay,
9417
+ noTime,
9363
9418
  onClick,
9364
9419
  onMouseDown,
9365
9420
  onTouchStart,
@@ -9383,15 +9438,16 @@ function EventItemAgenda({
9383
9438
  ariaLabel,
9384
9439
  isFirstDay,
9385
9440
  isLastDay,
9441
+ noTime,
9386
9442
  onClick,
9387
9443
  onMouseDown,
9388
9444
  onTouchStart,
9389
9445
  children: isCompact ? /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1 w-full min-w-0 overflow-hidden", children: [
9390
9446
  /* @__PURE__ */ jsx("span", { className: "truncate font-semibold leading-none min-w-0", children: event.title }),
9391
- showTime && hasValidTime && displayStart && /* @__PURE__ */ jsx("span", { className: "shrink-0 opacity-75 leading-none", children: formatTimeWithOptionalMinutes(displayStart) })
9447
+ !noTime && showTime && hasValidTime && displayStart && /* @__PURE__ */ jsx("span", { className: "shrink-0 opacity-75 leading-none", children: formatTimeWithOptionalMinutes(displayStart) })
9392
9448
  ] }) : /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-0.5 w-full min-w-0 overflow-hidden h-full", children: [
9393
9449
  /* @__PURE__ */ jsx("span", { className: "font-semibold leading-snug truncate", children: event.title }),
9394
- showTime && hasValidTime && /* @__PURE__ */ jsx("span", { className: "opacity-75 leading-none truncate", children: getEventTime() })
9450
+ !noTime && showTime && hasValidTime && /* @__PURE__ */ jsx("span", { className: "opacity-75 leading-none truncate", children: getEventTime() })
9395
9451
  ] })
9396
9452
  }
9397
9453
  );
@@ -9470,7 +9526,7 @@ function EventItemAgenda({
9470
9526
  children: event.title
9471
9527
  }
9472
9528
  ),
9473
- /* @__PURE__ */ jsx(
9529
+ !noTime && /* @__PURE__ */ jsx(
9474
9530
  "div",
9475
9531
  {
9476
9532
  className: cn(
@@ -9533,7 +9589,8 @@ function DayViewAgenda({
9533
9589
  currentDate,
9534
9590
  events,
9535
9591
  onEventSelect,
9536
- showUndatedEvents
9592
+ showUndatedEvents,
9593
+ noTime = false
9537
9594
  }) {
9538
9595
  const hours = useMemo(() => {
9539
9596
  const dayStart = startOfDay(currentDate);
@@ -9721,7 +9778,8 @@ function DayViewAgenda({
9721
9778
  isFirstDay,
9722
9779
  isLastDay,
9723
9780
  onClick: (e) => handleEventClick(evt, e),
9724
- showTime: true
9781
+ showTime: true,
9782
+ noTime
9725
9783
  }
9726
9784
  ) }) }),
9727
9785
  /* @__PURE__ */ jsxs(
@@ -10038,7 +10096,8 @@ function EventAgenda({
10038
10096
  initialView = "month",
10039
10097
  initialDate,
10040
10098
  onClick,
10041
- showYearView = false
10099
+ showYearView = false,
10100
+ noTime = false
10042
10101
  }) {
10043
10102
  const [currentDate, setCurrentDate] = useState(
10044
10103
  initialDate && new Date(initialDate) || /* @__PURE__ */ new Date()
@@ -10194,7 +10253,8 @@ function EventAgenda({
10194
10253
  {
10195
10254
  currentDate,
10196
10255
  events,
10197
- onEventSelect: handleEventSelect
10256
+ onEventSelect: handleEventSelect,
10257
+ noTime
10198
10258
  }
10199
10259
  ),
10200
10260
  view === "week" && /* @__PURE__ */ jsx(
@@ -10202,7 +10262,8 @@ function EventAgenda({
10202
10262
  {
10203
10263
  currentDate,
10204
10264
  events,
10205
- onEventSelect: handleEventSelect
10265
+ onEventSelect: handleEventSelect,
10266
+ noTime
10206
10267
  }
10207
10268
  ),
10208
10269
  view === "day" && /* @__PURE__ */ jsx(
@@ -10210,7 +10271,8 @@ function EventAgenda({
10210
10271
  {
10211
10272
  currentDate,
10212
10273
  events,
10213
- onEventSelect: handleEventSelect
10274
+ onEventSelect: handleEventSelect,
10275
+ noTime
10214
10276
  }
10215
10277
  ),
10216
10278
  view === "agenda" && /* @__PURE__ */ jsx(
@@ -10218,7 +10280,8 @@ function EventAgenda({
10218
10280
  {
10219
10281
  currentDate,
10220
10282
  events,
10221
- onEventSelect: handleEventSelect
10283
+ onEventSelect: handleEventSelect,
10284
+ noTime
10222
10285
  }
10223
10286
  ),
10224
10287
  view === "year" && /* @__PURE__ */ jsx(
@@ -10236,7 +10299,8 @@ function EventAgenda({
10236
10299
  ] }),
10237
10300
  selectedEvent && React32__default.isValidElement(onClick) ? React32__default.cloneElement(onClick, {
10238
10301
  event: selectedEvent,
10239
- onClose: () => setSelectedEvent(null)
10302
+ onClose: () => setSelectedEvent(null),
10303
+ noTime
10240
10304
  }) : null
10241
10305
  ]
10242
10306
  }
@@ -10322,12 +10386,17 @@ function useEventVisibilityAgenda({
10322
10386
  getVisibleEventCount
10323
10387
  };
10324
10388
  }
10389
+ function startOfDay2(d) {
10390
+ return new Date(d.getFullYear(), d.getMonth(), d.getDate());
10391
+ }
10325
10392
  function clampToWeek(date, weekStart, weekEnd) {
10326
10393
  return max([min([date, weekEnd]), weekStart]);
10327
10394
  }
10328
10395
  function dayCol(date, weekStart) {
10396
+ const dateDay = startOfDay2(date);
10397
+ const weekStartDay = startOfDay2(weekStart);
10329
10398
  const diff = Math.round(
10330
- (date.getTime() - weekStart.getTime()) / (1e3 * 60 * 60 * 24)
10399
+ (dateDay.getTime() - weekStartDay.getTime()) / (1e3 * 60 * 60 * 24)
10331
10400
  );
10332
10401
  return Math.max(0, Math.min(6, diff));
10333
10402
  }
@@ -10339,7 +10408,7 @@ function computeMultiDayBars(events, weekDays) {
10339
10408
  const start = getEventStartDate(ev);
10340
10409
  const end = getEventEndDate(ev) ?? start;
10341
10410
  if (!start || !end) return false;
10342
- return start <= weekEnd && end >= weekStart;
10411
+ return startOfDay2(start) <= startOfDay2(weekEnd) && startOfDay2(end) >= startOfDay2(weekStart);
10343
10412
  });
10344
10413
  const sorted = [...multiDayEvents].sort((a, b) => {
10345
10414
  const aS = getEventStartDate(a) ?? /* @__PURE__ */ new Date(0);
@@ -10390,7 +10459,8 @@ function MultiDayOverlay({
10390
10459
  weekIndex,
10391
10460
  hoveredEventId,
10392
10461
  onHover,
10393
- onEventSelect
10462
+ onEventSelect,
10463
+ noTime = false
10394
10464
  }) {
10395
10465
  if (bars.length === 0) return null;
10396
10466
  return /* @__PURE__ */ jsx("div", { className: "absolute inset-0 pointer-events-none mt-1", children: bars.map((bar) => {
@@ -10433,7 +10503,7 @@ function MultiDayOverlay({
10433
10503
  ),
10434
10504
  children: /* @__PURE__ */ jsxs("span", { className: "flex items-center gap-0.5 w-full min-w-0", children: [
10435
10505
  continuesFromPrev && /* @__PURE__ */ jsx("span", { className: "shrink-0 opacity-50 leading-none mr-0.5 flex items-center", children: /* @__PURE__ */ jsx(CaretLeftIcon, { size: 10, weight: "bold" }) }),
10436
- !event.allDay && isFirstDay && /* @__PURE__ */ jsx("span", { className: "shrink-0 font-normal opacity-75 text-[10px] bg-white/15 px-1 py-0.5 rounded-full leading-none", children: format(eventStart, "HH:mm") }),
10506
+ !noTime && !event.allDay && isFirstDay && /* @__PURE__ */ jsx("span", { className: "shrink-0 font-normal opacity-75 text-[10px] bg-white/15 px-1 py-0.5 rounded-full leading-none", children: format(eventStart, "HH:mm") }),
10437
10507
  /* @__PURE__ */ jsx("span", { className: "font-semibold text-[11px] sm:text-xs truncate min-w-0 leading-none flex-1", children: event.title }),
10438
10508
  isFirstDay && (() => {
10439
10509
  const evStart = getEventStartDate(event);
@@ -10455,7 +10525,7 @@ function MultiDayOverlay({
10455
10525
  /* @__PURE__ */ jsxs(TooltipContentBase, { side: "top", children: [
10456
10526
  /* @__PURE__ */ jsx("p", { className: "font-semibold truncate max-w-[200px]", children: event.title }),
10457
10527
  /* @__PURE__ */ jsx("p", { className: "opacity-80 mt-0.5 leading-snug", children: formatDurationAgenda(event) }),
10458
- event.location && /* @__PURE__ */ jsxs("p", { className: "opacity-60 mt-0.5 truncate text-[11px] max-w-[200px]", children: [
10528
+ event.location && /* @__PURE__ */ jsxs("p", { className: "opacity-60 mt-0.5 truncate text-[11px] max-w-[200px] flex items-center", children: [
10459
10529
  /* @__PURE__ */ jsx(MapPinIcon, { size: 15 }),
10460
10530
  " ",
10461
10531
  event.location
@@ -10471,7 +10541,8 @@ function MonthViewAgenda({
10471
10541
  currentDate,
10472
10542
  events,
10473
10543
  onEventSelect,
10474
- showUndatedEvents
10544
+ showUndatedEvents,
10545
+ noTime = false
10475
10546
  }) {
10476
10547
  const days = useMemo(() => {
10477
10548
  const monthStart = startOfMonth(currentDate);
@@ -10661,8 +10732,9 @@ function MonthViewAgenda({
10661
10732
  isLastDay: true,
10662
10733
  onClick: (e) => handleEventClick(event, e),
10663
10734
  view: "month",
10735
+ noTime,
10664
10736
  children: /* @__PURE__ */ jsxs("span", { className: "flex items-center gap-1 sm:gap-1.5 truncate text-[11px] relative z-10", children: [
10665
- !event.allDay && /* @__PURE__ */ jsx("span", { className: "font-normal opacity-80 text-[10px] sm:text-[11px] bg-white/10 px-1 py-0.5 rounded-full", children: format(eventStart, "HH:mm") }),
10737
+ !noTime && !event.allDay && /* @__PURE__ */ jsx("span", { className: "font-normal opacity-80 text-[10px] sm:text-[11px] bg-white/10 px-1 py-0.5 rounded-full", children: format(eventStart, "HH:mm") }),
10666
10738
  /* @__PURE__ */ jsx("span", { className: "font-semibold truncate", children: event.title })
10667
10739
  ] })
10668
10740
  }
@@ -10704,28 +10776,36 @@ function MonthViewAgenda({
10704
10776
  PopoverContentBase,
10705
10777
  {
10706
10778
  align: "center",
10707
- className: "max-w-52 p-3",
10779
+ className: "max-w-52 p-3 border-border",
10708
10780
  style: {
10709
10781
  "--event-height": `${EventHeightAgenda}px`
10710
10782
  },
10711
- children: /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
10712
- /* @__PURE__ */ jsx("p", { className: "font-semibold text-sm", children: format(day, "EEE d", { locale: ptBR }) }),
10713
- /* @__PURE__ */ jsx("div", { className: "space-y-1", children: sortEventsAgenda(allEvents).map((event) => {
10714
- const s = getEventStartDate(event) ?? getEventEndDate(event) ?? /* @__PURE__ */ new Date();
10715
- const e2 = getEventEndDate(event) ?? getEventStartDate(event) ?? /* @__PURE__ */ new Date();
10716
- return /* @__PURE__ */ jsx(
10717
- EventItemAgenda,
10718
- {
10719
- event,
10720
- isFirstDay: isSameDay(day, s),
10721
- isLastDay: isSameDay(day, e2),
10722
- onClick: (e) => handleEventClick(event, e),
10723
- view: "month"
10724
- },
10725
- event.id
10726
- );
10727
- }) })
10728
- ] })
10783
+ children: /* @__PURE__ */ jsxs(
10784
+ "div",
10785
+ {
10786
+ className: "space-y-2 ",
10787
+ onClick: (e) => e.stopPropagation(),
10788
+ children: [
10789
+ /* @__PURE__ */ jsx("p", { className: "font-semibold text-sm", children: format(day, "EEE d", { locale: ptBR }) }),
10790
+ /* @__PURE__ */ jsx("div", { className: "space-y-1", children: sortEventsAgenda(allEvents).map((event) => {
10791
+ const s = getEventStartDate(event) ?? getEventEndDate(event) ?? /* @__PURE__ */ new Date();
10792
+ const e2 = getEventEndDate(event) ?? getEventStartDate(event) ?? /* @__PURE__ */ new Date();
10793
+ return /* @__PURE__ */ jsx(
10794
+ EventItemAgenda,
10795
+ {
10796
+ noTime: true,
10797
+ event,
10798
+ isFirstDay: isSameDay(day, s),
10799
+ isLastDay: isSameDay(day, e2),
10800
+ onClick: (e) => handleEventClick(event, e),
10801
+ view: "month"
10802
+ },
10803
+ event.id
10804
+ );
10805
+ }) })
10806
+ ]
10807
+ }
10808
+ )
10729
10809
  }
10730
10810
  )
10731
10811
  ] })
@@ -10743,7 +10823,8 @@ function MonthViewAgenda({
10743
10823
  weekIndex,
10744
10824
  hoveredEventId,
10745
10825
  onHover: handleHover,
10746
- onEventSelect
10826
+ onEventSelect,
10827
+ noTime
10747
10828
  }
10748
10829
  )
10749
10830
  ]
@@ -10776,6 +10857,7 @@ function DraggableEvent({
10776
10857
  event,
10777
10858
  view,
10778
10859
  showTime,
10860
+ noTime,
10779
10861
  onClick,
10780
10862
  height,
10781
10863
  isMultiDay,
@@ -10869,6 +10951,7 @@ function DraggableEvent({
10869
10951
  onMouseDown: handleMouseDown,
10870
10952
  onTouchStart: handleTouchStart,
10871
10953
  showTime,
10954
+ noTime,
10872
10955
  view,
10873
10956
  totalCols
10874
10957
  }
@@ -10881,7 +10964,8 @@ function WeekViewAgenda({
10881
10964
  events,
10882
10965
  onEventSelect,
10883
10966
  onEventCreate,
10884
- showUndatedEvents
10967
+ showUndatedEvents,
10968
+ noTime = false
10885
10969
  }) {
10886
10970
  const days = useMemo(() => {
10887
10971
  const weekStart = startOfWeek(currentDate, { weekStartsOn: 0 });
@@ -10914,7 +10998,7 @@ function WeekViewAgenda({
10914
10998
  return days.some((day) => {
10915
10999
  if (eventStart && isSameDay(day, eventStart)) return true;
10916
11000
  if (eventEnd && isSameDay(day, eventEnd)) return true;
10917
- if (eventStart && eventEnd && day > eventStart && day < eventEnd)
11001
+ if (eventStart && eventEnd && day > startOfLocalDay(eventStart) && day < startOfLocalDay(eventEnd))
10918
11002
  return true;
10919
11003
  return false;
10920
11004
  });
@@ -10946,7 +11030,7 @@ function WeekViewAgenda({
10946
11030
  if (event.start == null) return false;
10947
11031
  const eventStart = getEventStartDate(event);
10948
11032
  const eventEnd = getEventEndDate(event) ?? getEventStartDate(event);
10949
- return (eventStart ? isSameDay(day, eventStart) : false) || (eventEnd ? isSameDay(day, eventEnd) : false) || (eventStart && eventEnd ? eventStart < day && eventEnd > day : false);
11033
+ return (eventStart ? isSameDay(day, eventStart) : false) || (eventEnd ? isSameDay(day, eventEnd) : false) || (eventStart && eventEnd ? day > startOfLocalDay(eventStart) && day < startOfLocalDay(eventEnd) : false);
10950
11034
  });
10951
11035
  const sortedEvents = [...dayEvents].sort((a, b) => {
10952
11036
  const aStart = getEventStartDate(a) ?? getEventEndDate(a) ?? /* @__PURE__ */ new Date();
@@ -11187,7 +11271,7 @@ function WeekViewAgenda({
11187
11271
  children: /* @__PURE__ */ jsxs("span", { className: "flex items-center gap-1 min-w-0 w-full", children: [
11188
11272
  !isFirstDay && colStart === 0 && /* @__PURE__ */ jsx("span", { className: "shrink-0 text-[11px] font-bold opacity-60", children: /* @__PURE__ */ jsx(CaretLeftIcon$1, {}) }),
11189
11273
  showTitle && /* @__PURE__ */ jsxs(Fragment, { children: [
11190
- isFirstDay && /* @__PURE__ */ jsx("span", { className: "font-normal opacity-80 text-[10px] sm:text-[11px] bg-white/10 px-1 py-0.5 rounded-full", children: format(eventStart, "HH:mm") }),
11274
+ isFirstDay && !noTime && /* @__PURE__ */ jsx("span", { className: "font-normal opacity-80 text-[10px] sm:text-[11px] bg-white/10 px-1 py-0.5 rounded-full", children: format(eventStart, "HH:mm") }),
11191
11275
  /* @__PURE__ */ jsx("span", { className: "truncate text-xs font-medium", children: event.title }),
11192
11276
  isFirstDay && (() => {
11193
11277
  const evStart = getEventStartDate(event);
@@ -11265,6 +11349,7 @@ function WeekViewAgenda({
11265
11349
  onClick: (e) => handleEventClick(positionedEvent.event, e),
11266
11350
  draggable: false,
11267
11351
  showTime: true,
11352
+ noTime,
11268
11353
  view: "week",
11269
11354
  totalCols: positionedEvent.totalCols
11270
11355
  }
@@ -11468,7 +11553,8 @@ function capitalize(s) {
11468
11553
  }
11469
11554
  function EventDetailModalAgenda({
11470
11555
  event,
11471
- onClose
11556
+ onClose,
11557
+ noTime = false
11472
11558
  }) {
11473
11559
  const [open, setOpen] = useState(true);
11474
11560
  if (!event) return null;
@@ -11533,7 +11619,7 @@ function EventDetailModalAgenda({
11533
11619
  ] }) : isMultiDay ? /* @__PURE__ */ jsxs(Badge, { className: "bg-black/20 text-white border border-white/20 backdrop-blur-sm shadow-none gap-1 text-[11px] font-medium", children: [
11534
11620
  /* @__PURE__ */ jsx(CalendarDotsIcon, { size: 11, weight: "bold" }),
11535
11621
  formatDurationAgendaDays(event)
11536
- ] }) : durationMinutes > 0 ? /* @__PURE__ */ jsxs(Badge, { className: "bg-black/20 text-white border border-white/20 backdrop-blur-sm shadow-none gap-1 text-[11px] font-medium", children: [
11622
+ ] }) : !noTime && durationMinutes > 0 ? /* @__PURE__ */ jsxs(Badge, { className: "bg-black/20 text-white border border-white/20 backdrop-blur-sm shadow-none gap-1 text-[11px] font-medium", children: [
11537
11623
  /* @__PURE__ */ jsx(ClockIcon, { size: 11, weight: "bold" }),
11538
11624
  formatDuration(durationMinutes)
11539
11625
  ] }) : null }),
@@ -11543,11 +11629,24 @@ function EventDetailModalAgenda({
11543
11629
  ),
11544
11630
  /* @__PURE__ */ jsxs("div", { className: "flex flex-col px-7 py-6 bg-background", children: [
11545
11631
  /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-4 py-4", children: [
11546
- /* @__PURE__ */ jsx("div", { className: "mt-0.5 p-2 rounded-xl bg-muted border border-border shrink-0", children: /* @__PURE__ */ jsx(CalendarDotsIcon, { size: 18, weight: "duotone", className: "text-primary" }) }),
11632
+ /* @__PURE__ */ jsx("div", { className: "mt-0.5 p-2 rounded-xl bg-muted border border-border shrink-0", children: /* @__PURE__ */ jsx(
11633
+ CalendarDotsIcon,
11634
+ {
11635
+ size: 18,
11636
+ weight: "duotone",
11637
+ className: "text-primary"
11638
+ }
11639
+ ) }),
11547
11640
  /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-0.5 min-w-0", children: [
11548
11641
  /* @__PURE__ */ jsx("span", { className: "text-[13px] font-semibold text-foreground leading-snug", children: dateSection.primary }),
11549
- dateSection.secondary && /* @__PURE__ */ jsx("div", { className: "flex items-center gap-1.5 mt-0.5", children: isMultiDay && !event.allDay || isMultiDay && dateSection.isAllDay ? /* @__PURE__ */ jsxs(Fragment, { children: [
11550
- /* @__PURE__ */ jsx(ArrowRightIcon$1, { size: 11, className: "shrink-0 text-muted-foreground/60" }),
11642
+ !noTime && dateSection.secondary && /* @__PURE__ */ jsx("div", { className: "flex items-center gap-1.5 mt-0.5", children: isMultiDay && !event.allDay || isMultiDay && dateSection.isAllDay ? /* @__PURE__ */ jsxs(Fragment, { children: [
11643
+ /* @__PURE__ */ jsx(
11644
+ ArrowRightIcon$1,
11645
+ {
11646
+ size: 11,
11647
+ className: "shrink-0 text-muted-foreground/60"
11648
+ }
11649
+ ),
11551
11650
  /* @__PURE__ */ jsx("span", { className: "text-[12px] font-medium text-muted-foreground", children: dateSection.secondary })
11552
11651
  ] }) : /* @__PURE__ */ jsx("span", { className: "text-[12px] font-medium text-muted-foreground", children: dateSection.secondary }) })
11553
11652
  ] })
@@ -11555,7 +11654,14 @@ function EventDetailModalAgenda({
11555
11654
  (event.location || event.description) && /* @__PURE__ */ jsx(SeparatorBase, { className: "opacity-40" }),
11556
11655
  event.location && /* @__PURE__ */ jsxs(Fragment, { children: [
11557
11656
  /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-4 py-4", children: [
11558
- /* @__PURE__ */ jsx("div", { className: "mt-0.5 p-2 rounded-xl bg-muted border border-border shrink-0", children: /* @__PURE__ */ jsx(MapPinIcon, { size: 18, weight: "duotone", className: "text-primary" }) }),
11657
+ /* @__PURE__ */ jsx("div", { className: "mt-0.5 p-2 rounded-xl bg-muted border border-border shrink-0", children: /* @__PURE__ */ jsx(
11658
+ MapPinIcon,
11659
+ {
11660
+ size: 18,
11661
+ weight: "duotone",
11662
+ className: "text-primary"
11663
+ }
11664
+ ) }),
11559
11665
  /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-0.5 min-w-0", children: [
11560
11666
  /* @__PURE__ */ jsx("span", { className: "text-[10px] font-medium uppercase tracking-widest text-muted-foreground/60", children: "Localiza\xE7\xE3o" }),
11561
11667
  /* @__PURE__ */ jsx("span", { className: "text-[13px] font-medium text-foreground leading-snug", children: event.location })
@@ -11564,7 +11670,14 @@ function EventDetailModalAgenda({
11564
11670
  event.description && /* @__PURE__ */ jsx(SeparatorBase, { className: "opacity-40" })
11565
11671
  ] }),
11566
11672
  event.description && /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-4 py-4", children: [
11567
- /* @__PURE__ */ jsx("div", { className: "mt-0.5 p-2 rounded-xl bg-muted border border-border shrink-0", children: /* @__PURE__ */ jsx(AlignLeftIcon, { size: 18, weight: "duotone", className: "text-primary" }) }),
11673
+ /* @__PURE__ */ jsx("div", { className: "mt-0.5 p-2 rounded-xl bg-muted border border-border shrink-0", children: /* @__PURE__ */ jsx(
11674
+ AlignLeftIcon,
11675
+ {
11676
+ size: 18,
11677
+ weight: "duotone",
11678
+ className: "text-primary"
11679
+ }
11680
+ ) }),
11568
11681
  /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-0.5 min-w-0", children: [
11569
11682
  /* @__PURE__ */ jsx("span", { className: "text-[10px] font-medium uppercase tracking-widest text-muted-foreground/60", children: "Descri\xE7\xE3o" }),
11570
11683
  /* @__PURE__ */ jsx("p", { className: "text-[13px] text-muted-foreground leading-relaxed font-normal", children: event.description })
@@ -14608,7 +14721,7 @@ var detectXAxis = (data) => {
14608
14721
  return stringFields[0] || Object.keys(firstItem)[0] || "name";
14609
14722
  };
14610
14723
  var generateAdditionalColors = (baseColors, count) => {
14611
- const hexToRgb = (hex) => {
14724
+ const hexToRgb2 = (hex) => {
14612
14725
  const clean = hex.replace("#", "");
14613
14726
  const bigint = parseInt(
14614
14727
  clean.length === 3 ? clean.split("").map((c) => c + c).join("") : clean,
@@ -14657,7 +14770,7 @@ var generateAdditionalColors = (baseColors, count) => {
14657
14770
  };
14658
14771
  return `#${f(0)}${f(8)}${f(4)}`;
14659
14772
  };
14660
- const anchors = baseColors.map((c) => rgbToHsl(hexToRgb(c)));
14773
+ const anchors = baseColors.map((c) => rgbToHsl(hexToRgb2(c)));
14661
14774
  const colors2 = [...baseColors];
14662
14775
  let i = 0;
14663
14776
  while (colors2.length < count) {
@@ -16528,23 +16641,35 @@ var Name = ({
16528
16641
  ] })
16529
16642
  ] }) });
16530
16643
  };
16531
- var SystemNode = React32__default.forwardRef(({ label }, ref) => {
16532
- const truncated = label.length > 9 ? label.substring(0, 9) + "\u2026" : label;
16533
- const needsTooltip = label.length > 9;
16534
- const circle = /* @__PURE__ */ jsx(
16535
- "div",
16536
- {
16537
- ref,
16538
- className: "w-[76px] h-[76px] rounded-full bg-primary flex items-center justify-center shrink-0 z-10 cursor-default",
16539
- children: /* @__PURE__ */ jsx("span", { className: "text-[10px] font-bold text-primary-foreground text-center px-2 leading-tight select-none", children: truncated })
16540
- }
16541
- );
16542
- if (!needsTooltip) return circle;
16543
- return /* @__PURE__ */ jsx(TooltipProviderBase, { children: /* @__PURE__ */ jsxs(TooltipBase, { children: [
16544
- /* @__PURE__ */ jsx(TooltipTriggerBase, { asChild: true, children: circle }),
16545
- /* @__PURE__ */ jsx(TooltipContentBase, { sideOffset: 8, className: "z-[10001]", children: label })
16546
- ] }) });
16547
- });
16644
+ var SystemNode = React32__default.forwardRef(
16645
+ ({ label }, ref) => {
16646
+ const innerRef = useRef(null);
16647
+ const truncated = label.length > 9 ? label.substring(0, 9) + "\u2026" : label;
16648
+ const needsTooltip = label.length > 9;
16649
+ const setRefs = useCallback(
16650
+ (node) => {
16651
+ innerRef.current = node;
16652
+ if (typeof ref === "function") ref(node);
16653
+ else if (ref)
16654
+ ref.current = node;
16655
+ },
16656
+ [ref]
16657
+ );
16658
+ const circle = /* @__PURE__ */ jsx(
16659
+ "div",
16660
+ {
16661
+ ref: setRefs,
16662
+ className: "w-[76px] h-[76px] rounded-full bg-primary flex items-center justify-center shrink-0 z-10 cursor-default",
16663
+ children: /* @__PURE__ */ jsx("span", { className: "text-[10px] font-bold text-primary-foreground text-center px-2 leading-tight select-none", children: truncated })
16664
+ }
16665
+ );
16666
+ if (!needsTooltip) return circle;
16667
+ return /* @__PURE__ */ jsx(TooltipProviderBase, { children: /* @__PURE__ */ jsxs(TooltipBase, { children: [
16668
+ /* @__PURE__ */ jsx(TooltipTriggerBase, { asChild: true, children: circle }),
16669
+ /* @__PURE__ */ jsx(TooltipContentBase, { sideOffset: 8, className: "z-[10001]", children: label })
16670
+ ] }) });
16671
+ }
16672
+ );
16548
16673
  SystemNode.displayName = "SystemNode";
16549
16674
  var Beam = ({ isInput, containerRef, leftRef, rightRef }) => {
16550
16675
  const gradientId = useId();
@@ -16605,7 +16730,7 @@ var Beam = ({ isInput, containerRef, leftRef, rightRef }) => {
16605
16730
  return /* @__PURE__ */ jsxs(
16606
16731
  "svg",
16607
16732
  {
16608
- className: "pointer-events-none absolute left-0 top-0 right-0",
16733
+ className: "pointer-events-none absolute",
16609
16734
  width: svgSize.w,
16610
16735
  height: svgSize.h,
16611
16736
  fill: "none",
@@ -16625,7 +16750,7 @@ var Beam = ({ isInput, containerRef, leftRef, rightRef }) => {
16625
16750
  {
16626
16751
  d: pathD,
16627
16752
  stroke: `url(#${gradientId})`,
16628
- strokeWidth: 2,
16753
+ strokeWidth: 4,
16629
16754
  strokeLinecap: "round",
16630
16755
  initial: { strokeOpacity: 0 },
16631
16756
  animate: { strokeOpacity: 1 },
@@ -16645,7 +16770,7 @@ var Beam = ({ isInput, containerRef, leftRef, rightRef }) => {
16645
16770
  y2: ["0%", "0%"]
16646
16771
  },
16647
16772
  transition: {
16648
- duration: 4,
16773
+ duration: 2,
16649
16774
  ease: [0.16, 1, 0.3, 1],
16650
16775
  repeat: Infinity,
16651
16776
  repeatDelay: 0
@@ -16670,10 +16795,22 @@ var SystemsDiagram = ({ isInput, currentSystem, externalSystem }) => {
16670
16795
  "div",
16671
16796
  {
16672
16797
  ref: containerRef,
16673
- className: "relative flex items-center justify-between py-1 px-6 max-w-xs",
16798
+ className: "relative flex items-center justify-between py-1",
16674
16799
  children: [
16675
- /* @__PURE__ */ jsx(SystemNode, { ref: leftRef, label: isInput ? externalSystem : currentSystem }),
16676
- /* @__PURE__ */ jsx(SystemNode, { ref: rightRef, label: isInput ? currentSystem : externalSystem }),
16800
+ /* @__PURE__ */ jsx(
16801
+ SystemNode,
16802
+ {
16803
+ ref: leftRef,
16804
+ label: isInput ? externalSystem : currentSystem
16805
+ }
16806
+ ),
16807
+ /* @__PURE__ */ jsx(
16808
+ SystemNode,
16809
+ {
16810
+ ref: rightRef,
16811
+ label: isInput ? currentSystem : externalSystem
16812
+ }
16813
+ ),
16677
16814
  /* @__PURE__ */ jsx(
16678
16815
  Beam,
16679
16816
  {
@@ -16687,12 +16824,11 @@ var SystemsDiagram = ({ isInput, currentSystem, externalSystem }) => {
16687
16824
  }
16688
16825
  );
16689
16826
  };
16690
- var BodyComponent = ({ data, isLoading, connections, isInput, externalSystem }) => /* @__PURE__ */ jsxs("div", { className: "px-3 py-3 space-y-3 max-w-xs 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: [
16827
+ 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: [
16691
16828
  isLoading ? /* @__PURE__ */ jsxs("div", { className: "space-y-1.5", children: [
16692
16829
  /* @__PURE__ */ jsx(SkeletonBase, { className: "h-6 w-3/4" }),
16693
16830
  /* @__PURE__ */ jsx(SkeletonBase, { className: "h-3.5 w-1/2" })
16694
16831
  ] }) : /* @__PURE__ */ jsx(Name, { name: data.name, description: data.description }),
16695
- /* @__PURE__ */ jsx("div", { className: "border-t border-border/20" }),
16696
16832
  isLoading ? /* @__PURE__ */ jsxs("div", { className: "space-y-3", children: [
16697
16833
  /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between py-1", children: [
16698
16834
  /* @__PURE__ */ jsx(SkeletonBase, { className: "w-[76px] h-[76px] rounded-full" }),
@@ -16719,7 +16855,6 @@ var BodyComponent = ({ data, isLoading, connections, isInput, externalSystem })
16719
16855
  externalSystem
16720
16856
  }
16721
16857
  ),
16722
- /* @__PURE__ */ jsx("div", { className: "border-t border-border/20" }),
16723
16858
  /* @__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" }) }),
16724
16859
  /* @__PURE__ */ jsx("div", { children: connections.map((conn) => /* @__PURE__ */ jsx(
16725
16860
  IntegrationCard,
@@ -16731,268 +16866,7 @@ var BodyComponent = ({ data, isLoading, connections, isInput, externalSystem })
16731
16866
  )) })
16732
16867
  ] })
16733
16868
  ] });
16734
- var Body = React32__default.memo(BodyComponent);
16735
- var modalVariants = {
16736
- hidden: {
16737
- opacity: 0,
16738
- scale: 0.96,
16739
- transition: { type: "spring", stiffness: 400, damping: 28 }
16740
- },
16741
- visible: {
16742
- opacity: 1,
16743
- scale: 1,
16744
- transition: { type: "spring", stiffness: 300, damping: 28 }
16745
- },
16746
- exit: {
16747
- opacity: 0,
16748
- scale: 0.96,
16749
- transition: { type: "spring", stiffness: 400, damping: 28 }
16750
- }
16751
- };
16752
- var IntegrationModal = ({
16753
- id,
16754
- data,
16755
- position,
16756
- title = "Conex\xF5es",
16757
- isLoading = false,
16758
- systemName,
16759
- onMouseDown,
16760
- onClose,
16761
- onPositionChange
16762
- }) => {
16763
- const isMobile = useIsMobile();
16764
- const [localPos, setLocalPos] = useState(position);
16765
- const [dragging, setDragging] = useState(false);
16766
- const offsetRef = useRef({ x: 0, y: 0 });
16767
- const lastMouse = useRef({ x: 0, y: 0 });
16768
- const tooltipRef = useRef(null);
16769
- const currentPosRef = useRef(position);
16770
- useEffect(() => {
16771
- currentPosRef.current = position;
16772
- setLocalPos(position);
16773
- }, [position]);
16774
- useEffect(() => {
16775
- let rafId = null;
16776
- const handleMouseMove = (e) => {
16777
- if (!dragging) return;
16778
- lastMouse.current = { x: e.clientX, y: e.clientY };
16779
- if (rafId) cancelAnimationFrame(rafId);
16780
- rafId = requestAnimationFrame(() => {
16781
- const newLeft = lastMouse.current.x - offsetRef.current.x;
16782
- const newTop = lastMouse.current.y - offsetRef.current.y;
16783
- const p = {
16784
- top: Math.max(0, Math.min(newTop, window.innerHeight - 200)),
16785
- left: Math.max(0, Math.min(newLeft, window.innerWidth - 320))
16786
- };
16787
- currentPosRef.current = p;
16788
- if (tooltipRef.current) {
16789
- tooltipRef.current.style.top = `${p.top}px`;
16790
- tooltipRef.current.style.left = `${p.left}px`;
16791
- }
16792
- onPositionChange?.(id, p);
16793
- });
16794
- };
16795
- const handleMouseUp = () => {
16796
- if (dragging) {
16797
- setDragging(false);
16798
- setLocalPos(currentPosRef.current);
16799
- if (rafId) cancelAnimationFrame(rafId);
16800
- }
16801
- };
16802
- if (dragging) {
16803
- document.addEventListener("mousemove", handleMouseMove, { passive: true });
16804
- document.addEventListener("mouseup", handleMouseUp);
16805
- document.body.style.cursor = "grabbing";
16806
- document.body.style.userSelect = "none";
16807
- }
16808
- return () => {
16809
- if (rafId) cancelAnimationFrame(rafId);
16810
- document.removeEventListener("mousemove", handleMouseMove);
16811
- document.removeEventListener("mouseup", handleMouseUp);
16812
- document.body.style.cursor = "";
16813
- document.body.style.userSelect = "";
16814
- };
16815
- }, [dragging, id, onPositionChange]);
16816
- const handleMouseDownLocal = useCallback(
16817
- (e) => {
16818
- e.preventDefault();
16819
- e.stopPropagation();
16820
- const rect = e.currentTarget.closest(".fixed")?.getBoundingClientRect();
16821
- if (!rect) return;
16822
- offsetRef.current = { x: e.clientX - rect.left, y: e.clientY - rect.top };
16823
- setDragging(true);
16824
- onMouseDown?.(id, e);
16825
- },
16826
- [id, onMouseDown]
16827
- );
16828
- const handleTouchStartLocal = useCallback(
16829
- (e) => {
16830
- e.stopPropagation();
16831
- const touch = e.touches[0];
16832
- if (!touch) return;
16833
- const rect = e.currentTarget.closest(".fixed")?.getBoundingClientRect();
16834
- if (!rect) return;
16835
- offsetRef.current = {
16836
- x: touch.clientX - rect.left,
16837
- y: touch.clientY - rect.top
16838
- };
16839
- setDragging(true);
16840
- onMouseDown?.(id, e);
16841
- },
16842
- [id, onMouseDown]
16843
- );
16844
- const inputConnections = useMemo(
16845
- () => data.connections.filter((c) => c.type === "entrada"),
16846
- [data.connections]
16847
- );
16848
- const outputConnections = useMemo(
16849
- () => data.connections.filter((c) => c.type === "saida"),
16850
- [data.connections]
16851
- );
16852
- const isInput = inputConnections.length > 0;
16853
- const connections = isInput ? inputConnections : outputConnections;
16854
- const externalSystem = systemName ?? connections[0]?.name ?? "Sistema";
16855
- const header = /* @__PURE__ */ jsxs(
16856
- "div",
16857
- {
16858
- className: "flex items-center justify-between py-1 border-b border-border/10 bg-muted/30 shrink-0 max-w-lg",
16859
- onMouseDown: handleMouseDownLocal,
16860
- onTouchStart: handleTouchStartLocal,
16861
- style: {
16862
- touchAction: "none",
16863
- cursor: dragging ? "grabbing" : "grab"
16864
- },
16865
- children: [
16866
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 px-3", children: [
16867
- /* @__PURE__ */ jsx(DotsSixVerticalIcon, { size: 16, className: "text-primary" }),
16868
- /* @__PURE__ */ jsx("span", { className: "text-xs font-semibold text-muted-foreground uppercase tracking-wider", children: title })
16869
- ] }),
16870
- /* @__PURE__ */ jsx(
16871
- ButtonBase,
16872
- {
16873
- variant: "ghost",
16874
- size: "icon",
16875
- onClick: () => onClose(id),
16876
- className: "text-muted-foreground hover:text-destructive transition-colors hover:bg-destructive/10 mr-1",
16877
- style: { cursor: "pointer" },
16878
- children: /* @__PURE__ */ jsx(XIcon, { size: 16 })
16879
- }
16880
- )
16881
- ]
16882
- }
16883
- );
16884
- const bodyProps = { data, isLoading, connections, isInput, externalSystem };
16885
- if (isMobile) {
16886
- return /* @__PURE__ */ jsx(AnimatePresence, { children: /* @__PURE__ */ jsxs(Fragment, { children: [
16887
- /* @__PURE__ */ jsx(
16888
- motion.div,
16889
- {
16890
- className: "fixed inset-0 z-[9999] bg-black/40 backdrop-blur-[2px]",
16891
- initial: { opacity: 0 },
16892
- animate: { opacity: 1 },
16893
- exit: { opacity: 0 },
16894
- onClick: () => onClose(id)
16895
- },
16896
- `overlay-${id}`
16897
- ),
16898
- /* @__PURE__ */ jsxs(
16899
- motion.div,
16900
- {
16901
- 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",
16902
- style: { maxHeight: "85dvh" },
16903
- initial: { y: "100%" },
16904
- animate: { y: 0 },
16905
- exit: { y: "100%" },
16906
- transition: { type: "spring", stiffness: 320, damping: 36 },
16907
- onClick: (e) => e.stopPropagation(),
16908
- children: [
16909
- /* @__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" }) }),
16910
- header,
16911
- /* @__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 }) })
16912
- ]
16913
- },
16914
- `sheet-${id}`
16915
- )
16916
- ] }) });
16917
- }
16918
- return /* @__PURE__ */ jsx(AnimatePresence, { children: /* @__PURE__ */ jsxs(
16919
- motion.div,
16920
- {
16921
- ref: tooltipRef,
16922
- className: "fixed bg-card/95 backdrop-blur-md border border-border/50 rounded-lg shadow-2xl z-[10000] w-[calc(100vw-32px)] max-w-sm sm:w-80 overflow-hidden",
16923
- variants: modalVariants,
16924
- initial: "hidden",
16925
- animate: "visible",
16926
- exit: "exit",
16927
- style: { top: localPos.top, left: localPos.left },
16928
- onClick: (e) => e.stopPropagation(),
16929
- children: [
16930
- header,
16931
- /* @__PURE__ */ jsx(Body, { ...bodyProps })
16932
- ]
16933
- },
16934
- id
16935
- ) });
16936
- };
16937
- var IntegrationModal_default = IntegrationModal;
16938
-
16939
- // src/components/ui/charts/components/tooltips/utils/integrationTooltipUtils.ts
16940
- function processIntegrationData(integrations, targetSystemName) {
16941
- const connections = [];
16942
- integrations.forEach((integration) => {
16943
- const origemNome = integration.origem.properties.nome;
16944
- const destinoNome = integration.destino.properties.nome;
16945
- if (origemNome === targetSystemName) {
16946
- connections.push({
16947
- id: integration.r.elementId,
16948
- name: destinoNome,
16949
- type: "saida",
16950
- integration: integration.r.properties
16951
- });
16952
- }
16953
- if (destinoNome === targetSystemName) {
16954
- connections.push({
16955
- id: integration.r.elementId,
16956
- name: origemNome,
16957
- type: "entrada",
16958
- integration: integration.r.properties
16959
- });
16960
- }
16961
- });
16962
- return {
16963
- name: targetSystemName,
16964
- connections
16965
- };
16966
- }
16967
-
16968
- // src/components/ui/charts/components/tooltips/utils/systemTooltipUtils.ts
16969
- function processNeo4jData(integrations, targetSystemName) {
16970
- const connections = [];
16971
- integrations.forEach((integration) => {
16972
- const origemNome = integration.origem.properties.nome;
16973
- const destinoNome = integration.destino.properties.nome;
16974
- if (origemNome === targetSystemName) {
16975
- connections.push({
16976
- id: integration.r.elementId,
16977
- name: destinoNome,
16978
- type: "saida",
16979
- integration: integration.r.properties
16980
- });
16981
- }
16982
- if (destinoNome === targetSystemName) {
16983
- connections.push({
16984
- id: integration.r.elementId,
16985
- name: origemNome,
16986
- type: "entrada",
16987
- integration: integration.r.properties
16988
- });
16989
- }
16990
- });
16991
- return {
16992
- name: targetSystemName,
16993
- connections
16994
- };
16995
- }
16869
+ React32__default.memo(BodyComponent);
16996
16870
  var Brush = ({
16997
16871
  data,
16998
16872
  legend,
@@ -19622,6 +19496,35 @@ var TimeSeries = ({
19622
19496
  ) });
19623
19497
  };
19624
19498
  var TimeSeries_default = TimeSeries;
19499
+
19500
+ // src/components/ui/charts/components/tooltips/utils/systemTooltipUtils.ts
19501
+ function processNeo4jData(integrations, targetSystemName) {
19502
+ const connections = [];
19503
+ integrations.forEach((integration) => {
19504
+ const origemNome = integration.origem.properties.nome;
19505
+ const destinoNome = integration.destino.properties.nome;
19506
+ if (origemNome === targetSystemName) {
19507
+ connections.push({
19508
+ id: integration.r.elementId,
19509
+ name: destinoNome,
19510
+ type: "saida",
19511
+ integration: integration.r.properties
19512
+ });
19513
+ }
19514
+ if (destinoNome === targetSystemName) {
19515
+ connections.push({
19516
+ id: integration.r.elementId,
19517
+ name: origemNome,
19518
+ type: "entrada",
19519
+ integration: integration.r.properties
19520
+ });
19521
+ }
19522
+ });
19523
+ return {
19524
+ name: targetSystemName,
19525
+ connections
19526
+ };
19527
+ }
19625
19528
  function NumericInput({
19626
19529
  value,
19627
19530
  onChange,
@@ -19713,6 +19616,378 @@ function NumericInput({
19713
19616
  ] })
19714
19617
  ] });
19715
19618
  }
19619
+ function hexToRgb(hex) {
19620
+ const clean = hex.replace("#", "");
19621
+ if (clean.length !== 6) return null;
19622
+ const num = parseInt(clean, 16);
19623
+ return { r: num >> 16 & 255, g: num >> 8 & 255, b: num & 255 };
19624
+ }
19625
+ function isValidHex(hex) {
19626
+ return /^#[0-9A-Fa-f]{6}$/.test(hex);
19627
+ }
19628
+ var DEFAULT_SWATCHES = [
19629
+ "#000000",
19630
+ "#ffffff",
19631
+ "#6B7280",
19632
+ "#EF4444",
19633
+ "#F97316",
19634
+ "#F59E0B",
19635
+ "#84CC16",
19636
+ "#22C55E",
19637
+ "#14B8A6",
19638
+ "#06B6D4",
19639
+ "#3B82F6",
19640
+ "#8B5CF6",
19641
+ "#EC4899",
19642
+ "#F43F5E",
19643
+ "#D97706",
19644
+ "#0EA5E9"
19645
+ ];
19646
+ var ColorPickerBase = React32.forwardRef(
19647
+ ({
19648
+ value = "#3B82F6",
19649
+ onChange,
19650
+ opacity = 1,
19651
+ onOpacityChange,
19652
+ swatches = DEFAULT_SWATCHES,
19653
+ label,
19654
+ error,
19655
+ disabled = false,
19656
+ className,
19657
+ "data-testid": dataTestId = "color-picker-base"
19658
+ }, ref) => {
19659
+ const [hexInput, setHexInput] = React32.useState(value.toUpperCase());
19660
+ React32.useEffect(() => {
19661
+ setHexInput(value.toUpperCase());
19662
+ }, [value]);
19663
+ const rgb = hexToRgb(value) ?? { r: 59, g: 130, b: 246 };
19664
+ const rgbString = `rgb(${rgb.r}, ${rgb.g}, ${rgb.b})`;
19665
+ const opacityPercent = Math.round(opacity * 100);
19666
+ const handleNativeChange = (e) => {
19667
+ onChange?.(e.target.value.toUpperCase());
19668
+ };
19669
+ const handleHexInput = (e) => {
19670
+ const raw = e.target.value;
19671
+ setHexInput(raw.toUpperCase());
19672
+ const withHash = raw.startsWith("#") ? raw : `#${raw}`;
19673
+ if (isValidHex(withHash)) onChange?.(withHash.toUpperCase());
19674
+ };
19675
+ const handleHexBlur = () => {
19676
+ const withHash = hexInput.startsWith("#") ? hexInput : `#${hexInput}`;
19677
+ if (!isValidHex(withHash)) setHexInput(value.toUpperCase());
19678
+ };
19679
+ return /* @__PURE__ */ jsxs(
19680
+ "div",
19681
+ {
19682
+ ref,
19683
+ className: cn("flex flex-col w-full min-w-[150px]", className),
19684
+ "data-testid": dataTestId,
19685
+ children: [
19686
+ label && /* @__PURE__ */ jsx(LabelBase_default, { className: "mb-1", children: label }),
19687
+ /* @__PURE__ */ jsxs(PopoverBase, { children: [
19688
+ /* @__PURE__ */ jsx(PopoverTriggerBase, { asChild: true, disabled, children: /* @__PURE__ */ jsxs(
19689
+ ButtonBase,
19690
+ {
19691
+ variant: "outline",
19692
+ size: "select",
19693
+ disabled,
19694
+ "data-testid": `${dataTestId}-trigger`,
19695
+ className: cn(
19696
+ "w-full justify-start font-normal",
19697
+ error && "border-destructive"
19698
+ ),
19699
+ children: [
19700
+ /* @__PURE__ */ jsx(
19701
+ "span",
19702
+ {
19703
+ className: "inline-block size-4 rounded-sm border border-border shrink-0",
19704
+ style: {
19705
+ backgroundColor: `rgba(${rgb.r}, ${rgb.g}, ${rgb.b}, ${opacity})`
19706
+ }
19707
+ }
19708
+ ),
19709
+ /* @__PURE__ */ jsx("span", { className: "font-mono text-xs tracking-wide", children: value.toUpperCase() }),
19710
+ onOpacityChange && /* @__PURE__ */ jsxs("span", { className: "ml-auto text-muted-foreground text-xs", children: [
19711
+ opacityPercent,
19712
+ "%"
19713
+ ] })
19714
+ ]
19715
+ }
19716
+ ) }),
19717
+ /* @__PURE__ */ jsxs(
19718
+ PopoverContentBase,
19719
+ {
19720
+ className: "w-64 p-3 flex flex-col gap-3",
19721
+ align: "start",
19722
+ children: [
19723
+ /* @__PURE__ */ jsx("div", { className: "grid grid-cols-8 gap-1", children: swatches.map((swatch) => /* @__PURE__ */ jsx(
19724
+ "button",
19725
+ {
19726
+ type: "button",
19727
+ title: swatch,
19728
+ "data-testid": `${dataTestId}-swatch`,
19729
+ onClick: () => onChange?.(swatch),
19730
+ className: cn(
19731
+ "size-6 rounded-md border transition hover:scale-110 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
19732
+ value.toUpperCase() === swatch.toUpperCase() ? "border-ring ring-2 ring-ring/50 scale-110" : "border-border"
19733
+ ),
19734
+ style: { backgroundColor: swatch }
19735
+ },
19736
+ swatch
19737
+ )) }),
19738
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
19739
+ /* @__PURE__ */ jsxs("div", { className: "relative size-9 shrink-0 rounded-md border border-border overflow-hidden cursor-pointer", children: [
19740
+ /* @__PURE__ */ jsx(
19741
+ "input",
19742
+ {
19743
+ type: "color",
19744
+ value,
19745
+ onChange: handleNativeChange,
19746
+ "data-testid": `${dataTestId}-native`,
19747
+ className: "absolute inset-0 w-full h-full opacity-0 cursor-pointer"
19748
+ }
19749
+ ),
19750
+ /* @__PURE__ */ jsx(
19751
+ "span",
19752
+ {
19753
+ className: "absolute inset-0 rounded-md pointer-events-none",
19754
+ style: { backgroundColor: rgbString }
19755
+ }
19756
+ )
19757
+ ] }),
19758
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1 flex-1 rounded-md border border-input bg-background h-9 px-2", children: [
19759
+ /* @__PURE__ */ jsx("span", { className: "text-muted-foreground text-xs font-mono", children: "#" }),
19760
+ /* @__PURE__ */ jsx(
19761
+ "input",
19762
+ {
19763
+ type: "text",
19764
+ maxLength: 6,
19765
+ value: hexInput.startsWith("#") ? hexInput.slice(1) : hexInput,
19766
+ onChange: handleHexInput,
19767
+ onBlur: handleHexBlur,
19768
+ "data-testid": `${dataTestId}-hex-input`,
19769
+ className: "flex-1 bg-transparent text-xs font-mono text-foreground focus:outline-none uppercase tracking-widest placeholder:text-muted-foreground",
19770
+ placeholder: "RRGGBB"
19771
+ }
19772
+ )
19773
+ ] })
19774
+ ] }),
19775
+ onOpacityChange && /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1", children: [
19776
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
19777
+ /* @__PURE__ */ jsx("span", { className: "text-xs text-muted-foreground", children: "Opacidade" }),
19778
+ /* @__PURE__ */ jsxs("span", { className: "text-xs font-mono text-foreground", children: [
19779
+ opacityPercent,
19780
+ "%"
19781
+ ] })
19782
+ ] }),
19783
+ /* @__PURE__ */ jsxs("div", { className: "relative", children: [
19784
+ /* @__PURE__ */ jsx(
19785
+ "div",
19786
+ {
19787
+ className: "absolute inset-y-0 left-0 right-0 my-auto h-1.5 rounded-full pointer-events-none",
19788
+ style: {
19789
+ backgroundImage: "repeating-conic-gradient(#ccc 0% 25%, #fff 0% 50%)",
19790
+ backgroundSize: "8px 8px"
19791
+ }
19792
+ }
19793
+ ),
19794
+ /* @__PURE__ */ jsx(
19795
+ "div",
19796
+ {
19797
+ className: "absolute inset-y-0 left-0 right-0 my-auto h-1.5 rounded-full pointer-events-none",
19798
+ style: {
19799
+ background: `linear-gradient(to right, transparent, ${rgbString})`
19800
+ }
19801
+ }
19802
+ ),
19803
+ /* @__PURE__ */ jsx(
19804
+ SlideBase,
19805
+ {
19806
+ min: 0,
19807
+ max: 100,
19808
+ step: 1,
19809
+ value: [opacityPercent],
19810
+ onValueChange: ([val]) => onOpacityChange(val / 100),
19811
+ "data-testid": `${dataTestId}-opacity`,
19812
+ className: "relative"
19813
+ }
19814
+ )
19815
+ ] })
19816
+ ] })
19817
+ ]
19818
+ }
19819
+ )
19820
+ ] }),
19821
+ /* @__PURE__ */ jsx(ErrorMessage, { error })
19822
+ ]
19823
+ }
19824
+ );
19825
+ }
19826
+ );
19827
+ ColorPickerBase.displayName = "ColorPickerBase";
19828
+ var TagChip = ({
19829
+ label,
19830
+ onRemove,
19831
+ disabled,
19832
+ testid
19833
+ }) => /* @__PURE__ */ jsxs(
19834
+ "span",
19835
+ {
19836
+ className: cn(
19837
+ "inline-flex items-center gap-1 rounded-md px-2 py-0.5 text-xs font-medium",
19838
+ "bg-primary/10 text-primary border border-primary/20",
19839
+ "transition-colors"
19840
+ ),
19841
+ "data-testid": testid,
19842
+ children: [
19843
+ label,
19844
+ !disabled && /* @__PURE__ */ jsx(
19845
+ "button",
19846
+ {
19847
+ type: "button",
19848
+ onClick: onRemove,
19849
+ "data-testid": `${testid}-remove`,
19850
+ "aria-label": `Remover ${label}`,
19851
+ className: cn(
19852
+ "inline-flex items-center justify-center rounded-full size-3.5",
19853
+ "hover:bg-primary/20 text-primary/70 hover:text-primary",
19854
+ "focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-primary",
19855
+ "transition-colors"
19856
+ ),
19857
+ children: /* @__PURE__ */ jsx(XIcon, { weight: "bold", className: "size-2.5" })
19858
+ }
19859
+ )
19860
+ ]
19861
+ }
19862
+ );
19863
+ var TagInput = React32.forwardRef(
19864
+ ({
19865
+ tags = [],
19866
+ onTagsChange,
19867
+ maxTags,
19868
+ allowDuplicates = false,
19869
+ separators = [","],
19870
+ label,
19871
+ error,
19872
+ disabled = false,
19873
+ placeholder = "Digite e pressione Enter...",
19874
+ className,
19875
+ "data-testid": dataTestId = "tag-input",
19876
+ onKeyDown,
19877
+ onBlur,
19878
+ ...props
19879
+ }, ref) => {
19880
+ const [inputValue, setInputValue] = React32.useState("");
19881
+ const isMaxReached = maxTags !== void 0 && tags.length >= maxTags;
19882
+ const addTag = (raw) => {
19883
+ const trimmed = raw.trim();
19884
+ if (!trimmed) return;
19885
+ if (!allowDuplicates && tags.includes(trimmed)) {
19886
+ setInputValue("");
19887
+ return;
19888
+ }
19889
+ if (isMaxReached) return;
19890
+ onTagsChange?.([...tags, trimmed]);
19891
+ setInputValue("");
19892
+ };
19893
+ const removeTag = (index) => {
19894
+ onTagsChange?.(tags.filter((_, i) => i !== index));
19895
+ };
19896
+ const handleKeyDown = (e) => {
19897
+ onKeyDown?.(e);
19898
+ if (e.key === "Enter") {
19899
+ e.preventDefault();
19900
+ addTag(inputValue);
19901
+ return;
19902
+ }
19903
+ if (e.key === "Backspace" && inputValue === "" && tags.length > 0) {
19904
+ removeTag(tags.length - 1);
19905
+ return;
19906
+ }
19907
+ if (separators.includes(e.key)) {
19908
+ e.preventDefault();
19909
+ addTag(inputValue);
19910
+ }
19911
+ };
19912
+ const handleBlur = (e) => {
19913
+ onBlur?.(e);
19914
+ if (inputValue.trim()) {
19915
+ addTag(inputValue);
19916
+ }
19917
+ };
19918
+ const handleChange = (e) => {
19919
+ const val = e.target.value;
19920
+ const hasSeparator = separators.some((sep) => val.includes(sep));
19921
+ if (hasSeparator) {
19922
+ const parts = val.split(new RegExp(`[${separators.join("")}]`));
19923
+ parts.slice(0, -1).forEach((part) => addTag(part));
19924
+ setInputValue(parts[parts.length - 1]);
19925
+ } else {
19926
+ setInputValue(val);
19927
+ }
19928
+ };
19929
+ return /* @__PURE__ */ jsxs(
19930
+ "div",
19931
+ {
19932
+ className: cn("flex flex-col w-full min-w-[150px]"),
19933
+ "data-testid": dataTestId,
19934
+ children: [
19935
+ label && /* @__PURE__ */ jsx(LabelBase_default, { className: "mb-1", children: label }),
19936
+ /* @__PURE__ */ jsxs(
19937
+ "div",
19938
+ {
19939
+ className: cn(
19940
+ "flex flex-wrap items-center gap-1.5 min-h-9 rounded-md border bg-background px-2 py-1.5 transition",
19941
+ error ? "border-destructive focus-within:ring-1 focus-within:ring-destructive" : "border-input focus-within:ring-2 focus-within:ring-ring/50 focus-within:border-ring",
19942
+ disabled && "opacity-50 pointer-events-none",
19943
+ className
19944
+ ),
19945
+ children: [
19946
+ tags.map((tag, i) => /* @__PURE__ */ jsx(
19947
+ TagChip,
19948
+ {
19949
+ label: tag,
19950
+ disabled,
19951
+ onRemove: () => removeTag(i),
19952
+ testid: `${dataTestId}-tag-${i}`
19953
+ },
19954
+ `${tag}-${i}`
19955
+ )),
19956
+ !isMaxReached && /* @__PURE__ */ jsx(
19957
+ "input",
19958
+ {
19959
+ ref,
19960
+ type: "text",
19961
+ value: inputValue,
19962
+ onChange: handleChange,
19963
+ onKeyDown: handleKeyDown,
19964
+ onBlur: handleBlur,
19965
+ disabled,
19966
+ placeholder: tags.length === 0 ? placeholder : "",
19967
+ "data-testid": `${dataTestId}-input`,
19968
+ className: cn(
19969
+ "flex-1 min-w-[120px] bg-transparent text-sm text-foreground",
19970
+ "placeholder:text-muted-foreground focus:outline-none",
19971
+ "disabled:cursor-not-allowed"
19972
+ ),
19973
+ ...props
19974
+ }
19975
+ ),
19976
+ isMaxReached && tags.length > 0 && /* @__PURE__ */ jsxs("span", { className: "text-xs text-muted-foreground ml-1", children: [
19977
+ "M\xE1x. ",
19978
+ maxTags,
19979
+ " tags"
19980
+ ] })
19981
+ ]
19982
+ }
19983
+ ),
19984
+ /* @__PURE__ */ jsx(ErrorMessage, { error })
19985
+ ]
19986
+ }
19987
+ );
19988
+ }
19989
+ );
19990
+ TagInput.displayName = "TagInput";
19716
19991
  function Leaderboard({
19717
19992
  items,
19718
19993
  order: initialOrder = "desc",
@@ -20974,4 +21249,4 @@ function CircularProgress({
20974
21249
  );
20975
21250
  }
20976
21251
 
20977
- 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, CommandListBase, 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, 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 IntegrationTooltip, 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, createValueFormatter, createYTickFormatter, detectDataFields, detectXAxis, display12HourValue, 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, normalizeAttendDate, processIntegrationData, processNeo4jData, renderInsideBarLabel, pillLabelRenderer_default as renderPillLabel, resolveChartMargins, resolveContainerPaddingLeft, set12Hours, setDateByType, setHours, setMinutes, setSeconds, sortEvents, sortEventsAgenda, toast, useBiaxial, useCalendarDnd, useCalendarDndAgenda, useChartClick, useChartDimensions, useChartHighlights, useChartLayout, useChartMinMax, useChartTooltips, useCurrentTimeIndicator, useCurrentTimeIndicatorAgenda, useDrag, useEventVisibility, useEventVisibilityAgenda, useIsMobile, useOpenTooltipForPeriod, useProcessedData, useSeriesOpacity, useTheme, useTimeSeriesRange, visualForItem };
21252
+ 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, CommandListBase, 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, HideButton, Highlights_default as Highlights, HorizontalChart_default as HorizontalChart, HorizontalLegend_default as HorizontalLegend, HoverCardBase, HoverCardContentBase, HoverCardTriggerBase, ITEM_HEIGHT, InputBase, InputOTPBase, InputOTPGroupBase, InputOTPSeparatorBase, InputOTPSlotBase, 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, createValueFormatter, createYTickFormatter, detectDataFields, detectXAxis, display12HourValue, 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, normalizeAttendDate, processNeo4jData, renderInsideBarLabel, pillLabelRenderer_default as renderPillLabel, resolveChartMargins, resolveContainerPaddingLeft, set12Hours, setDateByType, setHours, setMinutes, setSeconds, sortEvents, sortEventsAgenda, startOfLocalDay, toast, useBiaxial, useCalendarDnd, useCalendarDndAgenda, useChartClick, useChartDimensions, useChartHighlights, useChartLayout, useChartMinMax, useChartTooltips, useCurrentTimeIndicator, useCurrentTimeIndicatorAgenda, useDrag, useEventVisibility, useEventVisibilityAgenda, useIsMobile, useOpenTooltipForPeriod, useProcessedData, useSeriesOpacity, useTheme, useTimeSeriesRange, visualForItem };