@mlw-packages/react-components 1.9.16 → 1.10.0

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
@@ -5,7 +5,7 @@ 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, FilePdfIcon, FileDocIcon, FileXlsIcon, FilePptIcon, FileCsvIcon, FileTextIcon, FileImageIcon, FileVideoIcon, FileAudioIcon, FileZipIcon, FileIcon, DotsSixVerticalIcon, InfoIcon, WarningIcon, XCircleIcon, CheckCircleIcon, SunIcon, MoonIcon, CaretLeftIcon, DownloadSimpleIcon, UploadSimpleIcon, CopyIcon, ArrowClockwiseIcon, ArrowLeftIcon, GearIcon, BellIcon, DotsThreeIcon, FunnelIcon, HeartIcon, StarIcon, EyeIcon, EyeSlashIcon, LockIcon, LockOpenIcon, FolderIcon, ArrowRightIcon as ArrowRightIcon$1, ArrowsOutIcon, DownloadIcon, CalendarBlankIcon, CalendarIcon, CaretLeft, CaretRight, ArrowDownIcon, ClockUserIcon, EyeSlash, Eye, ArrowRight, ArrowUpRightIcon, ArrowDownRightIcon, FunnelSimpleIcon, PencilIcon, 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, FilePdfIcon, FileDocIcon, FileXlsIcon, FilePptIcon, FileCsvIcon, FileTextIcon, FileImageIcon, FileVideoIcon, FileAudioIcon, FileZipIcon, FileIcon, DotsSixVerticalIcon, InfoIcon, WarningIcon, XCircleIcon, CheckCircleIcon, SunIcon, MoonIcon, CaretLeftIcon, DownloadSimpleIcon, UploadSimpleIcon, CopyIcon, 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, ArrowRight, ArrowUpRightIcon, ArrowDownRightIcon, FunnelSimpleIcon, PencilIcon, FileArchiveIcon, TerminalIcon, CodeIcon, CalendarDotIcon as CalendarDotIcon$1, 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';
@@ -17,7 +17,7 @@ import 'react-router-dom';
17
17
  import { Command } from 'cmdk';
18
18
  import { AnimatePresence, motion, useMotionValue, useSpring, useTransform } from 'framer-motion';
19
19
  import * as PopoverPrimitive from '@radix-ui/react-popover';
20
- import { XIcon as XIcon$1, CalendarDotIcon, DotsThreeIcon as DotsThreeIcon$1, Check, CheckIcon as CheckIcon$1 } from '@phosphor-icons/react/dist/ssr';
20
+ import { XIcon as XIcon$1, CalendarDotIcon, CaretLeftIcon as CaretLeftIcon$1, CaretRightIcon as CaretRightIcon$1, MapPinIcon as MapPinIcon$1, DotsThreeIcon as DotsThreeIcon$1, Check, CheckIcon as CheckIcon$1 } from '@phosphor-icons/react/dist/ssr';
21
21
  import * as SelectPrimitive from '@radix-ui/react-select';
22
22
  import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
23
23
  import * as AvatarPrimitive from '@radix-ui/react-avatar';
@@ -35,7 +35,7 @@ import * as NavigationMenuPrimitive from '@radix-ui/react-navigation-menu';
35
35
  import { Drawer } from 'vaul';
36
36
  import * as ContextMenuPrimitive from '@radix-ui/react-context-menu';
37
37
  import { Prism } from 'react-syntax-highlighter';
38
- import { format, startOfMonth, endOfMonth, eachDayOfInterval, isToday, isSameDay, differenceInMinutes, isPast, startOfDay, eachHourOfInterval, addHours, getHours, getMinutes, areIntervalsOverlapping, startOfWeek, endOfWeek, isSameMonth, addDays, isBefore, differenceInDays, addMinutes, subMonths, subWeeks, addMonths, addWeeks, isWithinInterval, add } from 'date-fns';
38
+ import { format, startOfMonth, endOfMonth, eachDayOfInterval, isToday, isSameDay, differenceInMinutes, isPast, startOfDay, eachHourOfInterval, addHours, getHours, getMinutes, areIntervalsOverlapping, startOfWeek, endOfWeek, isSameMonth, differenceInCalendarDays, addDays, differenceInDays, isBefore, addMinutes, subMonths, subWeeks, addMonths, addWeeks, isWithinInterval, add, max, min } from 'date-fns';
39
39
  import { ptBR } from 'date-fns/locale';
40
40
  import ptBR3 from 'date-fns/locale/pt-BR';
41
41
  import { useSensors, useSensor, MouseSensor, TouchSensor, PointerSensor, DndContext, DragOverlay, useDroppable, useDraggable } from '@dnd-kit/core';
@@ -653,7 +653,7 @@ 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-2 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: [
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
657
  /* @__PURE__ */ jsx(XIcon, { className: "h-6 w-6 sm:h-4 sm:w-4 hover:text-red-500 font-extrabold" }),
658
658
  /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Close" })
659
659
  ] })
@@ -7448,15 +7448,15 @@ function isValid12Hour(value) {
7448
7448
  function isValidMinuteOrSecond(value) {
7449
7449
  return /^[0-5][0-9]$/.test(value);
7450
7450
  }
7451
- function getValidNumber(value, { max, min = 0, loop = false }) {
7451
+ function getValidNumber(value, { max: max2, min: min2 = 0, loop = false }) {
7452
7452
  let numericValue = parseInt(value, 10);
7453
7453
  if (!isNaN(numericValue)) {
7454
7454
  if (!loop) {
7455
- if (numericValue > max) numericValue = max;
7456
- if (numericValue < min) numericValue = min;
7455
+ if (numericValue > max2) numericValue = max2;
7456
+ if (numericValue < min2) numericValue = min2;
7457
7457
  } else {
7458
- if (numericValue > max) numericValue = min;
7459
- if (numericValue < min) numericValue = max;
7458
+ if (numericValue > max2) numericValue = min2;
7459
+ if (numericValue < min2) numericValue = max2;
7460
7460
  }
7461
7461
  return numericValue.toString().padStart(2, "0");
7462
7462
  }
@@ -7474,11 +7474,11 @@ function getValidMinuteOrSecond(value) {
7474
7474
  if (isValidMinuteOrSecond(value)) return value;
7475
7475
  return getValidNumber(value, { max: 59 });
7476
7476
  }
7477
- function getValidArrowNumber(value, { min, max, step }) {
7477
+ function getValidArrowNumber(value, { min: min2, max: max2, step }) {
7478
7478
  let numericValue = parseInt(value, 10);
7479
7479
  if (!isNaN(numericValue)) {
7480
7480
  numericValue += step;
7481
- return getValidNumber(String(numericValue), { min, max, loop: true });
7481
+ return getValidNumber(String(numericValue), { min: min2, max: max2, loop: true });
7482
7482
  }
7483
7483
  return "00";
7484
7484
  }
@@ -7589,19 +7589,19 @@ function visualForItem(item, value) {
7589
7589
  var ITEM_HEIGHT = 38.5;
7590
7590
  var VISIBLE_ITEMS = 5;
7591
7591
  var CENTER_INDEX = Math.floor(VISIBLE_ITEMS / 2);
7592
- function getItems(max, step = 1) {
7593
- return Array.from({ length: Math.ceil(max / step) }, (_, i) => i * step);
7592
+ function getItems(max2, step = 1) {
7593
+ return Array.from({ length: Math.ceil(max2 / step) }, (_, i) => i * step);
7594
7594
  }
7595
7595
 
7596
7596
  // src/components/ui/picker/hooks/useScrollColumn.tsx
7597
7597
  function useScrollColumn({
7598
7598
  value,
7599
7599
  onChange,
7600
- max,
7600
+ max: max2,
7601
7601
  step = 1
7602
7602
  }) {
7603
7603
  const containerRef = useRef(null);
7604
- const items = getItems(max, step);
7604
+ const items = getItems(max2, step);
7605
7605
  const scrollTimeoutRef = useRef(null);
7606
7606
  const isScrollingRef = useRef(false);
7607
7607
  const [isDragging, setIsDragging] = useState(false);
@@ -7669,7 +7669,7 @@ function useScrollColumn({
7669
7669
  function ScrollColumn({
7670
7670
  value,
7671
7671
  onChange,
7672
- max,
7672
+ max: max2,
7673
7673
  label,
7674
7674
  step = 1
7675
7675
  }) {
@@ -7684,7 +7684,7 @@ function ScrollColumn({
7684
7684
  handleMouseMove,
7685
7685
  handleMouseUp,
7686
7686
  isDragging
7687
- } = useScrollColumn({ value, onChange, max, step });
7687
+ } = useScrollColumn({ value, onChange, max: max2, step });
7688
7688
  return /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center", children: [
7689
7689
  /* @__PURE__ */ jsx("span", { className: "text-muted-foreground rounded-md font-semibold text-sm text-center pb-2 uppercase tracking-wider", children: label }),
7690
7690
  /* @__PURE__ */ jsxs("div", { className: cn("relative w-20"), children: [
@@ -8696,7 +8696,7 @@ function Agenda({
8696
8696
  "span",
8697
8697
  {
8698
8698
  className: twMerge(
8699
- "-top-3 absolute left-0 flex h-6 items-center bg-background pe-4 data-today:font-extrabold sm:pe-4 text-sm sm:text-md md:text-md font-bold min-w-0",
8699
+ "-top-3 absolute left-0 flex h-6 items-center bg-background pe-2 data-today:font-extrabold sm:pe-4 text-xs sm:text-sm md:text-base font-bold min-w-0",
8700
8700
  isToday(day) ? "text-blue-500" : ""
8701
8701
  ),
8702
8702
  "data-today": isToday(day) || void 0,
@@ -8983,19 +8983,39 @@ function getEventColorClassesAgenda(color) {
8983
8983
  const eventColor = color || "sky";
8984
8984
  switch (eventColor) {
8985
8985
  case "sky":
8986
- return "bg-sky-100 hover:bg-sky-200 text-sky-900 border dark:bg-sky-500/30 dark:hover:bg-sky-500/40 dark:text-sky-50 dark:border-sky-400/40 shadow-sky-500/15 hover:shadow-sky-500/25 transition-all duration-200";
8986
+ return "bg-sky-100 hover:bg-sky-200/80 text-sky-900 border border-sky-200/70 dark:bg-sky-500/25 dark:hover:bg-sky-500/35 dark:text-sky-50 dark:border-sky-400/30 transition-colors duration-150";
8987
8987
  case "amber":
8988
- return "bg-amber-100 hover:bg-amber-200 text-amber-900 border dark:bg-amber-500/30 dark:hover:bg-amber-500/40 dark:text-amber-50 dark:border-amber-400/40 shadow-amber-500/15 hover:shadow-amber-500/25 transition-all duration-200";
8988
+ return "bg-amber-100 hover:bg-amber-200/80 text-amber-900 border border-amber-200/70 dark:bg-amber-500/25 dark:hover:bg-amber-500/35 dark:text-amber-50 dark:border-amber-400/30 transition-colors duration-150";
8989
8989
  case "violet":
8990
- return "bg-violet-100 hover:bg-violet-200 text-violet-900 border dark:bg-violet-500/30 dark:hover:bg-violet-500/40 dark:text-violet-50 dark:border-violet-400/40 shadow-violet-500/15 hover:shadow-violet-500/25 transition-all duration-200";
8990
+ return "bg-violet-100 hover:bg-violet-200/80 text-violet-900 border border-violet-200/70 dark:bg-violet-500/25 dark:hover:bg-violet-500/35 dark:text-violet-50 dark:border-violet-400/30 transition-colors duration-150";
8991
8991
  case "rose":
8992
- return "bg-rose-100 hover:bg-rose-200 text-rose-900 border dark:bg-rose-500/30 dark:hover:bg-rose-500/40 dark:text-rose-50 dark:border-rose-400/40 shadow-rose-500/15 hover:shadow-rose-500/25 transition-all duration-200";
8992
+ return "bg-rose-100 hover:bg-rose-200/80 text-rose-900 border border-rose-200/70 dark:bg-rose-500/25 dark:hover:bg-rose-500/35 dark:text-rose-50 dark:border-rose-400/30 transition-colors duration-150";
8993
8993
  case "emerald":
8994
- return "bg-emerald-100 hover:bg-emerald-200 text-emerald-900 border dark:bg-emerald-500/30 dark:hover:bg-emerald-500/40 dark:text-emerald-50 dark:border-emerald-400/40 shadow-emerald-500/15 hover:shadow-emerald-500/25 transition-all duration-200";
8994
+ return "bg-emerald-100 hover:bg-emerald-200/80 text-emerald-900 border border-emerald-200/70 dark:bg-emerald-500/25 dark:hover:bg-emerald-500/35 dark:text-emerald-50 dark:border-emerald-400/30 transition-colors duration-150";
8995
8995
  case "orange":
8996
- return "bg-orange-100 hover:bg-orange-200 text-orange-900 border dark:bg-orange-500/30 dark:hover:bg-orange-500/40 dark:text-orange-50 dark:border-orange-400/40 shadow-orange-500/15 hover:shadow-orange-500/25 transition-all duration-200";
8996
+ return "bg-orange-100 hover:bg-orange-200/80 text-orange-900 border border-orange-200/70 dark:bg-orange-500/25 dark:hover:bg-orange-500/35 dark:text-orange-50 dark:border-orange-400/30 transition-colors duration-150";
8997
+ case "green":
8998
+ return "bg-green-100 hover:bg-green-200/80 text-green-900 border border-green-200/70 dark:bg-green-500/25 dark:hover:bg-green-500/35 dark:text-green-50 dark:border-green-400/30 transition-colors duration-150";
8999
+ case "blue":
9000
+ return "bg-blue-100 hover:bg-blue-200/80 text-blue-900 border border-blue-200/70 dark:bg-blue-500/25 dark:hover:bg-blue-500/35 dark:text-blue-50 dark:border-blue-400/30 transition-colors duration-150";
9001
+ case "red":
9002
+ return "bg-red-100 hover:bg-red-200/80 text-red-900 border border-red-200/70 dark:bg-red-500/25 dark:hover:bg-red-500/35 dark:text-red-50 dark:border-red-400/30 transition-colors duration-150";
9003
+ case "purple":
9004
+ return "bg-purple-100 hover:bg-purple-200/80 text-purple-900 border border-purple-200/70 dark:bg-purple-500/25 dark:hover:bg-purple-500/35 dark:text-purple-50 dark:border-purple-400/30 transition-colors duration-150";
9005
+ case "indigo":
9006
+ return "bg-indigo-100 hover:bg-indigo-200/80 text-indigo-900 border border-indigo-200/70 dark:bg-indigo-500/25 dark:hover:bg-indigo-500/35 dark:text-indigo-50 dark:border-indigo-400/30 transition-colors duration-150";
9007
+ case "teal":
9008
+ return "bg-teal-100 hover:bg-teal-200/80 text-teal-900 border border-teal-200/70 dark:bg-teal-500/25 dark:hover:bg-teal-500/35 dark:text-teal-50 dark:border-teal-400/30 transition-colors duration-150";
9009
+ case "pink":
9010
+ return "bg-pink-100 hover:bg-pink-200/80 text-pink-900 border border-pink-200/70 dark:bg-pink-500/25 dark:hover:bg-pink-500/35 dark:text-pink-50 dark:border-pink-400/30 transition-colors duration-150";
9011
+ case "cyan":
9012
+ return "bg-cyan-100 hover:bg-cyan-200/80 text-cyan-900 border border-cyan-200/70 dark:bg-cyan-500/25 dark:hover:bg-cyan-500/35 dark:text-cyan-50 dark:border-cyan-400/30 transition-colors duration-150";
9013
+ case "lime":
9014
+ return "bg-lime-100 hover:bg-lime-200/80 text-lime-900 border border-lime-200/70 dark:bg-lime-500/25 dark:hover:bg-lime-500/35 dark:text-lime-50 dark:border-lime-400/30 transition-colors duration-150";
9015
+ case "fuchsia":
9016
+ return "bg-fuchsia-100 hover:bg-fuchsia-200/80 text-fuchsia-900 border border-fuchsia-200/70 dark:bg-fuchsia-500/25 dark:hover:bg-fuchsia-500/35 dark:text-fuchsia-50 dark:border-fuchsia-400/30 transition-colors duration-150";
8997
9017
  default:
8998
- return "bg-sky-100 hover:bg-sky-200 text-sky-900 border dark:bg-sky-500/30 dark:hover:bg-sky-500/40 dark:text-sky-50 dark:border-sky-400/40 shadow-sky-500/15 hover:shadow-sky-500/25 transition-all duration-200";
9018
+ return "bg-sky-100 hover:bg-sky-200/80 text-sky-900 border border-sky-200/70 dark:bg-sky-500/25 dark:hover:bg-sky-500/35 dark:text-sky-50 dark:border-sky-400/30 transition-colors duration-150";
8999
9019
  }
9000
9020
  }
9001
9021
  function getBorderRadiusClassesAgenda(isFirstDay, isLastDay) {
@@ -9066,6 +9086,9 @@ function getEventEndDate(event) {
9066
9086
  if (start && typeof event.duration === "number" && !isNaN(event.duration)) {
9067
9087
  return addMinutesToDateAgenda(start, event.duration);
9068
9088
  }
9089
+ if (start && !event.allDay) {
9090
+ return addMinutesToDateAgenda(start, 60);
9091
+ }
9069
9092
  return void 0;
9070
9093
  }
9071
9094
  function isValidDate(d) {
@@ -9175,7 +9198,7 @@ function EventWrapper({
9175
9198
  "button",
9176
9199
  {
9177
9200
  className: cn(
9178
- "flex w-full select-none px-3 py-1 text-left font-medium outline-none transition-transform duration-150 ease-out backdrop-blur-sm focus-visible:ring-2 focus-visible:ring-ring/50 focus-visible:border-ring data-dragging:cursor-grabbing data-past-event:line-through data-dragging:shadow-lg sm:px-3 rounded-lg shadow-sm hover:shadow-md border ",
9201
+ "flex w-full select-none text-left font-medium outline-none transition-colors duration-150 ease-out backdrop-blur-sm focus-visible:ring-2 focus-visible:ring-ring/50 focus-visible:border-ring data-dragging:cursor-grabbing data-past-event:line-through data-dragging:shadow-lg rounded-lg border",
9179
9202
  className?.includes("overflow-visible") ? "" : "overflow-hidden",
9180
9203
  colorClasses,
9181
9204
  getBorderRadiusClassesAgenda(isFirstDay, isLastDay),
@@ -9208,7 +9231,8 @@ function EventItemAgenda({
9208
9231
  dndAttributes,
9209
9232
  onMouseDown,
9210
9233
  onTouchStart,
9211
- agendaOnly = false
9234
+ agendaOnly = false,
9235
+ totalCols = 1
9212
9236
  }) {
9213
9237
  const eventColor = event.color;
9214
9238
  const startDate = getEventStartDate(event);
@@ -9266,7 +9290,7 @@ function EventItemAgenda({
9266
9290
  EventWrapper,
9267
9291
  {
9268
9292
  className: cn(
9269
- "mt-[var(--event-gap)] h-[var(--event-height)] items-center sm:text-xs",
9293
+ "mt-[var(--event-gap)] h-[var(--event-height)] items-center px-1.5 sm:px-3 py-1 sm:text-xs",
9270
9294
  className
9271
9295
  ),
9272
9296
  currentTime,
@@ -9294,13 +9318,58 @@ function EventItemAgenda({
9294
9318
  );
9295
9319
  }
9296
9320
  if (view === "week" || view === "day") {
9321
+ const isCompact = durationMinutes < 45;
9322
+ const isDay = view === "day";
9323
+ const tier = isDay ? 1 : totalCols >= 5 ? 3 : totalCols >= 3 ? 2 : 1;
9324
+ if (tier === 3) {
9325
+ return /* @__PURE__ */ jsx(
9326
+ "button",
9327
+ {
9328
+ type: "button",
9329
+ className: cn(
9330
+ "h-full w-full rounded border overflow-hidden cursor-pointer",
9331
+ colorClasses,
9332
+ className
9333
+ ),
9334
+ onClick,
9335
+ onMouseDown,
9336
+ onTouchStart,
9337
+ "aria-label": ariaLabel,
9338
+ ...dndListeners,
9339
+ ...dndAttributes
9340
+ }
9341
+ );
9342
+ }
9343
+ if (tier === 2) {
9344
+ return /* @__PURE__ */ jsx(
9345
+ EventWrapper,
9346
+ {
9347
+ className: cn(
9348
+ "h-full px-1 py-0.5 overflow-hidden text-[9px]",
9349
+ isCompact ? "flex-row items-center" : "flex-col items-start",
9350
+ className
9351
+ ),
9352
+ currentTime,
9353
+ dndAttributes,
9354
+ dndListeners,
9355
+ event,
9356
+ ariaLabel,
9357
+ isFirstDay,
9358
+ isLastDay,
9359
+ onClick,
9360
+ onMouseDown,
9361
+ onTouchStart,
9362
+ children: /* @__PURE__ */ jsx("span", { className: "font-semibold leading-none truncate w-full block", children: event.title })
9363
+ }
9364
+ );
9365
+ }
9297
9366
  return /* @__PURE__ */ jsx(
9298
9367
  EventWrapper,
9299
9368
  {
9300
9369
  className: cn(
9301
- "py-1",
9302
- durationMinutes < 45 ? "items-center" : "flex-col",
9303
- view === "week" ? "text-[10px] sm:text-xs" : "text-xs",
9370
+ "h-full py-0.5 px-1.5 overflow-hidden",
9371
+ isCompact ? "items-center flex-row" : "flex-col items-start",
9372
+ isDay ? "text-xs" : "text-[10px]",
9304
9373
  className
9305
9374
  ),
9306
9375
  currentTime,
@@ -9311,26 +9380,14 @@ function EventItemAgenda({
9311
9380
  isFirstDay,
9312
9381
  isLastDay,
9313
9382
  onClick,
9314
- children: durationMinutes < 45 ? /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between w-full", children: [
9315
- /* @__PURE__ */ jsx(
9316
- "div",
9317
- {
9318
- className: cn("truncate text-sm sm:text-base md:text-lg min-w-0"),
9319
- children: event.title
9320
- }
9321
- ),
9322
- showTime && hasValidTime && displayStart && /* @__PURE__ */ jsx("span", { className: "ml-2 flex items-center gap-3 bg-white/10 py-0.5 rounded-full opacity-90 text-sm sm:text-base md:text-lg min-w-0", children: formatTimeWithOptionalMinutes(displayStart) })
9323
- ] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
9324
- /* @__PURE__ */ jsx(
9325
- "div",
9326
- {
9327
- className: cn(
9328
- "truncate font-medium text-sm sm:text-base md:text-lg min-w-0"
9329
- ),
9330
- children: event.title
9331
- }
9332
- ),
9333
- showTime && hasValidTime && /* @__PURE__ */ jsx("div", { className: "truncate font-normal opacity-70 text-sm sm:text-base", children: /* @__PURE__ */ jsx("span", { className: "inline-block bg-white/5 px-0.5 py-0.5 rounded-full", children: getEventTime() }) })
9383
+ onMouseDown,
9384
+ onTouchStart,
9385
+ children: isCompact ? /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1 w-full min-w-0 overflow-hidden", children: [
9386
+ /* @__PURE__ */ jsx("span", { className: "truncate font-semibold leading-none min-w-0", children: event.title }),
9387
+ showTime && hasValidTime && displayStart && /* @__PURE__ */ jsx("span", { className: "shrink-0 opacity-75 leading-none", children: formatTimeWithOptionalMinutes(displayStart) })
9388
+ ] }) : /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-0.5 w-full min-w-0 overflow-hidden h-full", children: [
9389
+ /* @__PURE__ */ jsx("span", { className: "font-semibold leading-snug truncate", children: event.title }),
9390
+ showTime && hasValidTime && /* @__PURE__ */ jsx("span", { className: "opacity-75 leading-none truncate", children: getEventTime() })
9334
9391
  ] })
9335
9392
  }
9336
9393
  );
@@ -9502,7 +9559,6 @@ function DayViewAgenda({
9502
9559
  });
9503
9560
  }, [dayEvents]);
9504
9561
  const positionedEvents = useMemo(() => {
9505
- const result = [];
9506
9562
  const dayStart = startOfDay(currentDate);
9507
9563
  const sortedEvents = [...timeEvents].sort((a, b) => {
9508
9564
  const aStart = getEventStartDate(a) ?? getEventEndDate(a) ?? /* @__PURE__ */ new Date();
@@ -9516,57 +9572,69 @@ function DayViewAgenda({
9516
9572
  return bDuration - aDuration;
9517
9573
  });
9518
9574
  const columns = [];
9575
+ const layouts = [];
9519
9576
  for (const event of sortedEvents) {
9520
9577
  const eventStart = getEventStartDate(event) ?? getEventEndDate(event) ?? /* @__PURE__ */ new Date();
9521
- const eventEnd = getEventEndDate(event) ?? getEventStartDate(event) ?? /* @__PURE__ */ new Date();
9578
+ const rawEnd = getEventEndDate(event) ?? getEventStartDate(event) ?? /* @__PURE__ */ new Date();
9579
+ const eventEnd = rawEnd <= eventStart ? new Date(eventStart.getTime() + 30 * 60 * 1e3) : rawEnd;
9522
9580
  const adjustedStart = isSameDay(currentDate, eventStart) ? eventStart : dayStart;
9523
9581
  const adjustedEnd = isSameDay(currentDate, eventEnd) ? eventEnd : addHours(dayStart, 24);
9524
9582
  const startHour = getHours(adjustedStart) + getMinutes(adjustedStart) / 60;
9525
9583
  const endHour = getHours(adjustedEnd) + getMinutes(adjustedEnd) / 60;
9526
9584
  const top = (startHour - StartHourAgenda) * WeekCellsHeightAgenda;
9527
- const height = (endHour - startHour) * WeekCellsHeightAgenda;
9528
- let columnIndex = 0;
9529
- let placed = false;
9530
- while (!placed) {
9531
- const col = columns[columnIndex] || [];
9532
- if (col.length === 0) {
9533
- columns[columnIndex] = col;
9534
- placed = true;
9535
- } else {
9536
- const overlaps = col.some((c) => {
9537
- const cStart = getEventStartDate(c.event) ?? getEventEndDate(c.event) ?? /* @__PURE__ */ new Date();
9538
- const cEnd = getEventEndDate(c.event) ?? getEventStartDate(c.event) ?? /* @__PURE__ */ new Date();
9539
- return areIntervalsOverlapping(
9540
- { end: adjustedEnd, start: adjustedStart },
9541
- { end: cEnd, start: cStart }
9542
- );
9543
- });
9544
- if (!overlaps) {
9545
- placed = true;
9546
- } else {
9547
- columnIndex++;
9548
- }
9549
- }
9585
+ const height = Math.max(
9586
+ (endHour - startHour) * WeekCellsHeightAgenda,
9587
+ 24
9588
+ );
9589
+ let col = 0;
9590
+ while (true) {
9591
+ const colSlots = columns[col] ?? [];
9592
+ const hasConflict = colSlots.some(
9593
+ (slot) => areIntervalsOverlapping(
9594
+ { start: adjustedStart, end: adjustedEnd },
9595
+ { start: slot.start, end: slot.end },
9596
+ { inclusive: false }
9597
+ )
9598
+ );
9599
+ if (!hasConflict) break;
9600
+ col++;
9550
9601
  }
9551
- const currentColumn = columns[columnIndex] || [];
9552
- columns[columnIndex] = currentColumn;
9553
- currentColumn.push({
9554
- end: adjustedEnd,
9555
- event,
9556
- start: adjustedStart
9557
- });
9558
- const width = columnIndex === 0 ? 1 : 0.9;
9559
- const left = columnIndex === 0 ? 0 : columnIndex * 0.1;
9560
- result.push({
9602
+ if (!columns[col]) columns[col] = [];
9603
+ columns[col].push({ start: adjustedStart, end: adjustedEnd });
9604
+ layouts.push({
9561
9605
  event,
9562
- height,
9563
- left,
9606
+ adjustedStart,
9607
+ adjustedEnd,
9564
9608
  top,
9565
- width,
9566
- zIndex: 10 + columnIndex
9609
+ height,
9610
+ col,
9611
+ totalCols: 0
9567
9612
  });
9568
9613
  }
9569
- return result;
9614
+ for (const layout of layouts) {
9615
+ let maxCol = layout.col;
9616
+ for (const other of layouts) {
9617
+ if (other === layout) continue;
9618
+ if (areIntervalsOverlapping(
9619
+ { start: layout.adjustedStart, end: layout.adjustedEnd },
9620
+ { start: other.adjustedStart, end: other.adjustedEnd },
9621
+ { inclusive: false }
9622
+ )) {
9623
+ maxCol = Math.max(maxCol, other.col);
9624
+ }
9625
+ }
9626
+ layout.totalCols = maxCol + 1;
9627
+ }
9628
+ return layouts.map(
9629
+ ({ event, top, height, col, totalCols }) => ({
9630
+ event,
9631
+ top,
9632
+ height,
9633
+ left: col / totalCols,
9634
+ width: 1 / totalCols,
9635
+ zIndex: 10 + col
9636
+ })
9637
+ );
9570
9638
  }, [currentDate, timeEvents]);
9571
9639
  const handleEventClick = (event, e) => {
9572
9640
  e.stopPropagation();
@@ -9601,7 +9669,7 @@ function DayViewAgenda({
9601
9669
  "div",
9602
9670
  {
9603
9671
  className: "relative h-[var(--week-cells-height)] border-border/70 border-b last:border-b-0",
9604
- children: index > 0 && /* @__PURE__ */ jsx("span", { className: "-top-3 absolute left-0 flex h-6 w-16 max-w-full items-center justify-end bg-background pe-2 text-[10px] text-muted-foreground/70 sm:pe-4 sm:text-xs", children: format(hour, "HH:mm") })
9672
+ children: index > 0 && /* @__PURE__ */ jsx("span", { className: "-top-3 absolute left-0 flex h-6 w-16 max-w-full items-center justify-end bg-background pe-1 sm:pe-4 text-[9px] sm:text-xs text-muted-foreground/70", children: format(hour, "HH:mm") })
9605
9673
  },
9606
9674
  hour.toString()
9607
9675
  )) }),
@@ -9990,25 +10058,25 @@ function EventAgenda({
9990
10058
  return condensed ? entry.short : entry.full;
9991
10059
  };
9992
10060
  const viewTitle = useMemo(() => {
9993
- const capitalize = (s) => s ? s.charAt(0).toUpperCase() + s.slice(1) : s;
10061
+ const capitalize2 = (s) => s ? s.charAt(0).toUpperCase() + s.slice(1) : s;
9994
10062
  if (view === "month")
9995
- return capitalize(format(currentDate, "MMMM yyyy", { locale: ptBR }));
10063
+ return capitalize2(format(currentDate, "MMMM yyyy", { locale: ptBR }));
9996
10064
  if (view === "week") {
9997
10065
  const start = startOfWeek(currentDate, { weekStartsOn: 1 });
9998
10066
  const end = endOfWeek(currentDate, { weekStartsOn: 1 });
9999
10067
  if (isSameMonth(start, end))
10000
- return capitalize(format(start, "MMMM yyyy", { locale: ptBR }));
10001
- const s1 = capitalize(format(start, "MMM", { locale: ptBR }));
10002
- const s2 = capitalize(format(end, "MMM yyyy", { locale: ptBR }));
10068
+ return capitalize2(format(start, "MMMM yyyy", { locale: ptBR }));
10069
+ const s1 = capitalize2(format(start, "MMM", { locale: ptBR }));
10070
+ const s2 = capitalize2(format(end, "MMM yyyy", { locale: ptBR }));
10003
10071
  return `${s1} - ${s2}`;
10004
10072
  }
10005
10073
  if (view === "day")
10006
10074
  return format(currentDate, "d 'de' MMMM 'de' yyyy", { locale: ptBR });
10007
10075
  if (view === "agenda") {
10008
10076
  const start = currentDate;
10009
- return capitalize(format(start, "MMMM yyyy", { locale: ptBR }));
10077
+ return capitalize2(format(start, "MMMM yyyy", { locale: ptBR }));
10010
10078
  }
10011
- return capitalize(format(currentDate, "MMMM yyyy", { locale: ptBR }));
10079
+ return capitalize2(format(currentDate, "MMMM yyyy", { locale: ptBR }));
10012
10080
  }, [currentDate, view]);
10013
10081
  const selectItems = ["month", "week", "day", "agenda"].map((v) => ({
10014
10082
  label: viewLabel(v),
@@ -10195,6 +10263,159 @@ function useEventVisibilityAgenda({
10195
10263
  getVisibleEventCount
10196
10264
  };
10197
10265
  }
10266
+ function clampToWeek(date, weekStart, weekEnd) {
10267
+ return max([min([date, weekEnd]), weekStart]);
10268
+ }
10269
+ function dayCol(date, weekStart) {
10270
+ const diff = Math.round(
10271
+ (date.getTime() - weekStart.getTime()) / (1e3 * 60 * 60 * 24)
10272
+ );
10273
+ return Math.max(0, Math.min(6, diff));
10274
+ }
10275
+ function computeMultiDayBars(events, weekDays) {
10276
+ const weekStart = weekDays[0];
10277
+ const weekEnd = weekDays[6];
10278
+ const multiDayEvents = events.filter((ev) => {
10279
+ if (!isMultiDayEventAgenda(ev)) return false;
10280
+ const start = getEventStartDate(ev);
10281
+ const end = getEventEndDate(ev) ?? start;
10282
+ if (!start || !end) return false;
10283
+ return start <= weekEnd && end >= weekStart;
10284
+ });
10285
+ const sorted = [...multiDayEvents].sort((a, b) => {
10286
+ const aS = getEventStartDate(a) ?? /* @__PURE__ */ new Date(0);
10287
+ const bS = getEventStartDate(b) ?? /* @__PURE__ */ new Date(0);
10288
+ const aE = getEventEndDate(a) ?? aS;
10289
+ const bE = getEventEndDate(b) ?? bS;
10290
+ const diff = bE.getTime() - bS.getTime() - (aE.getTime() - aS.getTime());
10291
+ return diff !== 0 ? diff : aS.getTime() - bS.getTime();
10292
+ });
10293
+ const slotOccupancy = [];
10294
+ const bars = [];
10295
+ for (const event of sorted) {
10296
+ const evStart = getEventStartDate(event);
10297
+ const evEnd = getEventEndDate(event) ?? evStart;
10298
+ const cStart = clampToWeek(evStart, weekStart, weekEnd);
10299
+ const cEnd = clampToWeek(evEnd, weekStart, weekEnd);
10300
+ const sc = dayCol(cStart, weekStart);
10301
+ const ec = dayCol(cEnd, weekStart);
10302
+ let slot = 0;
10303
+ for (; ; ) {
10304
+ if (!slotOccupancy[slot]) slotOccupancy[slot] = Array(7).fill(false);
10305
+ let free = true;
10306
+ for (let c = sc; c <= ec; c++) {
10307
+ if (slotOccupancy[slot][c]) {
10308
+ free = false;
10309
+ break;
10310
+ }
10311
+ }
10312
+ if (free) {
10313
+ for (let c = sc; c <= ec; c++) slotOccupancy[slot][c] = true;
10314
+ break;
10315
+ }
10316
+ slot++;
10317
+ }
10318
+ bars.push({
10319
+ event,
10320
+ colStart: sc,
10321
+ colSpan: ec - sc + 1,
10322
+ isFirstDay: isSameDay(cStart, evStart),
10323
+ isLastDay: isSameDay(cEnd, evEnd),
10324
+ slot
10325
+ });
10326
+ }
10327
+ return bars;
10328
+ }
10329
+ function formatDuration(event) {
10330
+ const start = getEventStartDate(event);
10331
+ const end = getEventEndDate(event);
10332
+ if (!start) return "";
10333
+ const fmt = (d) => format(d, "d 'de' MMM", { locale: ptBR });
10334
+ if (!end || isSameDay(start, end)) {
10335
+ return fmt(start) + (event.allDay ? " \xB7 Dia todo" : " \xB7 " + format(start, "HH:mm"));
10336
+ }
10337
+ const days = differenceInCalendarDays(end, start) + 1;
10338
+ return `${fmt(start)} \u2192 ${fmt(end)} \xB7 ${days} dias`;
10339
+ }
10340
+ function MultiDayOverlay({
10341
+ bars,
10342
+ weekIndex,
10343
+ hoveredEventId,
10344
+ onHover,
10345
+ onEventSelect
10346
+ }) {
10347
+ if (bars.length === 0) return null;
10348
+ return /* @__PURE__ */ jsx("div", { className: "absolute inset-0 pointer-events-none mt-1", children: bars.map((bar) => {
10349
+ const { event, colStart, colSpan, isFirstDay, isLastDay, slot } = bar;
10350
+ const isHovered = hoveredEventId === event.id;
10351
+ const eventStart = getEventStartDate(event) ?? getEventEndDate(event) ?? /* @__PURE__ */ new Date();
10352
+ const continuesFromPrev = !isFirstDay;
10353
+ const continuesToNext = !isLastDay;
10354
+ return /* @__PURE__ */ jsx(
10355
+ TooltipProviderBase,
10356
+ {
10357
+ delayDuration: 400,
10358
+ children: /* @__PURE__ */ jsxs(TooltipBase, { children: [
10359
+ /* @__PURE__ */ jsx(TooltipTriggerBase, { asChild: true, children: /* @__PURE__ */ jsx(
10360
+ "div",
10361
+ {
10362
+ className: "absolute pointer-events-auto px-1.5",
10363
+ style: {
10364
+ left: continuesFromPrev ? `${colStart / 7 * 100}%` : `calc(${colStart / 7 * 100}% + 3px)`,
10365
+ right: continuesToNext ? `${100 - (colStart + colSpan) / 7 * 100}%` : `calc(${100 - (colStart + colSpan) / 7 * 100}% + 3px)`,
10366
+ top: `calc(34px + ${slot} * (var(--event-height) + var(--event-gap)) + var(--event-gap))`,
10367
+ zIndex: isHovered ? 10 : 1
10368
+ },
10369
+ onMouseEnter: () => onHover(event.id),
10370
+ onMouseLeave: () => onHover(null),
10371
+ children: /* @__PURE__ */ jsx(
10372
+ EventItemAgenda,
10373
+ {
10374
+ event,
10375
+ isFirstDay,
10376
+ isLastDay,
10377
+ onClick: (e) => {
10378
+ e.stopPropagation();
10379
+ onEventSelect(event, e);
10380
+ },
10381
+ view: "month",
10382
+ className: cn("w-full", isHovered && "[filter:brightness(0.92)]"),
10383
+ children: /* @__PURE__ */ jsxs("span", { className: "flex items-center gap-0.5 w-full min-w-0", children: [
10384
+ 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" }) }),
10385
+ !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") }),
10386
+ /* @__PURE__ */ jsx("span", { className: "font-semibold text-[11px] sm:text-xs truncate min-w-0 leading-none flex-1", children: event.title }),
10387
+ isFirstDay && (() => {
10388
+ const evStart = getEventStartDate(event);
10389
+ const evEnd = getEventEndDate(event);
10390
+ if (!evStart || !evEnd) return null;
10391
+ const totalDays = differenceInCalendarDays(evEnd, evStart) + 1;
10392
+ if (totalDays < 2) return null;
10393
+ return /* @__PURE__ */ jsxs("span", { className: "shrink-0 font-bold leading-none text-[10px] opacity-55 ml-0.5", children: [
10394
+ totalDays,
10395
+ "d"
10396
+ ] });
10397
+ })(),
10398
+ continuesToNext && /* @__PURE__ */ jsx("span", { className: "shrink-0 opacity-50 leading-none ml-0.5 flex items-center", children: /* @__PURE__ */ jsx(CaretRightIcon, { size: 10, weight: "bold" }) })
10399
+ ] })
10400
+ }
10401
+ )
10402
+ }
10403
+ ) }),
10404
+ /* @__PURE__ */ jsxs(TooltipContentBase, { side: "top", children: [
10405
+ /* @__PURE__ */ jsx("p", { className: "font-semibold truncate max-w-[200px]", children: event.title }),
10406
+ /* @__PURE__ */ jsx("p", { className: "opacity-80 mt-0.5 leading-snug", children: formatDuration(event) }),
10407
+ event.location && /* @__PURE__ */ jsxs("p", { className: "opacity-60 mt-0.5 truncate text-[11px] max-w-[200px]", children: [
10408
+ /* @__PURE__ */ jsx(MapPinIcon, { size: 15 }),
10409
+ " ",
10410
+ event.location
10411
+ ] })
10412
+ ] })
10413
+ ] })
10414
+ },
10415
+ `bar-${event.id}-w${weekIndex}`
10416
+ );
10417
+ }) });
10418
+ }
10198
10419
  function MonthViewAgenda({
10199
10420
  currentDate,
10200
10421
  events,
@@ -10208,13 +10429,14 @@ function MonthViewAgenda({
10208
10429
  const calendarEnd = endOfWeek(monthEnd, { weekStartsOn: 0 });
10209
10430
  return eachDayOfInterval({ end: calendarEnd, start: calendarStart });
10210
10431
  }, [currentDate]);
10211
- const weekdays = useMemo(() => {
10212
- return Array.from({ length: 7 }).map((_, i) => {
10432
+ const weekdays = useMemo(
10433
+ () => Array.from({ length: 7 }).map((_, i) => {
10213
10434
  const date = addDays(startOfWeek(/* @__PURE__ */ new Date(), { weekStartsOn: 0 }), i);
10214
10435
  const short = format(date, "EEE", { locale: ptBR });
10215
10436
  return short.charAt(0).toUpperCase() + short.slice(1);
10216
- });
10217
- }, []);
10437
+ }),
10438
+ []
10439
+ );
10218
10440
  const weeks = useMemo(() => {
10219
10441
  const result = [];
10220
10442
  let week = [];
@@ -10227,11 +10449,24 @@ function MonthViewAgenda({
10227
10449
  }
10228
10450
  return result;
10229
10451
  }, [days]);
10230
- const handleEventClick = (event, e) => {
10231
- e.stopPropagation();
10232
- onEventSelect(event, e);
10233
- };
10452
+ const todayColIndex = useMemo(() => (/* @__PURE__ */ new Date()).getDay(), []);
10234
10453
  const [isMounted, setIsMounted] = useState(false);
10454
+ const [hoveredEventId, setHoveredEventId] = useState(null);
10455
+ const hoverLeaveTimerRef = useRef(null);
10456
+ const handleHover = useCallback((id) => {
10457
+ if (id !== null) {
10458
+ if (hoverLeaveTimerRef.current) {
10459
+ clearTimeout(hoverLeaveTimerRef.current);
10460
+ hoverLeaveTimerRef.current = null;
10461
+ }
10462
+ setHoveredEventId(id);
10463
+ } else {
10464
+ hoverLeaveTimerRef.current = setTimeout(() => {
10465
+ setHoveredEventId(null);
10466
+ hoverLeaveTimerRef.current = null;
10467
+ }, 150);
10468
+ }
10469
+ }, []);
10235
10470
  const { contentRef, getVisibleEventCount } = useEventVisibilityAgenda({
10236
10471
  eventGap: EventGapAgenda,
10237
10472
  eventHeight: EventHeightAgenda
@@ -10239,202 +10474,221 @@ function MonthViewAgenda({
10239
10474
  useEffect(() => {
10240
10475
  setIsMounted(true);
10241
10476
  }, []);
10477
+ const eventsWithStart = useMemo(
10478
+ () => events.filter((ev) => {
10479
+ try {
10480
+ if (ev.start == null) return false;
10481
+ const t = ev.start instanceof Date ? ev.start.getTime() : new Date(String(ev.start)).getTime();
10482
+ return !isNaN(t);
10483
+ } catch {
10484
+ return false;
10485
+ }
10486
+ }),
10487
+ [events]
10488
+ );
10489
+ const handleEventClick = (event, e) => {
10490
+ e.stopPropagation();
10491
+ onEventSelect(event, e);
10492
+ };
10242
10493
  return /* @__PURE__ */ jsxs("div", { className: "contents", "data-slot": "month-view", children: [
10243
- /* @__PURE__ */ jsx("div", { className: "grid grid-cols-7 border-border/70 border-b", children: weekdays.map((day) => /* @__PURE__ */ jsxs(
10244
- "div",
10245
- {
10246
- className: "py-1 px-1 text-center text-muted-foreground/70 text-xs uppercase sm:tracking-wide bg-muted/5 leading-none",
10247
- children: [
10248
- /* @__PURE__ */ jsx("span", { className: "hidden sm:inline", children: day }),
10249
- /* @__PURE__ */ jsx("span", { className: "inline sm:hidden", children: day.charAt(0) })
10250
- ]
10251
- },
10252
- day
10253
- )) }),
10254
- /* @__PURE__ */ jsx("div", { className: "grid flex-1 auto-rows-fr", children: weeks.map((week, weekIndex) => /* @__PURE__ */ jsx(
10255
- "div",
10256
- {
10257
- className: "grid grid-cols-7 [&:last-child>*]:border-b-0",
10258
- children: week.map((day, dayIndex) => {
10259
- if (!day) return null;
10260
- const eventsWithStart = events.filter((ev) => {
10261
- try {
10262
- if (ev.start == null) return false;
10263
- const t = ev.start instanceof Date ? ev.start.getTime() : new Date(String(ev.start)).getTime();
10264
- return !isNaN(t);
10265
- } catch {
10266
- return false;
10267
- }
10268
- });
10269
- const dayEvents = getEventsForDayAgenda(eventsWithStart, day);
10270
- const spanningEvents = getSpanningEventsForDayAgenda(
10271
- eventsWithStart,
10272
- day
10273
- );
10274
- const isCurrentMonth = isSameMonth(day, currentDate);
10275
- const cellId = `month-cell-${day.toISOString()}`;
10276
- const allDayEvents = [...spanningEvents, ...dayEvents];
10277
- const allEvents = getAllEventsForDayAgenda(events, day);
10278
- const isReferenceCell = weekIndex === 0 && dayIndex === 0;
10279
- const visibleCount = isMounted ? getVisibleEventCount(allDayEvents.length) : void 0;
10280
- const hasMore = visibleCount !== void 0 && allDayEvents.length > visibleCount;
10281
- const remainingCount = hasMore ? allDayEvents.length - visibleCount : 0;
10282
- return /* @__PURE__ */ jsx(
10283
- "div",
10284
- {
10285
- className: "group border-border/70 border-r border-b last:border-r-0 data-outside-cell:bg-muted/25 data-outside-cell:text-muted-foreground/70 hover:bg-muted/5 transition-colors p-1 sm:p-2",
10286
- "data-outside-cell": !isCurrentMonth || void 0,
10287
- "data-today": isToday(day) || void 0,
10288
- children: /* @__PURE__ */ jsxs(
10289
- DroppableCellAgenda,
10494
+ /* @__PURE__ */ jsx("div", { className: "grid grid-cols-7 border-border/70 border-b", children: weekdays.map((day, i) => {
10495
+ const isTodayCol = i === todayColIndex;
10496
+ return /* @__PURE__ */ jsxs(
10497
+ "div",
10498
+ {
10499
+ className: cn(
10500
+ "py-1.5 px-1 text-center text-xs uppercase sm:tracking-wide leading-none transition-colors",
10501
+ isTodayCol ? "bg-blue-50 dark:bg-blue-950/30 text-blue-600 dark:text-blue-400 font-bold" : "bg-muted/5 text-muted-foreground/70"
10502
+ ),
10503
+ children: [
10504
+ /* @__PURE__ */ jsx("span", { className: "hidden sm:inline", children: day }),
10505
+ /* @__PURE__ */ jsx("span", { className: "inline sm:hidden", children: day.charAt(0) })
10506
+ ]
10507
+ },
10508
+ day
10509
+ );
10510
+ }) }),
10511
+ /* @__PURE__ */ jsx("div", { className: "grid flex-1 auto-rows-fr", children: weeks.map((week, weekIndex) => {
10512
+ const multiDayBars = computeMultiDayBars(eventsWithStart, week);
10513
+ return /* @__PURE__ */ jsxs(
10514
+ "div",
10515
+ {
10516
+ className: "grid grid-cols-7 [&:last-child>*]:border-b-0 relative p-0",
10517
+ children: [
10518
+ week.map((day, dayIndex) => {
10519
+ if (!day) return null;
10520
+ const isTodayCell = isToday(day);
10521
+ const isTodayCol = dayIndex === todayColIndex;
10522
+ const isCurrentMonth = isSameMonth(day, currentDate);
10523
+ const cellId = `month-cell-${day.toISOString()}`;
10524
+ const dayEvents = getEventsForDayAgenda(eventsWithStart, day);
10525
+ const spanningEvents = getSpanningEventsForDayAgenda(
10526
+ eventsWithStart,
10527
+ day
10528
+ );
10529
+ const allDayEvents = [...spanningEvents, ...dayEvents];
10530
+ const allEvents = getAllEventsForDayAgenda(events, day);
10531
+ const isReferenceCell = weekIndex === 0 && dayIndex === 0;
10532
+ const dayBars = multiDayBars.filter(
10533
+ (b) => dayIndex >= b.colStart && dayIndex < b.colStart + b.colSpan
10534
+ );
10535
+ const dayMaxSlot = dayBars.length > 0 ? Math.max(...dayBars.map((b) => b.slot)) : -1;
10536
+ const dayMultiDayRowCount = dayMaxSlot + 1;
10537
+ const singleEvents = sortEventsAgenda(allDayEvents).filter(
10538
+ (e) => !isMultiDayEventAgenda(e)
10539
+ );
10540
+ const visibleCount = isMounted ? getVisibleEventCount(
10541
+ singleEvents.length + dayMultiDayRowCount
10542
+ ) : void 0;
10543
+ const visibleAfterMultiday = visibleCount !== void 0 ? Math.max(0, visibleCount - dayMultiDayRowCount) : void 0;
10544
+ const hasMore = visibleAfterMultiday !== void 0 && singleEvents.length > visibleAfterMultiday;
10545
+ const remainingCount = hasMore ? singleEvents.length - (visibleAfterMultiday ?? 0) : 0;
10546
+ return /* @__PURE__ */ jsx(
10547
+ "div",
10290
10548
  {
10291
- date: day,
10292
- id: cellId,
10293
- onClick: () => {
10294
- const startTime = new Date(day);
10295
- startTime.setHours(DefaultStartHourAgenda, 0, 0);
10296
- },
10297
- children: [
10298
- /* @__PURE__ */ jsx(
10299
- "div",
10300
- {
10301
- className: twMerge(
10302
- `mt-1 inline-flex w-6 h-6 sm:w-7 sm:h-7 items-center justify-center border rounded-md text-xs sm:text-sm font-semibold text-muted-foreground`,
10303
- isToday(day) ? "bg-blue-500 text-white" : ""
10549
+ "data-outside-cell": !isCurrentMonth || void 0,
10550
+ "data-today": isTodayCell || void 0,
10551
+ className: cn(
10552
+ "group border-border/70 border-r border-b last:border-r-0 transition-colors py-0.5 relative",
10553
+ !isCurrentMonth && "bg-muted/20 text-muted-foreground/60",
10554
+ isTodayCol && isCurrentMonth && !isTodayCell && "bg-blue-50/20 dark:bg-blue-950/10",
10555
+ isTodayCell && "bg-blue-50/50 dark:bg-blue-950/20",
10556
+ "hover:bg-muted/5"
10557
+ ),
10558
+ children: /* @__PURE__ */ jsxs(
10559
+ DroppableCellAgenda,
10560
+ {
10561
+ date: day,
10562
+ id: cellId,
10563
+ onClick: () => {
10564
+ const t = new Date(day);
10565
+ t.setHours(DefaultStartHourAgenda, 0, 0);
10566
+ },
10567
+ children: [
10568
+ /* @__PURE__ */ jsx(
10569
+ "div",
10570
+ {
10571
+ className: twMerge(
10572
+ "mt-1 inline-flex w-6 h-6 sm:w-7 sm:h-7 items-center justify-center rounded-lg text-xs sm:text-sm font-semibold border",
10573
+ isTodayCell ? "bg-blue-500 text-white border-blue-500 shadow-sm shadow-blue-400/40" : "text-muted-foreground border-transparent"
10574
+ ),
10575
+ children: format(day, "d")
10576
+ }
10304
10577
  ),
10305
- children: format(day, "d")
10306
- }
10307
- ),
10308
- /* @__PURE__ */ jsxs(
10309
- "div",
10310
- {
10311
- className: "min-h-[calc((var(--event-height)+var(--event-gap))*2)] sm:min-h-[calc((var(--event-height)+var(--event-gap))*3)] lg:min-h-[calc((var(--event-height)+var(--event-gap))*4)] px-1 py-0.5 sm:py-1",
10312
- ref: isReferenceCell ? contentRef : null,
10313
- children: [
10314
- sortEventsAgenda(allDayEvents).map((event, index) => {
10315
- const eventStart = getEventStartDate(event) ?? getEventEndDate(event) ?? /* @__PURE__ */ new Date();
10316
- const eventEnd = getEventEndDate(event) ?? getEventStartDate(event) ?? /* @__PURE__ */ new Date();
10317
- const isFirstDay = isSameDay(day, eventStart);
10318
- const isLastDay = isSameDay(day, eventEnd);
10319
- const isHidden = isMounted && visibleCount && index >= visibleCount;
10320
- if (!visibleCount) return null;
10321
- if (!isFirstDay) {
10322
- return /* @__PURE__ */ jsx(
10323
- "div",
10324
- {
10325
- "aria-hidden": isHidden ? "true" : void 0,
10326
- className: "aria-hidden:hidden",
10327
- children: /* @__PURE__ */ jsx(
10328
- EventItemAgenda,
10329
- {
10330
- event,
10331
- isFirstDay,
10332
- isLastDay,
10333
- onClick: (e) => handleEventClick(event, e),
10334
- view: "month",
10335
- children: /* @__PURE__ */ jsx("div", { className: "flex items-center gap-1 truncate text-[12px] text-foreground" })
10336
- }
10337
- )
10338
- },
10339
- `spanning-${event.id}-${day.toISOString().slice(0, 10)}`
10340
- );
10341
- }
10342
- const isMultiDay = !isLastDay;
10343
- return /* @__PURE__ */ jsx(
10344
- "div",
10345
- {
10346
- "aria-hidden": isHidden ? "true" : void 0,
10347
- className: "aria-hidden:hidden relative",
10348
- children: /* @__PURE__ */ jsx(
10349
- EventItemAgenda,
10578
+ /* @__PURE__ */ jsxs(
10579
+ "div",
10580
+ {
10581
+ ref: isReferenceCell ? contentRef : null,
10582
+ className: "min-h-[calc((var(--event-height)+var(--event-gap))*2)] sm:min-h-[calc((var(--event-height)+var(--event-gap))*3)] lg:min-h-[calc((var(--event-height)+var(--event-gap))*4)] px-1 py-0.5 sm:py-1",
10583
+ children: [
10584
+ Array.from({ length: dayMultiDayRowCount }).map(
10585
+ (_, si) => /* @__PURE__ */ jsx(
10586
+ "div",
10350
10587
  {
10351
- event,
10352
- isFirstDay,
10353
- isLastDay,
10354
- onClick: (e) => handleEventClick(event, e),
10355
- view: "month",
10356
- className: isMultiDay ? "overflow-visible" : "",
10357
- children: /* @__PURE__ */ jsxs("span", { className: "flex items-center gap-1 sm:gap-2 truncate text-[12px] text-foreground relative z-10", children: [
10358
- !event.allDay && /* @__PURE__ */ jsx("span", { className: "truncate font-normal opacity-80 text-[10px] sm:text-[11px] bg-white/10 px-1 py-0.5 rounded-full", children: format(eventStart, "HH:mm") }),
10359
- /* @__PURE__ */ jsx(
10360
- "span",
10361
- {
10362
- className: `font-medium text-xs sm:text-sm ${isMultiDay ? "whitespace-nowrap" : "truncate"}`,
10363
- children: event.title
10364
- }
10365
- )
10366
- ] })
10367
- }
10588
+ "aria-hidden": "true",
10589
+ className: "mt-[var(--event-gap)] h-[var(--event-height)] w-full",
10590
+ style: { opacity: 0, pointerEvents: "none" }
10591
+ },
10592
+ `spacer-${si}`
10368
10593
  )
10369
- },
10370
- event.id
10371
- );
10372
- }),
10373
- hasMore && /* @__PURE__ */ jsxs(PopoverBase, { modal: true, children: [
10374
- /* @__PURE__ */ jsx(PopoverTriggerBase, { asChild: true, children: /* @__PURE__ */ jsxs(
10375
- "button",
10376
- {
10377
- className: "mt-[var(--event-gap)] flex h-[var(--event-height)] w-full select-none items-center overflow-hidden px-2 text-left text-[10px] text-muted-foreground outline-none backdrop-blur-md rounded-md transition hover:bg-muted/60 hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 sm:text-xs",
10378
- onClick: (e) => e.stopPropagation(),
10379
- type: "button",
10380
- "aria-label": `Show ${remainingCount} more events on ${format(
10381
- day,
10382
- "PPP",
10383
- { locale: ptBR }
10384
- )}`,
10385
- children: [
10386
- /* @__PURE__ */ jsxs("span", { className: "font-medium", children: [
10387
- "+ ",
10388
- remainingCount
10389
- ] }),
10390
- /* @__PURE__ */ jsx("span", { className: "sr-only", children: " more" })
10391
- ]
10392
- }
10393
- ) }),
10394
- /* @__PURE__ */ jsx(
10395
- PopoverContentBase,
10396
- {
10397
- align: "center",
10398
- className: "max-w-52 p-3",
10399
- style: {
10400
- "--event-height": `${EventHeightAgenda}px`
10401
- },
10402
- children: /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
10403
- /* @__PURE__ */ jsx("div", { className: "font-medium text-sm", children: format(day, "EEE d", { locale: ptBR }) }),
10404
- /* @__PURE__ */ jsx("div", { className: "space-y-1", children: sortEventsAgenda(allEvents).map((event) => {
10405
- const eventStart = getEventStartDate(event) ?? getEventEndDate(event) ?? /* @__PURE__ */ new Date();
10406
- const eventEnd = getEventEndDate(event) ?? getEventStartDate(event) ?? /* @__PURE__ */ new Date();
10407
- const isFirstDay = isSameDay(day, eventStart);
10408
- const isLastDay = isSameDay(day, eventEnd);
10409
- return /* @__PURE__ */ jsx(
10594
+ ),
10595
+ singleEvents.map((event, index) => {
10596
+ if (!isMounted) return null;
10597
+ const isHidden = visibleAfterMultiday !== void 0 && index >= visibleAfterMultiday;
10598
+ const eventStart = getEventStartDate(event) ?? getEventEndDate(event) ?? /* @__PURE__ */ new Date();
10599
+ return /* @__PURE__ */ jsx(
10600
+ "div",
10601
+ {
10602
+ "aria-hidden": isHidden ? "true" : void 0,
10603
+ className: "aria-hidden:hidden",
10604
+ children: /* @__PURE__ */ jsx(
10410
10605
  EventItemAgenda,
10411
10606
  {
10412
10607
  event,
10413
- isFirstDay,
10414
- isLastDay,
10608
+ isFirstDay: true,
10609
+ isLastDay: true,
10415
10610
  onClick: (e) => handleEventClick(event, e),
10416
- view: "month"
10417
- },
10418
- event.id
10419
- );
10420
- }) })
10421
- ] })
10422
- }
10423
- )
10424
- ] })
10425
- ]
10426
- }
10427
- )
10428
- ]
10429
- }
10430
- )
10431
- },
10432
- day.toString()
10433
- );
10434
- })
10435
- },
10436
- `week-${weekIndex}`
10437
- )) }),
10611
+ view: "month",
10612
+ children: /* @__PURE__ */ jsxs("span", { className: "flex items-center gap-1 sm:gap-1.5 truncate text-[11px] relative z-10", children: [
10613
+ !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") }),
10614
+ /* @__PURE__ */ jsx("span", { className: "font-semibold truncate", children: event.title })
10615
+ ] })
10616
+ }
10617
+ )
10618
+ },
10619
+ event.id
10620
+ );
10621
+ })
10622
+ ]
10623
+ }
10624
+ ),
10625
+ hasMore && /* @__PURE__ */ jsxs(PopoverBase, { modal: true, children: [
10626
+ /* @__PURE__ */ jsx(PopoverTriggerBase, { asChild: true, children: /* @__PURE__ */ jsx(
10627
+ "button",
10628
+ {
10629
+ type: "button",
10630
+ onClick: (e) => e.stopPropagation(),
10631
+ "aria-label": `Mostrar mais ${remainingCount} eventos`,
10632
+ className: "mt-[var(--event-gap)] flex h-[var(--event-height)] w-full select-none items-center overflow-hidden px-2 text-left text-[10px] text-muted-foreground outline-none rounded-md transition hover:bg-muted/60 hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 sm:text-xs",
10633
+ children: /* @__PURE__ */ jsxs("span", { className: "font-semibold", children: [
10634
+ "+ ",
10635
+ remainingCount,
10636
+ " ",
10637
+ /* @__PURE__ */ jsx("span", { className: "hidden sm:inline", children: "mais" })
10638
+ ] })
10639
+ }
10640
+ ) }),
10641
+ /* @__PURE__ */ jsx(
10642
+ PopoverContentBase,
10643
+ {
10644
+ align: "center",
10645
+ className: "max-w-52 p-3",
10646
+ style: {
10647
+ "--event-height": `${EventHeightAgenda}px`
10648
+ },
10649
+ children: /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
10650
+ /* @__PURE__ */ jsx("p", { className: "font-semibold text-sm", children: format(day, "EEE d", { locale: ptBR }) }),
10651
+ /* @__PURE__ */ jsx("div", { className: "space-y-1", children: sortEventsAgenda(allEvents).map((event) => {
10652
+ const s = getEventStartDate(event) ?? getEventEndDate(event) ?? /* @__PURE__ */ new Date();
10653
+ const e2 = getEventEndDate(event) ?? getEventStartDate(event) ?? /* @__PURE__ */ new Date();
10654
+ return /* @__PURE__ */ jsx(
10655
+ EventItemAgenda,
10656
+ {
10657
+ event,
10658
+ isFirstDay: isSameDay(day, s),
10659
+ isLastDay: isSameDay(day, e2),
10660
+ onClick: (e) => handleEventClick(event, e),
10661
+ view: "month"
10662
+ },
10663
+ event.id
10664
+ );
10665
+ }) })
10666
+ ] })
10667
+ }
10668
+ )
10669
+ ] })
10670
+ ]
10671
+ }
10672
+ )
10673
+ },
10674
+ day.toString()
10675
+ );
10676
+ }),
10677
+ /* @__PURE__ */ jsx(
10678
+ MultiDayOverlay,
10679
+ {
10680
+ bars: multiDayBars,
10681
+ weekIndex,
10682
+ hoveredEventId,
10683
+ onHover: handleHover,
10684
+ onEventSelect
10685
+ }
10686
+ )
10687
+ ]
10688
+ },
10689
+ `week-${weekIndex}`
10690
+ );
10691
+ }) }),
10438
10692
  /* @__PURE__ */ jsx(
10439
10693
  UndatedEvents,
10440
10694
  {
@@ -10467,7 +10721,8 @@ function DraggableEvent({
10467
10721
  isFirstDay = true,
10468
10722
  isLastDay = true,
10469
10723
  "aria-hidden": ariaHidden,
10470
- draggable = true
10724
+ draggable = true,
10725
+ totalCols
10471
10726
  }) {
10472
10727
  const { activeId } = useCalendarDndAgenda();
10473
10728
  const elementRef = useRef(null);
@@ -10552,7 +10807,8 @@ function DraggableEvent({
10552
10807
  onMouseDown: handleMouseDown,
10553
10808
  onTouchStart: handleTouchStart,
10554
10809
  showTime,
10555
- view
10810
+ view,
10811
+ totalCols
10556
10812
  }
10557
10813
  )
10558
10814
  }
@@ -10566,14 +10822,10 @@ function WeekViewAgenda({
10566
10822
  showUndatedEvents
10567
10823
  }) {
10568
10824
  const days = useMemo(() => {
10569
- const weekStart2 = startOfWeek(currentDate, { weekStartsOn: 0 });
10825
+ const weekStart = startOfWeek(currentDate, { weekStartsOn: 0 });
10570
10826
  const weekEnd = endOfWeek(currentDate, { weekStartsOn: 0 });
10571
- return eachDayOfInterval({ end: weekEnd, start: weekStart2 });
10827
+ return eachDayOfInterval({ end: weekEnd, start: weekStart });
10572
10828
  }, [currentDate]);
10573
- const weekStart = useMemo(
10574
- () => startOfWeek(currentDate, { weekStartsOn: 0 }),
10575
- [currentDate]
10576
- );
10577
10829
  const hours = useMemo(() => {
10578
10830
  const dayStart = startOfDay(currentDate);
10579
10831
  return eachHourOfInterval({
@@ -10606,6 +10858,25 @@ function WeekViewAgenda({
10606
10858
  });
10607
10859
  });
10608
10860
  }, [events, days]);
10861
+ const trueAllDayEvents = useMemo(
10862
+ () => allDayEvents.filter((e) => e.allDay),
10863
+ [allDayEvents]
10864
+ );
10865
+ const multiDayTimedEvents = useMemo(
10866
+ () => allDayEvents.filter((e) => !e.allDay),
10867
+ [allDayEvents]
10868
+ );
10869
+ const rowH = EventHeightAgenda + EventGapAgenda;
10870
+ const allDayBarData = useMemo(() => {
10871
+ const bars = computeMultiDayBars(trueAllDayEvents, days);
10872
+ const maxSlot = bars.length > 0 ? Math.max(...bars.map((b) => b.slot)) : 0;
10873
+ return { bars, sectionH: (maxSlot + 1) * rowH + EventGapAgenda * 2 };
10874
+ }, [trueAllDayEvents, days, rowH]);
10875
+ const multiDayBarData = useMemo(() => {
10876
+ const bars = computeMultiDayBars(multiDayTimedEvents, days);
10877
+ const maxSlot = bars.length > 0 ? Math.max(...bars.map((b) => b.slot)) : 0;
10878
+ return { bars, sectionH: (maxSlot + 1) * rowH + EventGapAgenda * 2 };
10879
+ }, [multiDayTimedEvents, days, rowH]);
10609
10880
  const processedDayEvents = useMemo(() => {
10610
10881
  const result = days.map((day) => {
10611
10882
  const dayEvents = events.filter((event) => {
@@ -10626,56 +10897,69 @@ function WeekViewAgenda({
10626
10897
  const bDuration = differenceInMinutes(bEnd, bStart);
10627
10898
  return bDuration - aDuration;
10628
10899
  });
10629
- const positionedEvents = [];
10630
10900
  const dayStart = startOfDay(day);
10631
10901
  const columns = [];
10902
+ const layouts = [];
10632
10903
  for (const event of sortedEvents) {
10633
10904
  const eventStart = getEventStartDate(event) ?? getEventEndDate(event) ?? /* @__PURE__ */ new Date();
10634
- const eventEnd = getEventEndDate(event) ?? getEventStartDate(event) ?? /* @__PURE__ */ new Date();
10905
+ const rawEnd = getEventEndDate(event) ?? getEventStartDate(event) ?? /* @__PURE__ */ new Date();
10906
+ const eventEnd = rawEnd <= eventStart ? new Date(eventStart.getTime() + 30 * 60 * 1e3) : rawEnd;
10635
10907
  const adjustedStart = isSameDay(day, eventStart) ? eventStart : dayStart;
10636
10908
  const adjustedEnd = isSameDay(day, eventEnd) ? eventEnd : addHours(dayStart, 24);
10637
10909
  const startHour = getHours(adjustedStart) + getMinutes(adjustedStart) / 60;
10638
10910
  const endHour = getHours(adjustedEnd) + getMinutes(adjustedEnd) / 60;
10639
10911
  const top = (startHour - StartHour) * WeekCellsHeightAgenda;
10640
- const height = (endHour - startHour) * WeekCellsHeightAgenda;
10641
- let columnIndex = 0;
10642
- let placed = false;
10643
- while (!placed) {
10644
- const col = columns[columnIndex] || [];
10645
- if (col.length === 0) {
10646
- columns[columnIndex] = col;
10647
- placed = true;
10648
- } else {
10649
- const overlaps = col.some((c) => {
10650
- const cStart = getEventStartDate(c.event) ?? getEventEndDate(c.event) ?? /* @__PURE__ */ new Date();
10651
- const cEnd = getEventEndDate(c.event) ?? getEventStartDate(c.event) ?? /* @__PURE__ */ new Date();
10652
- return areIntervalsOverlapping(
10653
- { end: adjustedEnd, start: adjustedStart },
10654
- { end: cEnd, start: cStart }
10655
- );
10656
- });
10657
- if (!overlaps) {
10658
- placed = true;
10659
- } else {
10660
- columnIndex++;
10661
- }
10662
- }
10912
+ const height = Math.max(
10913
+ (endHour - startHour) * WeekCellsHeightAgenda,
10914
+ 24
10915
+ );
10916
+ let col = 0;
10917
+ while (true) {
10918
+ const colSlots = columns[col] ?? [];
10919
+ const hasConflict = colSlots.some(
10920
+ (slot) => areIntervalsOverlapping(
10921
+ { start: adjustedStart, end: adjustedEnd },
10922
+ { start: slot.start, end: slot.end },
10923
+ { inclusive: false }
10924
+ )
10925
+ );
10926
+ if (!hasConflict) break;
10927
+ col++;
10663
10928
  }
10664
- const currentColumn = columns[columnIndex] || [];
10665
- columns[columnIndex] = currentColumn;
10666
- currentColumn.push({ end: adjustedEnd, event });
10667
- const width = columnIndex === 0 ? 1 : 0.9;
10668
- const left = columnIndex === 0 ? 0 : columnIndex * 0.1;
10669
- positionedEvents.push({
10929
+ if (!columns[col]) columns[col] = [];
10930
+ columns[col].push({ start: adjustedStart, end: adjustedEnd });
10931
+ layouts.push({
10670
10932
  event,
10671
- height,
10672
- left,
10933
+ adjustedStart,
10934
+ adjustedEnd,
10673
10935
  top,
10674
- width,
10675
- zIndex: 10 + columnIndex
10936
+ height,
10937
+ col,
10938
+ totalCols: 0
10676
10939
  });
10677
10940
  }
10678
- return positionedEvents;
10941
+ for (const layout of layouts) {
10942
+ let maxCol = layout.col;
10943
+ for (const other of layouts) {
10944
+ if (other === layout) continue;
10945
+ if (areIntervalsOverlapping(
10946
+ { start: layout.adjustedStart, end: layout.adjustedEnd },
10947
+ { start: other.adjustedStart, end: other.adjustedEnd },
10948
+ { inclusive: false }
10949
+ )) {
10950
+ maxCol = Math.max(maxCol, other.col);
10951
+ }
10952
+ }
10953
+ layout.totalCols = maxCol + 1;
10954
+ }
10955
+ return layouts.map(({ event, top, height, col, totalCols }) => ({
10956
+ event,
10957
+ top,
10958
+ height,
10959
+ left: col / totalCols,
10960
+ width: 1 / totalCols,
10961
+ zIndex: 10 + col
10962
+ }));
10679
10963
  });
10680
10964
  return result;
10681
10965
  }, [days, events]);
@@ -10685,178 +10969,476 @@ function WeekViewAgenda({
10685
10969
  };
10686
10970
  const showAllDaySection = allDayEvents.length > 0;
10687
10971
  const { currentTimePosition, currentTimeVisible } = useCurrentTimeIndicatorAgenda(currentDate, "week");
10688
- return /* @__PURE__ */ jsxs("div", { className: "flex h-full flex-col", "data-slot": "week-view", children: [
10689
- /* @__PURE__ */ jsxs("div", { className: "sticky top-0 z-30 grid grid-cols-8 border-border/70 border-b bg-background", children: [
10690
- /* @__PURE__ */ jsx("div", { className: "py-2 text-center text-muted-foreground/70 text-sm", children: /* @__PURE__ */ jsx("span", { className: "max-[479px]:sr-only", children: format(/* @__PURE__ */ new Date(), "O") }) }),
10691
- days.map((day) => /* @__PURE__ */ jsxs(
10692
- "div",
10693
- {
10694
- className: "py-2 text-center text-muted-foreground/70 text-sm data-today:font-medium data-today:text-foreground",
10695
- "data-today": isToday(day) || void 0,
10696
- children: [
10697
- /* @__PURE__ */ jsxs("span", { "aria-hidden": "true", className: "sm:hidden", children: [
10698
- format(day, "EEE", { locale: ptBR })[0],
10699
- " ",
10700
- format(day, "d", { locale: ptBR })
10701
- ] }),
10702
- /* @__PURE__ */ jsx("span", { className: "max-sm:hidden", children: format(day, "EEE dd", { locale: ptBR }) })
10703
- ]
10704
- },
10705
- day.toString()
10706
- ))
10707
- ] }),
10708
- showAllDaySection && /* @__PURE__ */ jsx("div", { className: "border-border/70 border-b bg-muted/50", children: /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-8", children: [
10709
- /* @__PURE__ */ jsx("div", { className: "relative border-border/70 border-r", children: /* @__PURE__ */ jsx("span", { className: "absolute bottom-0 left-0 h-6 w-16 max-w-full pe-2 text-right text-[10px] text-muted-foreground/70 sm:pe-4 sm:text-xs", children: "Todo Dia" }) }),
10710
- days.map((day, dayIndex) => {
10711
- const dayAllDayEvents = allDayEvents.filter((event) => {
10712
- const eventStart = getEventStartDate(event);
10713
- const eventEnd = getEventEndDate(event) ?? getEventStartDate(event);
10714
- if (!eventStart && !eventEnd) return false;
10715
- return eventStart && isSameDay(day, eventStart) || eventStart && eventEnd && day > eventStart && day < eventEnd || eventEnd && isSameDay(day, eventEnd);
10716
- });
10717
- return /* @__PURE__ */ jsx(
10972
+ return /* @__PURE__ */ jsxs("div", { className: "flex h-full flex-col overflow-hidden", "data-slot": "week-view", children: [
10973
+ /* @__PURE__ */ jsx("div", { className: "flex-1 overflow-auto", children: /* @__PURE__ */ jsxs("div", { className: "min-w-[600px] sm:min-w-full flex flex-col h-full", children: [
10974
+ /* @__PURE__ */ jsxs("div", { className: "sticky top-0 z-30 grid grid-cols-8 border-border/70 border-b bg-background", children: [
10975
+ /* @__PURE__ */ jsx("div", { className: "py-2 text-center text-muted-foreground/70 text-[10px] sm:text-sm", children: /* @__PURE__ */ jsx("span", { className: "max-[479px]:sr-only", children: format(/* @__PURE__ */ new Date(), "O") }) }),
10976
+ days.map((day) => /* @__PURE__ */ jsxs(
10718
10977
  "div",
10719
10978
  {
10720
- className: "relative border-border/70 border-r p-1 last:border-r-0",
10979
+ className: "py-2 text-center text-muted-foreground/70 text-[10px] sm:text-sm data-today:font-medium data-today:text-foreground",
10721
10980
  "data-today": isToday(day) || void 0,
10722
- children: dayAllDayEvents.map((event) => {
10723
- const eventStart = getEventStartDate(event);
10724
- const eventEnd = getEventEndDate(event) ?? getEventStartDate(event);
10725
- const isFirstDay = eventStart ? isSameDay(day, eventStart) : false;
10726
- const isLastDay = eventEnd ? isSameDay(day, eventEnd) : false;
10727
- const isFirstVisibleDay = eventStart ? dayIndex === 0 && isBefore(eventStart, weekStart) : false;
10728
- const shouldShowTitle = isFirstDay || isFirstVisibleDay;
10729
- return /* @__PURE__ */ jsx(
10730
- EventItemAgenda,
10731
- {
10732
- event,
10733
- isFirstDay,
10734
- isLastDay,
10735
- onClick: (e) => handleEventClick(event, e),
10736
- view: "month",
10737
- children: /* @__PURE__ */ jsx(
10738
- "div",
10739
- {
10740
- "aria-hidden": !shouldShowTitle,
10741
- className: cn(
10742
- "truncate",
10743
- !shouldShowTitle && "invisible"
10744
- ),
10745
- children: event.title
10746
- }
10747
- )
10748
- },
10749
- `spanning-${event.id}`
10750
- );
10751
- })
10981
+ children: [
10982
+ /* @__PURE__ */ jsxs("span", { "aria-hidden": "true", className: "sm:hidden", children: [
10983
+ format(day, "EEE", { locale: ptBR })[0],
10984
+ " ",
10985
+ format(day, "d", { locale: ptBR })
10986
+ ] }),
10987
+ /* @__PURE__ */ jsx("span", { className: "hidden sm:inline md:hidden", children: format(day, "EEE d", { locale: ptBR }) }),
10988
+ /* @__PURE__ */ jsx("span", { className: "max-md:hidden", children: format(day, "EEE dd", { locale: ptBR }) })
10989
+ ]
10752
10990
  },
10753
10991
  day.toString()
10754
- );
10755
- })
10756
- ] }) }),
10757
- /* @__PURE__ */ jsxs("div", { className: "grid flex-1 grid-cols-8 overflow-hidden", children: [
10758
- /* @__PURE__ */ jsx("div", { className: "grid auto-cols-fr border-border/70 border-r", children: hours.map((hour, index) => /* @__PURE__ */ jsx(
10759
- "div",
10760
- {
10761
- className: "relative min-h-[var(--week-cells-height)] border-border/70 border-b last:border-b-0",
10762
- children: index > 0 && /* @__PURE__ */ jsx("span", { className: "-top-3 absolute left-0 flex h-6 w-16 max-w-full items-center justify-end bg-background pe-2 text-[10px] text-muted-foreground/70 sm:pe-4 sm:text-xs", children: format(hour, "HH:mm") })
10763
- },
10764
- hour.toString()
10765
- )) }),
10766
- days.map((day, dayIndex) => /* @__PURE__ */ jsxs(
10767
- "div",
10768
- {
10769
- className: "relative grid auto-cols-fr border-border/70 border-r last:border-r-0",
10770
- "data-today": isToday(day) || void 0,
10771
- children: [
10772
- (processedDayEvents[dayIndex] ?? []).map((positionedEvent) => /* @__PURE__ */ jsx(
10773
- "div",
10774
- {
10775
- className: "absolute z-10 px-0.5",
10776
- onClick: (e) => e.stopPropagation(),
10777
- style: {
10778
- height: `${positionedEvent.height}px`,
10779
- left: `${positionedEvent.left * 100}%`,
10780
- top: `${positionedEvent.top}px`,
10781
- width: `${positionedEvent.width * 100}%`,
10782
- zIndex: positionedEvent.zIndex
10783
- },
10784
- children: /* @__PURE__ */ jsx("div", { className: "size-full", children: /* @__PURE__ */ jsx(
10785
- DraggableEvent,
10992
+ ))
10993
+ ] }),
10994
+ showAllDaySection && /* @__PURE__ */ jsxs("div", { className: "border-border/70 border-b bg-muted/50", children: [
10995
+ trueAllDayEvents.length > 0 && /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-8", children: [
10996
+ /* @__PURE__ */ jsx("div", { className: "relative border-border/70 border-r", children: /* @__PURE__ */ jsx("span", { className: "absolute bottom-0 left-0 h-6 w-16 max-w-full pe-2 text-right text-[10px] text-muted-foreground/70 sm:pe-4 sm:text-xs", children: "Todo dia" }) }),
10997
+ /* @__PURE__ */ jsxs(
10998
+ "div",
10999
+ {
11000
+ className: "col-span-7 relative",
11001
+ style: { height: allDayBarData.sectionH },
11002
+ children: [
11003
+ /* @__PURE__ */ jsx("div", { className: "absolute inset-0 grid grid-cols-7 pointer-events-none", children: days.map((day) => /* @__PURE__ */ jsx(
11004
+ "div",
10786
11005
  {
10787
- event: positionedEvent.event,
10788
- height: positionedEvent.height,
10789
- onClick: (e) => handleEventClick(positionedEvent.event, e),
10790
- draggable: false,
10791
- showTime: true,
10792
- view: "week"
10793
- }
10794
- ) })
10795
- },
10796
- positionedEvent.event.id
10797
- )),
10798
- currentTimeVisible && isToday(day) && /* @__PURE__ */ jsx(
10799
- "div",
10800
- {
10801
- className: "pointer-events-none absolute right-0 left-0 z-20",
10802
- style: { top: `${currentTimePosition}%` },
10803
- children: /* @__PURE__ */ jsxs("div", { className: "relative flex items-center", children: [
10804
- /* @__PURE__ */ jsx("div", { className: "-left-1 absolute h-2 w-2 rounded-full bg-primary" }),
10805
- /* @__PURE__ */ jsx("div", { className: "h-[2px] w-full bg-primary" })
10806
- ] })
10807
- }
11006
+ className: "border-r last:border-r-0 border-border/70",
11007
+ "data-today": isToday(day) || void 0
11008
+ },
11009
+ day.toString()
11010
+ )) }),
11011
+ allDayBarData.bars.map((bar) => {
11012
+ const {
11013
+ event,
11014
+ colStart,
11015
+ colSpan,
11016
+ isFirstDay,
11017
+ isLastDay,
11018
+ slot
11019
+ } = bar;
11020
+ const showTitle = isFirstDay || !isFirstDay && colStart === 0;
11021
+ return /* @__PURE__ */ jsx(
11022
+ "div",
11023
+ {
11024
+ className: "absolute px-0.5",
11025
+ style: {
11026
+ left: `calc(${colStart / 7 * 100}% + 2px)`,
11027
+ width: `calc(${colSpan / 7 * 100}% - 4px)`,
11028
+ top: EventGapAgenda + slot * rowH,
11029
+ height: EventHeightAgenda
11030
+ },
11031
+ children: /* @__PURE__ */ jsx(
11032
+ EventItemAgenda,
11033
+ {
11034
+ event,
11035
+ isFirstDay,
11036
+ isLastDay,
11037
+ onClick: (e) => {
11038
+ e.stopPropagation();
11039
+ handleEventClick(event, e);
11040
+ },
11041
+ view: "month",
11042
+ className: "h-full",
11043
+ children: /* @__PURE__ */ jsxs("span", { className: "flex items-center gap-1 min-w-0 w-full", children: [
11044
+ !isFirstDay && colStart === 0 && /* @__PURE__ */ jsx("span", { className: "shrink-0 text-[11px] font-bold opacity-60", children: /* @__PURE__ */ jsx(CaretLeftIcon$1, {}) }),
11045
+ showTitle && /* @__PURE__ */ jsx("span", { className: "truncate text-xs font-medium", children: event.title }),
11046
+ !isLastDay && colStart + colSpan === 7 && /* @__PURE__ */ jsx("span", { className: "shrink-0 ml-auto text-[11px] font-bold opacity-60", children: /* @__PURE__ */ jsx(CaretRightIcon$1, {}) })
11047
+ ] })
11048
+ }
11049
+ )
11050
+ },
11051
+ event.id
11052
+ );
11053
+ })
11054
+ ]
11055
+ }
11056
+ )
11057
+ ] }),
11058
+ multiDayTimedEvents.length > 0 && /* @__PURE__ */ jsxs(
11059
+ "div",
11060
+ {
11061
+ className: cn(
11062
+ "grid grid-cols-8",
11063
+ trueAllDayEvents.length > 0 && "border-t border-border/40"
10808
11064
  ),
10809
- hours.map((hour) => {
10810
- const hourValue = getHours(hour);
10811
- return /* @__PURE__ */ jsx(
11065
+ children: [
11066
+ /* @__PURE__ */ jsx("div", { className: "relative border-border/70 border-r", children: /* @__PURE__ */ jsx("span", { className: "absolute bottom-0 left-0 h-6 w-16 max-w-full px-1 text-muted-foreground/70 sm:text-xs", children: "Evento" }) }),
11067
+ /* @__PURE__ */ jsxs(
10812
11068
  "div",
10813
11069
  {
10814
- className: "relative min-h-[var(--week-cells-height)] border-border/70 border-b last:border-b-0",
10815
- children: [0, 1, 2, 3].map((quarter) => {
10816
- const quarterHourTime = hourValue + quarter * 0.25;
10817
- return /* @__PURE__ */ jsx(
10818
- DroppableCellAgenda,
11070
+ className: "col-span-7 relative",
11071
+ style: { height: multiDayBarData.sectionH },
11072
+ children: [
11073
+ /* @__PURE__ */ jsx("div", { className: "absolute inset-0 grid grid-cols-7 pointer-events-none", children: days.map((day) => /* @__PURE__ */ jsx(
11074
+ "div",
10819
11075
  {
10820
- className: cn(
10821
- "absolute h-[calc(var(--week-cells-height)/4)] w-full",
10822
- quarter === 0 && "top-0",
10823
- quarter === 1 && "top-[calc(var(--week-cells-height)/4)]",
10824
- quarter === 2 && "top-[calc(var(--week-cells-height)/4*2)]",
10825
- quarter === 3 && "top-[calc(var(--week-cells-height)/4*)]"
10826
- ),
10827
- date: day,
10828
- id: `week-cell-${day.toISOString()}-${quarterHourTime}`,
10829
- onClick: () => {
10830
- const startTime = new Date(day);
10831
- startTime.setHours(hourValue);
10832
- startTime.setMinutes(quarter * 15);
10833
- if (onEventCreate) onEventCreate(startTime);
11076
+ className: "border-r last:border-r-0 border-border/70",
11077
+ "data-today": isToday(day) || void 0
11078
+ },
11079
+ day.toString()
11080
+ )) }),
11081
+ multiDayBarData.bars.map((bar) => {
11082
+ const {
11083
+ event,
11084
+ colStart,
11085
+ colSpan,
11086
+ isFirstDay,
11087
+ isLastDay,
11088
+ slot
11089
+ } = bar;
11090
+ const eventStart = getEventStartDate(event) ?? /* @__PURE__ */ new Date();
11091
+ const showTitle = isFirstDay || !isFirstDay && colStart === 0;
11092
+ return /* @__PURE__ */ jsx(
11093
+ "div",
11094
+ {
11095
+ className: "absolute px-0.5",
11096
+ style: {
11097
+ left: `calc(${colStart / 7 * 100}% + 2px)`,
11098
+ width: `calc(${colSpan / 7 * 100}% - 4px)`,
11099
+ top: EventGapAgenda + slot * rowH,
11100
+ height: EventHeightAgenda
11101
+ },
11102
+ children: /* @__PURE__ */ jsx(
11103
+ EventItemAgenda,
11104
+ {
11105
+ event,
11106
+ isFirstDay,
11107
+ isLastDay,
11108
+ onClick: (e) => {
11109
+ e.stopPropagation();
11110
+ handleEventClick(event, e);
11111
+ },
11112
+ view: "month",
11113
+ className: "h-full border-dashed",
11114
+ children: /* @__PURE__ */ jsxs("span", { className: "flex items-center gap-1 min-w-0 w-full", children: [
11115
+ !isFirstDay && colStart === 0 && /* @__PURE__ */ jsx("span", { className: "shrink-0 text-[11px] font-bold opacity-60", children: /* @__PURE__ */ jsx(CaretLeftIcon$1, {}) }),
11116
+ showTitle && /* @__PURE__ */ jsxs(Fragment, { children: [
11117
+ 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") }),
11118
+ /* @__PURE__ */ jsx("span", { className: "truncate text-xs font-medium", children: event.title }),
11119
+ isFirstDay && (() => {
11120
+ const evStart = getEventStartDate(event);
11121
+ const evEnd = getEventEndDate(event);
11122
+ if (!evStart || !evEnd) return null;
11123
+ const d = Math.round(
11124
+ (evEnd.getTime() - evStart.getTime()) / 864e5
11125
+ ) + 1;
11126
+ if (d < 2) return null;
11127
+ return /* @__PURE__ */ jsxs("span", { className: "shrink-0 inline-flex items-end font-bold leading-none px-1 py-0.5 text-[10px]", children: [
11128
+ d,
11129
+ "d"
11130
+ ] });
11131
+ })()
11132
+ ] }),
11133
+ !isLastDay && colStart + colSpan === 7 && /* @__PURE__ */ jsx("span", { className: "shrink-0 ml-auto text-[11px] font-bold opacity-60", children: /* @__PURE__ */ jsx(CaretRightIcon$1, {}) })
11134
+ ] })
11135
+ }
11136
+ )
10834
11137
  },
10835
- time: quarterHourTime
11138
+ event.id
11139
+ );
11140
+ })
11141
+ ]
11142
+ }
11143
+ )
11144
+ ]
11145
+ }
11146
+ )
11147
+ ] }),
11148
+ /* @__PURE__ */ jsxs("div", { className: "grid flex-1 grid-cols-8", children: [
11149
+ /* @__PURE__ */ jsx("div", { className: "grid auto-cols-fr border-border/70 border-r", children: hours.map((hour, index) => /* @__PURE__ */ jsx(
11150
+ "div",
11151
+ {
11152
+ className: "relative min-h-[var(--week-cells-height)] border-border/70 border-b last:border-b-0",
11153
+ children: index > 0 && /* @__PURE__ */ jsx("span", { className: "-top-3 absolute left-0 flex h-6 w-16 max-w-full items-center justify-end bg-background pe-1 sm:pe-4 text-[9px] sm:text-xs text-muted-foreground/70", children: format(hour, "HH:mm") })
11154
+ },
11155
+ hour.toString()
11156
+ )) }),
11157
+ days.map((day, dayIndex) => /* @__PURE__ */ jsxs(
11158
+ "div",
11159
+ {
11160
+ className: "relative grid auto-cols-fr border-border/70 border-r last:border-r-0",
11161
+ "data-today": isToday(day) || void 0,
11162
+ children: [
11163
+ (processedDayEvents[dayIndex] ?? []).map((positionedEvent) => {
11164
+ const evStart = getEventStartDate(positionedEvent.event);
11165
+ const evEnd = getEventEndDate(positionedEvent.event);
11166
+ const timeLabel = evStart ? evEnd ? `${format(evStart, "HH:mm")} \u2013 ${format(evEnd, "HH:mm")}` : format(evStart, "HH:mm") : void 0;
11167
+ return /* @__PURE__ */ jsx(TooltipProviderBase, { children: /* @__PURE__ */ jsxs(TooltipBase, { delayDuration: 250, children: [
11168
+ /* @__PURE__ */ jsx(
11169
+ "div",
11170
+ {
11171
+ className: "absolute z-10 px-0.5",
11172
+ onClick: (e) => e.stopPropagation(),
11173
+ style: {
11174
+ height: `${positionedEvent.height}px`,
11175
+ left: `${positionedEvent.left * 100}%`,
11176
+ top: `${positionedEvent.top}px`,
11177
+ width: `${positionedEvent.width * 100}%`,
11178
+ zIndex: positionedEvent.zIndex
10836
11179
  },
10837
- `${hour.toString()}-${quarter}`
10838
- );
10839
- })
10840
- },
10841
- hour.toString()
10842
- );
10843
- })
10844
- ]
10845
- },
10846
- day.toString()
10847
- ))
10848
- ] }),
11180
+ children: /* @__PURE__ */ jsx(TooltipTriggerBase, { asChild: true, children: /* @__PURE__ */ jsx("div", { className: "size-full", children: /* @__PURE__ */ jsx(
11181
+ DraggableEvent,
11182
+ {
11183
+ event: positionedEvent.event,
11184
+ height: positionedEvent.height,
11185
+ onClick: (e) => handleEventClick(positionedEvent.event, e),
11186
+ draggable: false,
11187
+ showTime: true,
11188
+ view: "week",
11189
+ totalCols: positionedEvent.totalCols
11190
+ }
11191
+ ) }) })
11192
+ }
11193
+ ),
11194
+ /* @__PURE__ */ jsxs(
11195
+ TooltipContentBase,
11196
+ {
11197
+ side: "right",
11198
+ sideOffset: 6,
11199
+ className: "max-w-[220px] space-y-0.5",
11200
+ children: [
11201
+ /* @__PURE__ */ jsx("p", { className: "font-semibold text-sm leading-snug", children: positionedEvent.event.title }),
11202
+ timeLabel && /* @__PURE__ */ jsx("p", { className: "text-xs opacity-90", children: timeLabel }),
11203
+ positionedEvent.event.location && /* @__PURE__ */ jsxs("p", { className: "text-xs flex items-center gap-2", children: [
11204
+ /* @__PURE__ */ jsx(MapPinIcon$1, { size: 15 }),
11205
+ " ",
11206
+ positionedEvent.event.location
11207
+ ] }),
11208
+ positionedEvent.event.description && /* @__PURE__ */ jsx("p", { className: "text-xs opacity-75 line-clamp-2", children: positionedEvent.event.description })
11209
+ ]
11210
+ }
11211
+ )
11212
+ ] }) }, positionedEvent.event.id);
11213
+ }),
11214
+ currentTimeVisible && isToday(day) && /* @__PURE__ */ jsx(
11215
+ "div",
11216
+ {
11217
+ className: "pointer-events-none absolute right-0 left-0 z-20",
11218
+ style: { top: `${currentTimePosition}%` },
11219
+ children: /* @__PURE__ */ jsxs("div", { className: "relative flex items-center", children: [
11220
+ /* @__PURE__ */ jsx("div", { className: "-left-1 absolute h-2 w-2 rounded-full bg-primary" }),
11221
+ /* @__PURE__ */ jsx("div", { className: "h-[2px] w-full bg-primary" })
11222
+ ] })
11223
+ }
11224
+ ),
11225
+ hours.map((hour) => {
11226
+ const hourValue = getHours(hour);
11227
+ return /* @__PURE__ */ jsx(
11228
+ "div",
11229
+ {
11230
+ className: "relative min-h-[var(--week-cells-height)] border-border/70 border-b last:border-b-0",
11231
+ children: [0, 1, 2, 3].map((quarter) => {
11232
+ const quarterHourTime = hourValue + quarter * 0.25;
11233
+ return /* @__PURE__ */ jsx(
11234
+ DroppableCellAgenda,
11235
+ {
11236
+ className: cn(
11237
+ "absolute h-[calc(var(--week-cells-height)/4)] w-full",
11238
+ quarter === 0 && "top-0",
11239
+ quarter === 1 && "top-[calc(var(--week-cells-height)/4)]",
11240
+ quarter === 2 && "top-[calc(var(--week-cells-height)/4*2)]",
11241
+ quarter === 3 && "top-[calc(var(--week-cells-height)/4*3)]"
11242
+ ),
11243
+ date: day,
11244
+ id: `week-cell-${day.toISOString()}-${quarterHourTime}`,
11245
+ onClick: () => {
11246
+ const startTime = new Date(day);
11247
+ startTime.setHours(hourValue);
11248
+ startTime.setMinutes(quarter * 15);
11249
+ if (onEventCreate) onEventCreate(startTime);
11250
+ },
11251
+ time: quarterHourTime
11252
+ },
11253
+ `${hour.toString()}-${quarter}`
11254
+ );
11255
+ })
11256
+ },
11257
+ hour.toString()
11258
+ );
11259
+ })
11260
+ ]
11261
+ },
11262
+ day.toString()
11263
+ ))
11264
+ ] })
11265
+ ] }) }),
10849
11266
  /* @__PURE__ */ jsx(
10850
11267
  UndatedEvents,
10851
11268
  {
10852
11269
  events,
10853
11270
  onEventSelect,
10854
11271
  show: showUndatedEvents,
10855
- className: "my-"
11272
+ className: "my-4"
10856
11273
  }
10857
11274
  )
10858
11275
  ] });
10859
11276
  }
11277
+ var colorBannerMap = {
11278
+ sky: "from-sky-400 to-sky-500",
11279
+ amber: "from-amber-400 to-amber-500",
11280
+ violet: "from-violet-400 to-violet-500",
11281
+ rose: "from-rose-400 to-rose-500",
11282
+ emerald: "from-emerald-400 to-emerald-500",
11283
+ orange: "from-orange-400 to-orange-500",
11284
+ green: "from-green-400 to-green-500",
11285
+ blue: "from-blue-400 to-blue-500",
11286
+ red: "from-red-400 to-red-500",
11287
+ purple: "from-purple-400 to-purple-500",
11288
+ indigo: "from-indigo-400 to-indigo-500",
11289
+ teal: "from-teal-400 to-teal-500",
11290
+ pink: "from-pink-400 to-pink-500",
11291
+ cyan: "from-cyan-400 to-cyan-500",
11292
+ lime: "from-lime-400 to-lime-500",
11293
+ fuchsia: "from-fuchsia-400 to-fuchsia-500"
11294
+ };
11295
+ function formatDuration2(minutes) {
11296
+ if (minutes <= 0) return "";
11297
+ const h = Math.floor(minutes / 60);
11298
+ const m = minutes % 60;
11299
+ if (h === 0) return `${m}min`;
11300
+ if (m === 0) return `${h}h`;
11301
+ return `${h}h ${m}min`;
11302
+ }
11303
+ function formatDateFull(date) {
11304
+ return format(date, "EEE',' d 'de' MMMM 'de' yyyy", { locale: ptBR });
11305
+ }
11306
+ function capitalize(s) {
11307
+ return s ? s.charAt(0).toUpperCase() + s.slice(1) : s;
11308
+ }
11309
+ function EventDetailModalAgenda({
11310
+ event,
11311
+ onClose
11312
+ }) {
11313
+ const [open, setOpen] = useState(true);
11314
+ if (!event) return null;
11315
+ const color = event.color ?? "sky";
11316
+ const bannerGradient = colorBannerMap[color] ?? colorBannerMap.sky;
11317
+ const startDate = getEventStartDate(event);
11318
+ const endDate = getEventEndDate(event);
11319
+ const isMultiDay = isMultiDayEventAgenda(event);
11320
+ const durationMinutes = startDate && endDate ? differenceInMinutes(endDate, startDate) : 0;
11321
+ const dateSection = (() => {
11322
+ if (!startDate) {
11323
+ return { primary: "Sem data definida", secondary: null, isAllDay: false };
11324
+ }
11325
+ if (event.allDay) {
11326
+ if (isMultiDay && endDate && !isSameDay(startDate, endDate)) {
11327
+ return {
11328
+ primary: `${capitalize(formatDateFull(startDate))}`,
11329
+ secondary: `${capitalize(formatDateFull(endDate))}`,
11330
+ isAllDay: true
11331
+ };
11332
+ }
11333
+ return {
11334
+ primary: capitalize(formatDateFull(startDate)),
11335
+ secondary: null,
11336
+ isAllDay: true
11337
+ };
11338
+ }
11339
+ if (isMultiDay && endDate) {
11340
+ const startStr = capitalize(
11341
+ format(startDate, "d MMM yyyy, HH:mm", { locale: ptBR })
11342
+ );
11343
+ const endStr = capitalize(
11344
+ format(endDate, "d MMM yyyy, HH:mm", { locale: ptBR })
11345
+ );
11346
+ return { primary: startStr, secondary: endStr, isAllDay: false };
11347
+ }
11348
+ const dateStr = capitalize(formatDateFull(startDate));
11349
+ const timeStr = endDate ? `${format(startDate, "HH:mm")} \u2013 ${format(endDate, "HH:mm")}` : format(startDate, "HH:mm");
11350
+ return { primary: dateStr, secondary: timeStr, isAllDay: false };
11351
+ })();
11352
+ return /* @__PURE__ */ jsx(
11353
+ DialogBase,
11354
+ {
11355
+ open,
11356
+ onOpenChange: (v) => {
11357
+ setOpen(v);
11358
+ if (!v) onClose?.();
11359
+ },
11360
+ children: /* @__PURE__ */ jsxs(DialogContentBase, { className: "p-0 overflow-hidden gap-0 border-none shadow-xl sm:max-w-md", children: [
11361
+ /* @__PURE__ */ jsxs(
11362
+ "div",
11363
+ {
11364
+ className: cn(
11365
+ "relative bg-gradient-to-tl w-full flex flex-col justify-end px-6 pt-12 pb-8 select-none transition-all duration-300",
11366
+ bannerGradient
11367
+ ),
11368
+ children: [
11369
+ /* @__PURE__ */ jsx("div", { className: "absolute top-4 left-6 flex items-center gap-2", children: dateSection.isAllDay ? /* @__PURE__ */ jsxs(Badge, { className: "bg-white/20 text-white backdrop-blur-md", children: [
11370
+ /* @__PURE__ */ jsx(SunIcon, { size: 12, weight: "bold" }),
11371
+ "Dia todo"
11372
+ ] }) : isMultiDay ? /* @__PURE__ */ jsxs(Badge, { className: "bg-white/20 text-white backdrop-blur-md", children: [
11373
+ /* @__PURE__ */ jsx(CalendarDotsIcon, { size: 12, weight: "bold" }),
11374
+ "Multi-dia"
11375
+ ] }) : durationMinutes > 0 ? /* @__PURE__ */ jsxs(Badge, { className: "bg-white/20 text-white backdrop-blur-md", children: [
11376
+ /* @__PURE__ */ jsx(ClockIcon, { size: 12, weight: "bold" }),
11377
+ formatDuration2(durationMinutes)
11378
+ ] }) : null }),
11379
+ /* @__PURE__ */ jsx("h2", { className: "text-2xl sm:text-3xl font-bold text-white leading-tight tracking-tight drop-shadow-md", children: event.title })
11380
+ ]
11381
+ }
11382
+ ),
11383
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-6 px-6 py-8 bg-background", children: [
11384
+ /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-4", children: [
11385
+ /* @__PURE__ */ jsx("div", { className: "p-2 rounded-lg bg-muted/50 border border-border", children: /* @__PURE__ */ jsx(
11386
+ CalendarDotsIcon,
11387
+ {
11388
+ size: 20,
11389
+ weight: "duotone",
11390
+ className: "text-primary"
11391
+ }
11392
+ ) }),
11393
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1", children: [
11394
+ /* @__PURE__ */ jsx("span", { className: "text-sm font-semibold text-foreground leading-none", children: dateSection.primary }),
11395
+ dateSection.secondary && /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2 text-sm text-muted-foreground mt-0.5", children: isMultiDay && !event.allDay || isMultiDay && dateSection.isAllDay ? /* @__PURE__ */ jsxs(Fragment, { children: [
11396
+ /* @__PURE__ */ jsx(
11397
+ ArrowRightIcon$1,
11398
+ {
11399
+ size: 12,
11400
+ className: "shrink-0 opacity-70"
11401
+ }
11402
+ ),
11403
+ /* @__PURE__ */ jsx("span", { className: "font-medium", children: dateSection.secondary })
11404
+ ] }) : /* @__PURE__ */ jsx("span", { className: "font-medium text-foreground/70", children: dateSection.secondary }) })
11405
+ ] })
11406
+ ] }),
11407
+ /* @__PURE__ */ jsx(SeparatorBase, { className: "opacity-50" }),
11408
+ event.location && /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-4", children: [
11409
+ /* @__PURE__ */ jsx("div", { className: "p-2 rounded-lg bg-muted/50 border border-border", children: /* @__PURE__ */ jsx(
11410
+ MapPinIcon,
11411
+ {
11412
+ size: 20,
11413
+ weight: "duotone",
11414
+ className: "text-primary"
11415
+ }
11416
+ ) }),
11417
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1", children: [
11418
+ /* @__PURE__ */ jsx("span", { className: "text-xs font-medium text-muted-foreground uppercase tracking-wider", children: "Localiza\xE7\xE3o" }),
11419
+ /* @__PURE__ */ jsx("span", { className: "text-sm text-foreground font-medium", children: event.location })
11420
+ ] })
11421
+ ] }),
11422
+ event.description && /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-4", children: [
11423
+ /* @__PURE__ */ jsx("div", { className: "p-2 rounded-lg bg-muted/50 border border-border", children: /* @__PURE__ */ jsx(
11424
+ AlignLeftIcon,
11425
+ {
11426
+ size: 20,
11427
+ weight: "duotone",
11428
+ className: "text-primary"
11429
+ }
11430
+ ) }),
11431
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1", children: [
11432
+ /* @__PURE__ */ jsx("span", { className: "text-xs font-medium text-muted-foreground uppercase tracking-wider", children: "Descri\xE7\xE3o" }),
11433
+ /* @__PURE__ */ jsx("div", { className: "text-sm text-muted-foreground leading-relaxed font-normal", children: event.description })
11434
+ ] })
11435
+ ] }),
11436
+ !event.location && !event.description && /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground/60 italic text-center py-2 border border-dashed border-border rounded-lg", children: "Nenhum detalhe adicional dispon\xEDvel." })
11437
+ ] })
11438
+ ] })
11439
+ }
11440
+ );
11441
+ }
10860
11442
  function AgendaView({
10861
11443
  currentDate,
10862
11444
  events,
@@ -11702,23 +12284,23 @@ function EventCalendar({
11702
12284
  });
11703
12285
  };
11704
12286
  const viewTitle = useMemo(() => {
11705
- const capitalize = (s) => s && s.length > 0 ? s.charAt(0).toUpperCase() + s.slice(1) : s;
12287
+ const capitalize2 = (s) => s && s.length > 0 ? s.charAt(0).toUpperCase() + s.slice(1) : s;
11706
12288
  if (view === "month") {
11707
- return capitalize(format(currentDate, "MMMM yyyy", { locale: ptBR }));
12289
+ return capitalize2(format(currentDate, "MMMM yyyy", { locale: ptBR }));
11708
12290
  }
11709
12291
  if (view === "week") {
11710
12292
  const start = startOfWeek(currentDate, { weekStartsOn: 1 });
11711
12293
  const end = endOfWeek(currentDate, { weekStartsOn: 1 });
11712
12294
  if (isSameMonth(start, end)) {
11713
- return capitalize(format(start, "MMMM yyyy", { locale: ptBR }));
12295
+ return capitalize2(format(start, "MMMM yyyy", { locale: ptBR }));
11714
12296
  }
11715
- const s1 = capitalize(format(start, "MMM", { locale: ptBR }));
11716
- const s2 = capitalize(format(end, "MMM yyyy", { locale: ptBR }));
12297
+ const s1 = capitalize2(format(start, "MMM", { locale: ptBR }));
12298
+ const s2 = capitalize2(format(end, "MMM yyyy", { locale: ptBR }));
11717
12299
  return `${s1} - ${s2}`;
11718
12300
  }
11719
12301
  if (view === "day") {
11720
12302
  const dayNum = format(currentDate, "d", { locale: ptBR });
11721
- const month = capitalize(format(currentDate, "MMMM", { locale: ptBR }));
12303
+ const month = capitalize2(format(currentDate, "MMMM", { locale: ptBR }));
11722
12304
  const year = format(currentDate, "yyyy", { locale: ptBR });
11723
12305
  const short = `${dayNum} de ${month} de ${year}`;
11724
12306
  const long = `${format(currentDate, "EEE", {
@@ -11734,13 +12316,13 @@ function EventCalendar({
11734
12316
  const start = currentDate;
11735
12317
  const end = addDays(currentDate, AgendaDaysToShow - 1);
11736
12318
  if (isSameMonth(start, end)) {
11737
- return capitalize(format(start, "MMMM yyyy", { locale: ptBR }));
12319
+ return capitalize2(format(start, "MMMM yyyy", { locale: ptBR }));
11738
12320
  }
11739
- const s1 = capitalize(format(start, "MMM", { locale: ptBR }));
11740
- const s2 = capitalize(format(end, "MMM yyyy", { locale: ptBR }));
12321
+ const s1 = capitalize2(format(start, "MMM", { locale: ptBR }));
12322
+ const s2 = capitalize2(format(end, "MMM yyyy", { locale: ptBR }));
11741
12323
  return `${s1} - ${s2}`;
11742
12324
  }
11743
- return capitalize(format(currentDate, "MMMM yyyy", { locale: ptBR }));
12325
+ return capitalize2(format(currentDate, "MMMM yyyy", { locale: ptBR }));
11744
12326
  }, [currentDate, view]);
11745
12327
  const calendarContent = /* @__PURE__ */ jsxs(Fragment, { children: [
11746
12328
  /* @__PURE__ */ jsxs(
@@ -13900,14 +14482,14 @@ var generateAdditionalColors = (baseColors, count) => {
13900
14482
  r /= 255;
13901
14483
  g /= 255;
13902
14484
  b /= 255;
13903
- const max = Math.max(r, g, b), min = Math.min(r, g, b);
14485
+ const max2 = Math.max(r, g, b), min2 = Math.min(r, g, b);
13904
14486
  let h = 0;
13905
14487
  let s = 0;
13906
- const l = (max + min) / 2;
13907
- if (max !== min) {
13908
- const d = max - min;
13909
- s = l > 0.5 ? d / (2 - max - min) : d / (max + min);
13910
- switch (max) {
14488
+ const l = (max2 + min2) / 2;
14489
+ if (max2 !== min2) {
14490
+ const d = max2 - min2;
14491
+ s = l > 0.5 ? d / (2 - max2 - min2) : d / (max2 + min2);
14492
+ switch (max2) {
13911
14493
  case r:
13912
14494
  h = (g - b) / d + (g < b ? 6 : 0);
13913
14495
  break;
@@ -14024,25 +14606,25 @@ var computeNiceMax = (maxValue) => {
14024
14606
  return niceCeil(padded);
14025
14607
  };
14026
14608
  var getMaxDataValue = (data, keys) => {
14027
- let max = 0;
14609
+ let max2 = 0;
14028
14610
  for (const row of data) {
14029
14611
  for (const key of keys) {
14030
14612
  const v = row[key];
14031
- if (typeof v === "number" && Number.isFinite(v) && v > max) max = v;
14613
+ if (typeof v === "number" && Number.isFinite(v) && v > max2) max2 = v;
14032
14614
  }
14033
14615
  }
14034
- return max;
14616
+ return max2;
14035
14617
  };
14036
14618
  var getMinDataValue = (data, keys) => {
14037
- let min = 0;
14619
+ let min2 = 0;
14038
14620
  for (const row of data) {
14039
14621
  for (const key of keys) {
14040
14622
  const v = row[key];
14041
- if (typeof v === "number" && Number.isFinite(v) && v < min)
14042
- min = v;
14623
+ if (typeof v === "number" && Number.isFinite(v) && v < min2)
14624
+ min2 = v;
14043
14625
  }
14044
14626
  }
14045
- return min;
14627
+ return min2;
14046
14628
  };
14047
14629
  var computeChartWidth = (width, dataLength, series, niceMaxLeft, niceMaxRight) => {
14048
14630
  if (typeof width === "number") return width;
@@ -14088,8 +14670,8 @@ var createValueFormatter = (customFormatter, formatBR) => {
14088
14670
  });
14089
14671
  const prefixFormats = ["R$", "$", "\u20AC", "\xA3"];
14090
14672
  const suffixFormats = ["%", "kg", "km", "m", "L", "un", "t", "h", "min", "s"];
14091
- const getFormattedValue = (baseValue, format17) => {
14092
- const trimmedFormat = format17.trim();
14673
+ const getFormattedValue = (baseValue, format19) => {
14674
+ const trimmedFormat = format19.trim();
14093
14675
  if (prefixFormats.includes(trimmedFormat)) {
14094
14676
  return `${trimmedFormat} ${baseValue}`;
14095
14677
  }
@@ -14114,8 +14696,8 @@ var createValueFormatter = (customFormatter, formatBR) => {
14114
14696
  num = Number.isNaN(parsed) ? NaN : parsed;
14115
14697
  }
14116
14698
  const baseFormatted = formatBR && !Number.isNaN(num) ? nf.format(num) : String(formattedValue ?? value ?? "");
14117
- const format17 = propsDataKey && formatterMap[propsDataKey] ? formatterMap[propsDataKey] : "";
14118
- return format17 ? getFormattedValue(baseFormatted, format17) : baseFormatted;
14699
+ const format19 = propsDataKey && formatterMap[propsDataKey] ? formatterMap[propsDataKey] : "";
14700
+ return format19 ? getFormattedValue(baseFormatted, format19) : baseFormatted;
14119
14701
  };
14120
14702
  }
14121
14703
  if (typeof customFormatter === "function") {
@@ -18428,8 +19010,8 @@ var TimeSeries_default = TimeSeries;
18428
19010
  function NumericInput({
18429
19011
  value,
18430
19012
  onChange,
18431
- min,
18432
- max,
19013
+ min: min2,
19014
+ max: max2,
18433
19015
  label,
18434
19016
  className,
18435
19017
  error,
@@ -18446,21 +19028,21 @@ function NumericInput({
18446
19028
  if (!hasChanged || isLoading || disabled) return;
18447
19029
  onChange(internalValue);
18448
19030
  };
18449
- function handleNumberChange(value2, currentValue = 0, max2 = 9999999, min2 = 0) {
19031
+ function handleNumberChange(value2, currentValue = 0, max3 = 9999999, min3 = 0) {
18450
19032
  const numbersOnly = value2.replace(/\D/g, "");
18451
19033
  if (numbersOnly === "") {
18452
19034
  return 0;
18453
19035
  }
18454
19036
  const numValue = Number(numbersOnly);
18455
- if (numValue < min2) {
19037
+ if (numValue < min3) {
18456
19038
  if (tooltip_on_overflow) {
18457
- toast$1.warning("O valor deve ser maior que " + min2.toString());
19039
+ toast$1.warning("O valor deve ser maior que " + min3.toString());
18458
19040
  }
18459
- return min2;
19041
+ return min3;
18460
19042
  }
18461
- if (numValue > max2) {
19043
+ if (numValue > max3) {
18462
19044
  if (tooltip_on_overflow) {
18463
- toast$1.warning("O valor deve ser menor que " + max2.toString());
19045
+ toast$1.warning("O valor deve ser menor que " + max3.toString());
18464
19046
  }
18465
19047
  return currentValue;
18466
19048
  }
@@ -18482,8 +19064,8 @@ function NumericInput({
18482
19064
  const processedValue = handleNumberChange(
18483
19065
  e.currentTarget.value,
18484
19066
  internalValue,
18485
- max,
18486
- min
19067
+ max2,
19068
+ min2
18487
19069
  );
18488
19070
  setInternalValue(processedValue);
18489
19071
  },
@@ -19649,4 +20231,4 @@ function ControlledCombobox({
19649
20231
  );
19650
20232
  }
19651
20233
 
19652
- 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, 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, EventDialog, EventGap, EventGapAgenda, EventHeight, EventHeightAgenda, EventItem, EventItemAgenda, EventsPopup, FavoriteButton, 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, 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, adaptDataForTooltip, addHoursToDate, addHoursToDateAgenda, addMinutesToDateAgenda, badgeVariants, buttonVariantsBase, compactTick, computeChartWidth, computeNiceMax, computeYAxisTickWidth, convert12HourTo24Hour, createValueFormatter, createYTickFormatter, detectDataFields, detectXAxis, display12HourValue, formatFieldName, formatLinePercentage, generateAdditionalColors, generateColorMap, getAgendaEventsForDay, getAgendaEventsForDayAgenda, getAllEventsForDay, getAllEventsForDayAgenda, getArrowByType, 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, toast, useBiaxial, useCalendarDnd, useCalendarDndAgenda, useChartClick, useChartDimensions, useChartHighlights, useChartLayout, useChartMinMax, useChartTooltips, useCurrentTimeIndicator, useCurrentTimeIndicatorAgenda, useDrag, useEventVisibility, useEventVisibilityAgenda, useIsMobile, useOpenTooltipForPeriod, useProcessedData, useSeriesOpacity, useTheme, useTimeSeriesRange, visualForItem };
20234
+ 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, 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, 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, adaptDataForTooltip, addHoursToDate, addHoursToDateAgenda, addMinutesToDateAgenda, badgeVariants, buttonVariantsBase, compactTick, computeChartWidth, computeNiceMax, computeYAxisTickWidth, convert12HourTo24Hour, createValueFormatter, createYTickFormatter, detectDataFields, detectXAxis, display12HourValue, formatFieldName, formatLinePercentage, generateAdditionalColors, generateColorMap, getAgendaEventsForDay, getAgendaEventsForDayAgenda, getAllEventsForDay, getAllEventsForDayAgenda, getArrowByType, 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, toast, useBiaxial, useCalendarDnd, useCalendarDndAgenda, useChartClick, useChartDimensions, useChartHighlights, useChartLayout, useChartMinMax, useChartTooltips, useCurrentTimeIndicator, useCurrentTimeIndicatorAgenda, useDrag, useEventVisibility, useEventVisibilityAgenda, useIsMobile, useOpenTooltipForPeriod, useProcessedData, useSeriesOpacity, useTheme, useTimeSeriesRange, visualForItem };