@mlw-packages/react-components 1.7.17 → 1.7.18
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.css +15 -0
- package/dist/index.d.mts +2 -3
- package/dist/index.d.ts +2 -3
- package/dist/index.js +134 -137
- package/dist/index.mjs +68 -69
- package/package.json +1 -1
package/dist/index.css
CHANGED
|
@@ -559,6 +559,9 @@ body {
|
|
|
559
559
|
.top-\[calc\(var\(--week-cells-height\)\/4\)\] {
|
|
560
560
|
top: calc(var(--week-cells-height) / 4);
|
|
561
561
|
}
|
|
562
|
+
.top-\[calc\(var\(--week-cells-height\)\/4\*\)\] {
|
|
563
|
+
top: calc(var(--week-cells-height) / 4 *);
|
|
564
|
+
}
|
|
562
565
|
.top-\[calc\(var\(--week-cells-height\)\/4\*2\)\] {
|
|
563
566
|
top: calc(var(--week-cells-height) / 4 * 2);
|
|
564
567
|
}
|
|
@@ -1946,6 +1949,9 @@ body {
|
|
|
1946
1949
|
.border-black\/40 {
|
|
1947
1950
|
border-color: rgb(0 0 0 / 0.4);
|
|
1948
1951
|
}
|
|
1952
|
+
.border-black\/5 {
|
|
1953
|
+
border-color: rgb(0 0 0 / 0.05);
|
|
1954
|
+
}
|
|
1949
1955
|
.border-blue-200 {
|
|
1950
1956
|
--tw-border-opacity: 1;
|
|
1951
1957
|
border-color: rgb(191 219 254 / var(--tw-border-opacity, 1));
|
|
@@ -3604,6 +3610,9 @@ body {
|
|
|
3604
3610
|
.ease-out {
|
|
3605
3611
|
animation-timing-function: cubic-bezier(0, 0, 0.2, 1);
|
|
3606
3612
|
}
|
|
3613
|
+
.running {
|
|
3614
|
+
animation-play-state: running;
|
|
3615
|
+
}
|
|
3607
3616
|
:root {
|
|
3608
3617
|
--white: #ffffff;
|
|
3609
3618
|
--purple: #8e68ff;
|
|
@@ -5660,6 +5669,9 @@ body {
|
|
|
5660
5669
|
}
|
|
5661
5670
|
}
|
|
5662
5671
|
@media (min-width: 480px) {
|
|
5672
|
+
.min-\[480px\]\:inline-block {
|
|
5673
|
+
display: inline-block;
|
|
5674
|
+
}
|
|
5663
5675
|
.min-\[480px\]\:hidden {
|
|
5664
5676
|
display: none;
|
|
5665
5677
|
}
|
|
@@ -5837,6 +5849,9 @@ body {
|
|
|
5837
5849
|
.sm\:text-\[11px\] {
|
|
5838
5850
|
font-size: 11px;
|
|
5839
5851
|
}
|
|
5852
|
+
.sm\:text-\[15px\] {
|
|
5853
|
+
font-size: 15px;
|
|
5854
|
+
}
|
|
5840
5855
|
.sm\:text-\[clamp\(0\.65rem\,1\.1vw\,0\.825rem\)\] {
|
|
5841
5856
|
font-size: clamp(0.65rem, 1.1vw, 0.825rem);
|
|
5842
5857
|
}
|
package/dist/index.d.mts
CHANGED
|
@@ -1504,9 +1504,8 @@ interface EventCalendarProps {
|
|
|
1504
1504
|
onEventDelete?: (eventId: string) => void;
|
|
1505
1505
|
className?: string;
|
|
1506
1506
|
initialView?: CalendarView;
|
|
1507
|
-
mode?: "agenda-only" | "default";
|
|
1508
1507
|
}
|
|
1509
|
-
declare function EventCalendar({ events, onEventAdd, onEventUpdate, onEventDelete, className, initialView,
|
|
1508
|
+
declare function EventCalendar({ events, onEventAdd, onEventUpdate, onEventDelete, className, initialView, }: EventCalendarProps): react_jsx_runtime.JSX.Element;
|
|
1510
1509
|
|
|
1511
1510
|
interface EventDialogProps {
|
|
1512
1511
|
event: CalendarEvent | null;
|
|
@@ -1534,7 +1533,7 @@ interface EventItemProps {
|
|
|
1534
1533
|
onMouseDown?: (e: React.MouseEvent) => void;
|
|
1535
1534
|
onTouchStart?: (e: React.TouchEvent) => void;
|
|
1536
1535
|
}
|
|
1537
|
-
declare function EventItem({ event, view,
|
|
1536
|
+
declare function EventItem({ event, view, onClick, showTime, currentTime, isFirstDay, isLastDay, children, className, dndListeners, dndAttributes, onMouseDown, onTouchStart, agendaOnly, }: EventItemProps): react_jsx_runtime.JSX.Element;
|
|
1538
1537
|
|
|
1539
1538
|
interface EventsPopupProps {
|
|
1540
1539
|
date: Date;
|
package/dist/index.d.ts
CHANGED
|
@@ -1504,9 +1504,8 @@ interface EventCalendarProps {
|
|
|
1504
1504
|
onEventDelete?: (eventId: string) => void;
|
|
1505
1505
|
className?: string;
|
|
1506
1506
|
initialView?: CalendarView;
|
|
1507
|
-
mode?: "agenda-only" | "default";
|
|
1508
1507
|
}
|
|
1509
|
-
declare function EventCalendar({ events, onEventAdd, onEventUpdate, onEventDelete, className, initialView,
|
|
1508
|
+
declare function EventCalendar({ events, onEventAdd, onEventUpdate, onEventDelete, className, initialView, }: EventCalendarProps): react_jsx_runtime.JSX.Element;
|
|
1510
1509
|
|
|
1511
1510
|
interface EventDialogProps {
|
|
1512
1511
|
event: CalendarEvent | null;
|
|
@@ -1534,7 +1533,7 @@ interface EventItemProps {
|
|
|
1534
1533
|
onMouseDown?: (e: React.MouseEvent) => void;
|
|
1535
1534
|
onTouchStart?: (e: React.TouchEvent) => void;
|
|
1536
1535
|
}
|
|
1537
|
-
declare function EventItem({ event, view,
|
|
1536
|
+
declare function EventItem({ event, view, onClick, showTime, currentTime, isFirstDay, isLastDay, children, className, dndListeners, dndAttributes, onMouseDown, onTouchStart, agendaOnly, }: EventItemProps): react_jsx_runtime.JSX.Element;
|
|
1538
1537
|
|
|
1539
1538
|
interface EventsPopupProps {
|
|
1540
1539
|
date: Date;
|
package/dist/index.js
CHANGED
|
@@ -13090,19 +13090,14 @@ function EventCalendar({
|
|
|
13090
13090
|
onEventUpdate,
|
|
13091
13091
|
onEventDelete,
|
|
13092
13092
|
className,
|
|
13093
|
-
initialView = "month"
|
|
13094
|
-
mode = "default"
|
|
13093
|
+
initialView = "month"
|
|
13095
13094
|
}) {
|
|
13096
|
-
const isAgendaOnly = mode === "agenda-only";
|
|
13097
13095
|
const [currentDate, setCurrentDate] = (0, import_react58.useState)(/* @__PURE__ */ new Date());
|
|
13098
|
-
const [view, setView] = (0, import_react58.useState)(
|
|
13099
|
-
isAgendaOnly ? "agenda" : initialView
|
|
13100
|
-
);
|
|
13096
|
+
const [view, setView] = (0, import_react58.useState)(initialView);
|
|
13101
13097
|
const [isFading, setIsFading] = (0, import_react58.useState)(false);
|
|
13102
13098
|
const FADE_DURATION = 220;
|
|
13103
13099
|
const changeView = (0, import_react58.useCallback)(
|
|
13104
13100
|
(next) => {
|
|
13105
|
-
if (isAgendaOnly) return;
|
|
13106
13101
|
if (next === view) return;
|
|
13107
13102
|
setIsFading(true);
|
|
13108
13103
|
window.setTimeout(() => {
|
|
@@ -13110,7 +13105,7 @@ function EventCalendar({
|
|
|
13110
13105
|
requestAnimationFrame(() => setIsFading(false));
|
|
13111
13106
|
}, FADE_DURATION);
|
|
13112
13107
|
},
|
|
13113
|
-
[view
|
|
13108
|
+
[view]
|
|
13114
13109
|
);
|
|
13115
13110
|
const [isPaging, setIsPaging] = (0, import_react58.useState)(false);
|
|
13116
13111
|
const [pageDirection, setPageDirection] = (0, import_react58.useState)(
|
|
@@ -13140,7 +13135,6 @@ function EventCalendar({
|
|
|
13140
13135
|
if (isEventDialogOpen || e.target instanceof HTMLInputElement || e.target instanceof HTMLTextAreaElement || e.target instanceof HTMLElement && e.target.isContentEditable) {
|
|
13141
13136
|
return;
|
|
13142
13137
|
}
|
|
13143
|
-
if (isAgendaOnly) return;
|
|
13144
13138
|
switch (e.key.toLowerCase()) {
|
|
13145
13139
|
case "m":
|
|
13146
13140
|
changeView("month");
|
|
@@ -13161,7 +13155,7 @@ function EventCalendar({
|
|
|
13161
13155
|
return () => {
|
|
13162
13156
|
window.removeEventListener("keydown", handleKeyDown);
|
|
13163
13157
|
};
|
|
13164
|
-
}, [isEventDialogOpen, changeView
|
|
13158
|
+
}, [isEventDialogOpen, changeView]);
|
|
13165
13159
|
const handlePrevious = () => {
|
|
13166
13160
|
pageTransition(() => {
|
|
13167
13161
|
if (view === "month") {
|
|
@@ -13192,13 +13186,11 @@ function EventCalendar({
|
|
|
13192
13186
|
setCurrentDate(/* @__PURE__ */ new Date());
|
|
13193
13187
|
};
|
|
13194
13188
|
const handleEventSelect = (event) => {
|
|
13195
|
-
if (isAgendaOnly) return;
|
|
13196
13189
|
console.log("Event selected:", event);
|
|
13197
13190
|
setSelectedEvent(event);
|
|
13198
13191
|
setIsEventDialogOpen(true);
|
|
13199
13192
|
};
|
|
13200
13193
|
const handleEventCreate = (startTime) => {
|
|
13201
|
-
if (isAgendaOnly) return;
|
|
13202
13194
|
console.log("Creating new event at:", startTime);
|
|
13203
13195
|
const minutes = startTime.getMinutes();
|
|
13204
13196
|
const remainder = minutes % 15;
|
|
@@ -13225,9 +13217,13 @@ function EventCalendar({
|
|
|
13225
13217
|
if (event.id) {
|
|
13226
13218
|
onEventUpdate?.(event);
|
|
13227
13219
|
(0, import_sonner3.toast)(`Evento "${event.title}" atualizado`, {
|
|
13228
|
-
description: (0, import_date_fns7.format)(
|
|
13229
|
-
|
|
13230
|
-
|
|
13220
|
+
description: (0, import_date_fns7.format)(
|
|
13221
|
+
new Date(event.start ?? event.attend_date ?? event.end ?? Date.now()),
|
|
13222
|
+
"d 'de' MMMM 'de' yyyy",
|
|
13223
|
+
{
|
|
13224
|
+
locale: import_locale3.ptBR
|
|
13225
|
+
}
|
|
13226
|
+
),
|
|
13231
13227
|
position: "bottom-left"
|
|
13232
13228
|
});
|
|
13233
13229
|
} else {
|
|
@@ -13236,9 +13232,11 @@ function EventCalendar({
|
|
|
13236
13232
|
id: Math.random().toString(36).substring(2, 11)
|
|
13237
13233
|
});
|
|
13238
13234
|
(0, import_sonner3.toast)(`Evento "${event.title}" adicionado`, {
|
|
13239
|
-
description: (0, import_date_fns7.format)(
|
|
13240
|
-
|
|
13241
|
-
|
|
13235
|
+
description: (0, import_date_fns7.format)(
|
|
13236
|
+
new Date(event.start ?? event.attend_date ?? event.end ?? Date.now()),
|
|
13237
|
+
"d 'de' MMMM 'de' yyyy",
|
|
13238
|
+
{ locale: import_locale3.ptBR }
|
|
13239
|
+
),
|
|
13242
13240
|
position: "bottom-left"
|
|
13243
13241
|
});
|
|
13244
13242
|
}
|
|
@@ -13253,7 +13251,9 @@ function EventCalendar({
|
|
|
13253
13251
|
if (deletedEvent) {
|
|
13254
13252
|
(0, import_sonner3.toast)(`Evento "${deletedEvent.title}" exclu\xEDdo`, {
|
|
13255
13253
|
description: (0, import_date_fns7.format)(
|
|
13256
|
-
new Date(
|
|
13254
|
+
new Date(
|
|
13255
|
+
deletedEvent.start ?? deletedEvent.attend_date ?? deletedEvent.end ?? Date.now()
|
|
13256
|
+
),
|
|
13257
13257
|
"d 'de' MMMM 'de' yyyy",
|
|
13258
13258
|
{ locale: import_locale3.ptBR }
|
|
13259
13259
|
),
|
|
@@ -13265,7 +13265,9 @@ function EventCalendar({
|
|
|
13265
13265
|
onEventUpdate?.(updatedEvent);
|
|
13266
13266
|
(0, import_sonner3.toast)(`Evento "${updatedEvent.title}" movido`, {
|
|
13267
13267
|
description: (0, import_date_fns7.format)(
|
|
13268
|
-
new Date(
|
|
13268
|
+
new Date(
|
|
13269
|
+
updatedEvent.start ?? updatedEvent.attend_date ?? updatedEvent.end ?? Date.now()
|
|
13270
|
+
),
|
|
13269
13271
|
"d 'de' MMMM 'de' yyyy",
|
|
13270
13272
|
{ locale: import_locale3.ptBR }
|
|
13271
13273
|
),
|
|
@@ -13323,7 +13325,7 @@ function EventCalendar({
|
|
|
13323
13325
|
),
|
|
13324
13326
|
children: [
|
|
13325
13327
|
/* @__PURE__ */ (0, import_jsx_runtime78.jsxs)("div", { className: "flex items-center gap-1 sm:gap-4", children: [
|
|
13326
|
-
|
|
13328
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsxs)(
|
|
13327
13329
|
ButtonBase,
|
|
13328
13330
|
{
|
|
13329
13331
|
className: "max-[479px]:aspect-square max-[479px]:p-0!",
|
|
@@ -13366,7 +13368,7 @@ function EventCalendar({
|
|
|
13366
13368
|
] }),
|
|
13367
13369
|
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)("h2", { className: "font-semibold text-sm sm:text-lg md:text-xl", children: viewTitle })
|
|
13368
13370
|
] }),
|
|
13369
|
-
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)("div", { className: "flex items-center gap-2", children:
|
|
13371
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)(import_jsx_runtime78.Fragment, { children: [
|
|
13370
13372
|
/* @__PURE__ */ (0, import_jsx_runtime78.jsxs)(DropDownMenuBase, { children: [
|
|
13371
13373
|
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)(DropDownMenuTriggerBase, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)(
|
|
13372
13374
|
ButtonBase,
|
|
@@ -13411,8 +13413,7 @@ function EventCalendar({
|
|
|
13411
13413
|
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)(DropDownMenuShortcutBase, { children: "M" })
|
|
13412
13414
|
] }),
|
|
13413
13415
|
/* @__PURE__ */ (0, import_jsx_runtime78.jsxs)(DropDownMenuItemBase, { onClick: () => changeView("week"), children: [
|
|
13414
|
-
"Semana",
|
|
13415
|
-
" ",
|
|
13416
|
+
"Semana ",
|
|
13416
13417
|
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)(DropDownMenuShortcutBase, { children: "S" })
|
|
13417
13418
|
] }),
|
|
13418
13419
|
/* @__PURE__ */ (0, import_jsx_runtime78.jsxs)(DropDownMenuItemBase, { onClick: () => changeView("day"), children: [
|
|
@@ -13420,8 +13421,7 @@ function EventCalendar({
|
|
|
13420
13421
|
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)(DropDownMenuShortcutBase, { children: "D" })
|
|
13421
13422
|
] }),
|
|
13422
13423
|
/* @__PURE__ */ (0, import_jsx_runtime78.jsxs)(DropDownMenuItemBase, { onClick: () => changeView("agenda"), children: [
|
|
13423
|
-
"Agenda",
|
|
13424
|
-
" ",
|
|
13424
|
+
"Agenda ",
|
|
13425
13425
|
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)(DropDownMenuShortcutBase, { children: "A" })
|
|
13426
13426
|
] })
|
|
13427
13427
|
] })
|
|
@@ -13493,8 +13493,7 @@ function EventCalendar({
|
|
|
13493
13493
|
{
|
|
13494
13494
|
currentDate,
|
|
13495
13495
|
events,
|
|
13496
|
-
onEventSelect:
|
|
13497
|
-
showUndatedEvents: isAgendaOnly
|
|
13496
|
+
onEventSelect: handleEventSelect
|
|
13498
13497
|
}
|
|
13499
13498
|
)
|
|
13500
13499
|
]
|
|
@@ -13523,7 +13522,7 @@ function EventCalendar({
|
|
|
13523
13522
|
"--event-height": `${EventHeight}px`,
|
|
13524
13523
|
"--week-cells-height": `${WeekCellsHeight}px`
|
|
13525
13524
|
},
|
|
13526
|
-
children:
|
|
13525
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(CalendarDndProvider, { onEventUpdate: handleEventUpdate, children: calendarContent })
|
|
13527
13526
|
}
|
|
13528
13527
|
);
|
|
13529
13528
|
}
|
|
@@ -13993,6 +13992,7 @@ function EventDialog({
|
|
|
13993
13992
|
// src/components/event-calendar/EventItem.tsx
|
|
13994
13993
|
var import_date_fns9 = require("date-fns");
|
|
13995
13994
|
var import_react62 = require("react");
|
|
13995
|
+
var import_react63 = require("@phosphor-icons/react");
|
|
13996
13996
|
var import_jsx_runtime80 = require("react/jsx-runtime");
|
|
13997
13997
|
var formatTimeWithOptionalMinutes = (date) => {
|
|
13998
13998
|
return (0, import_date_fns9.format)(date, "HH:mm");
|
|
@@ -14020,17 +14020,26 @@ function EventWrapper({
|
|
|
14020
14020
|
onTouchStart,
|
|
14021
14021
|
ariaLabel
|
|
14022
14022
|
}) {
|
|
14023
|
-
const hasValidTimeForWrapper = isValidDate(event.start) && isValidDate(event.end);
|
|
14024
|
-
const displayEnd =
|
|
14025
|
-
|
|
14026
|
-
|
|
14023
|
+
const hasValidTimeForWrapper = isValidDate(event.start) && isValidDate(event.end) || isValidDate(event.attend_date);
|
|
14024
|
+
const displayEnd = (() => {
|
|
14025
|
+
if (isValidDate(event.start) && isValidDate(event.end)) {
|
|
14026
|
+
return currentTime ? new Date(
|
|
14027
|
+
new Date(currentTime).getTime() + (new Date(event.end).getTime() - new Date(event.start).getTime())
|
|
14028
|
+
) : new Date(event.end);
|
|
14029
|
+
}
|
|
14030
|
+
if (isValidDate(event.attend_date)) {
|
|
14031
|
+
const start = new Date(event.attend_date);
|
|
14032
|
+
return addHoursToDate(start, 1);
|
|
14033
|
+
}
|
|
14034
|
+
return void 0;
|
|
14035
|
+
})();
|
|
14027
14036
|
const isEventInPast = displayEnd ? (0, import_date_fns9.isPast)(displayEnd) : false;
|
|
14028
14037
|
const colorClasses = hasValidTimeForWrapper ? getEventColorClasses(event.color) : "bg-gray-200/50 hover:bg-gray-200/40 text-gray-900/80 dark:bg-gray-700/25 dark:text-gray-200/90 shadow-none";
|
|
14029
14038
|
return /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
|
|
14030
14039
|
"button",
|
|
14031
14040
|
{
|
|
14032
14041
|
className: cn(
|
|
14033
|
-
"flex w-full select-none overflow-hidden 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
|
|
14042
|
+
"flex w-full select-none overflow-hidden 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 ",
|
|
14034
14043
|
colorClasses,
|
|
14035
14044
|
getBorderRadiusClasses(isFirstDay, isLastDay),
|
|
14036
14045
|
className
|
|
@@ -14051,7 +14060,6 @@ function EventWrapper({
|
|
|
14051
14060
|
function EventItem({
|
|
14052
14061
|
event,
|
|
14053
14062
|
view,
|
|
14054
|
-
isDragging,
|
|
14055
14063
|
onClick,
|
|
14056
14064
|
showTime,
|
|
14057
14065
|
currentTime,
|
|
@@ -14130,12 +14138,9 @@ function EventItem({
|
|
|
14130
14138
|
dndListeners,
|
|
14131
14139
|
event,
|
|
14132
14140
|
ariaLabel,
|
|
14133
|
-
isDragging,
|
|
14134
14141
|
isFirstDay,
|
|
14135
14142
|
isLastDay,
|
|
14136
14143
|
onClick,
|
|
14137
|
-
onMouseDown,
|
|
14138
|
-
onTouchStart,
|
|
14139
14144
|
children: children || /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)("span", { className: "flex items-center gap-2 truncate", children: [
|
|
14140
14145
|
!event.allDay && hasValidTime && displayStart && /* @__PURE__ */ (0, import_jsx_runtime80.jsx)("span", { className: "truncate font-normal opacity-80 sm:text-[11px] bg-white/10 px-2 py-0.5 rounded-full text-[11px]", children: formatTimeWithOptionalMinutes(displayStart) }),
|
|
14141
14146
|
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
|
|
@@ -14167,27 +14172,22 @@ function EventItem({
|
|
|
14167
14172
|
dndListeners,
|
|
14168
14173
|
event,
|
|
14169
14174
|
ariaLabel,
|
|
14170
|
-
isDragging,
|
|
14171
14175
|
isFirstDay,
|
|
14172
14176
|
isLastDay,
|
|
14173
|
-
onClick,
|
|
14174
|
-
onMouseDown,
|
|
14175
|
-
onTouchStart,
|
|
14176
14177
|
children: durationMinutes < 45 ? /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)("div", { className: "flex items-center justify-between w-full", children: [
|
|
14177
|
-
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)("div", { className: cn("truncate
|
|
14178
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)("div", { className: cn("truncate text-lg"), children: event.title }),
|
|
14178
14179
|
showTime && hasValidTime && displayStart && /* @__PURE__ */ (0, import_jsx_runtime80.jsx)("span", { className: "ml-2 inline-block bg-white/10 px-2 py-0.5 rounded-full text-[11px] opacity-90", children: formatTimeWithOptionalMinutes(displayStart) })
|
|
14179
14180
|
] }) : /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)(import_jsx_runtime80.Fragment, { children: [
|
|
14180
14181
|
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
|
|
14181
14182
|
"div",
|
|
14182
14183
|
{
|
|
14183
14184
|
className: cn(
|
|
14184
|
-
"truncate font-medium"
|
|
14185
|
-
agendaOnly ? "text-lg" : ""
|
|
14185
|
+
"truncate font-medium text-lg"
|
|
14186
14186
|
),
|
|
14187
14187
|
children: event.title
|
|
14188
14188
|
}
|
|
14189
14189
|
),
|
|
14190
|
-
showTime && hasValidTime && /* @__PURE__ */ (0, import_jsx_runtime80.jsx)("div", { className: "truncate font-normal opacity-70 sm:text-[
|
|
14190
|
+
showTime && hasValidTime && /* @__PURE__ */ (0, import_jsx_runtime80.jsx)("div", { className: "truncate font-normal opacity-70 sm:text-[15px]", children: /* @__PURE__ */ (0, import_jsx_runtime80.jsx)("span", { className: "inline-block bg-white/5 px-0.5 py-0.5 rounded-full", children: getEventTime() }) })
|
|
14191
14191
|
] })
|
|
14192
14192
|
}
|
|
14193
14193
|
);
|
|
@@ -14228,7 +14228,7 @@ function EventItem({
|
|
|
14228
14228
|
{
|
|
14229
14229
|
className: cn(
|
|
14230
14230
|
"my-1 opacity-90",
|
|
14231
|
-
agendaOnly ? "text-
|
|
14231
|
+
agendaOnly ? "text-md" : "text-xs"
|
|
14232
14232
|
),
|
|
14233
14233
|
style: {
|
|
14234
14234
|
display: "-webkit-box",
|
|
@@ -14247,7 +14247,7 @@ function EventItem({
|
|
|
14247
14247
|
"button",
|
|
14248
14248
|
{
|
|
14249
14249
|
className: cn(
|
|
14250
|
-
"flex w-full flex-col gap-2 rounded-lg p-3 text-left outline-none transition-shadow duration-150 ease-out hover:bg-white/3 focus-visible:ring-2 focus-visible:ring-ring/50 focus-visible:border-ring data-past-event:line-through data-past-event:opacity-90",
|
|
14250
|
+
"flex w-full flex-col gap-2 rounded-lg p-3 text-left outline-none transition-shadow duration-150 ease-out hover:bg-white/3 focus-visible:ring-2 focus-visible:ring-ring/50 focus-visible:border-ring data-past-event:line-through data-past-event:opacity-90 border-2 border-border",
|
|
14251
14251
|
colorClasses,
|
|
14252
14252
|
className
|
|
14253
14253
|
),
|
|
@@ -14260,32 +14260,29 @@ function EventItem({
|
|
|
14260
14260
|
...dndListeners,
|
|
14261
14261
|
...dndAttributes,
|
|
14262
14262
|
children: [
|
|
14263
|
-
/* @__PURE__ */ (0, import_jsx_runtime80.
|
|
14264
|
-
|
|
14265
|
-
|
|
14266
|
-
|
|
14267
|
-
|
|
14268
|
-
|
|
14269
|
-
|
|
14270
|
-
|
|
14271
|
-
|
|
14272
|
-
event.allDay ? /* @__PURE__ */ (0, import_jsx_runtime80.jsx)("span", { className: "uppercase", children: "All day" }) : /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)("span", { className: "uppercase", children: [
|
|
14263
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsxs)("div", { className: "flex w-full justify-between border-b-2 border-black/5 ", children: [
|
|
14264
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)("div", { className: cn("font-bold text-lg"), children: event.title }),
|
|
14265
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
|
|
14266
|
+
"div",
|
|
14267
|
+
{
|
|
14268
|
+
className: cn(
|
|
14269
|
+
"opacity-90 flex items-center gap-2 text-lg"
|
|
14270
|
+
),
|
|
14271
|
+
children: event.allDay ? /* @__PURE__ */ (0, import_jsx_runtime80.jsx)("span", { children: "Dia todo" }) : /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)("span", { className: "uppercase font-semibold flex items-center gap-2", children: [
|
|
14273
14272
|
formatTimeWithOptionalMinutes(displayStart),
|
|
14274
|
-
" -",
|
|
14275
|
-
|
|
14276
|
-
|
|
14277
|
-
] }),
|
|
14278
|
-
event.location && /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)("span", { className: "opacity-80 flex items-center gap-1", children: [
|
|
14279
|
-
"-",
|
|
14280
|
-
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)("span", { className: "truncate", children: event.location })
|
|
14273
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)("span", { className: "opacity-70", children: "-" }),
|
|
14274
|
+
formatTimeWithOptionalMinutes(displayEnd),
|
|
14275
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)(import_react63.ClockUserIcon, {})
|
|
14281
14276
|
] })
|
|
14282
|
-
|
|
14283
|
-
|
|
14284
|
-
),
|
|
14277
|
+
}
|
|
14278
|
+
)
|
|
14279
|
+
] }),
|
|
14285
14280
|
event.description && /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
|
|
14286
14281
|
"div",
|
|
14287
14282
|
{
|
|
14288
|
-
className: cn(
|
|
14283
|
+
className: cn(
|
|
14284
|
+
"my-1 opacity-90 flex text-md"
|
|
14285
|
+
),
|
|
14289
14286
|
style: {
|
|
14290
14287
|
display: "-webkit-box",
|
|
14291
14288
|
WebkitLineClamp: 2,
|
|
@@ -14303,9 +14300,9 @@ function EventItem({
|
|
|
14303
14300
|
// src/components/event-calendar/EventsPopUp.tsx
|
|
14304
14301
|
var import_date_fns10 = require("date-fns");
|
|
14305
14302
|
var import_locale5 = require("date-fns/locale");
|
|
14306
|
-
var
|
|
14303
|
+
var import_react64 = require("react");
|
|
14307
14304
|
var import_framer_motion18 = require("framer-motion");
|
|
14308
|
-
var
|
|
14305
|
+
var import_react65 = require("@phosphor-icons/react");
|
|
14309
14306
|
var import_jsx_runtime81 = require("react/jsx-runtime");
|
|
14310
14307
|
function EventsPopup({
|
|
14311
14308
|
date,
|
|
@@ -14314,8 +14311,8 @@ function EventsPopup({
|
|
|
14314
14311
|
onClose,
|
|
14315
14312
|
onEventSelect
|
|
14316
14313
|
}) {
|
|
14317
|
-
const popupRef = (0,
|
|
14318
|
-
(0,
|
|
14314
|
+
const popupRef = (0, import_react64.useRef)(null);
|
|
14315
|
+
(0, import_react64.useEffect)(() => {
|
|
14319
14316
|
const handleClickOutside = (event) => {
|
|
14320
14317
|
if (popupRef.current && !popupRef.current.contains(event.target)) {
|
|
14321
14318
|
onClose();
|
|
@@ -14326,7 +14323,7 @@ function EventsPopup({
|
|
|
14326
14323
|
document.removeEventListener("mousedown", handleClickOutside);
|
|
14327
14324
|
};
|
|
14328
14325
|
}, [onClose]);
|
|
14329
|
-
(0,
|
|
14326
|
+
(0, import_react64.useEffect)(() => {
|
|
14330
14327
|
const handleEscKey = (event) => {
|
|
14331
14328
|
if (event.key === "Escape") {
|
|
14332
14329
|
onClose();
|
|
@@ -14341,7 +14338,7 @@ function EventsPopup({
|
|
|
14341
14338
|
if (onEventSelect) onEventSelect(event);
|
|
14342
14339
|
onClose();
|
|
14343
14340
|
};
|
|
14344
|
-
const adjustedPosition = (0,
|
|
14341
|
+
const adjustedPosition = (0, import_react64.useMemo)(() => {
|
|
14345
14342
|
const positionCopy = { ...position };
|
|
14346
14343
|
if (popupRef.current) {
|
|
14347
14344
|
const rect = popupRef.current.getBoundingClientRect();
|
|
@@ -14385,7 +14382,7 @@ function EventsPopup({
|
|
|
14385
14382
|
className: "rounded-full p-1 hover:bg-muted",
|
|
14386
14383
|
onClick: onClose,
|
|
14387
14384
|
type: "button",
|
|
14388
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
|
|
14385
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(import_react65.XIcon, { className: "h-4 w-4" })
|
|
14389
14386
|
}
|
|
14390
14387
|
)
|
|
14391
14388
|
] }),
|
|
@@ -14422,11 +14419,11 @@ function EventsPopup({
|
|
|
14422
14419
|
// src/components/event-calendar/hooks/use-current-time-indicator.ts
|
|
14423
14420
|
var import_date_fns11 = require("date-fns");
|
|
14424
14421
|
var import_locale6 = require("date-fns/locale");
|
|
14425
|
-
var
|
|
14422
|
+
var import_react66 = require("react");
|
|
14426
14423
|
function useCurrentTimeIndicator(currentDate, view) {
|
|
14427
|
-
const [currentTimePosition, setCurrentTimePosition] = (0,
|
|
14428
|
-
const [currentTimeVisible, setCurrentTimeVisible] = (0,
|
|
14429
|
-
(0,
|
|
14424
|
+
const [currentTimePosition, setCurrentTimePosition] = (0, import_react66.useState)(0);
|
|
14425
|
+
const [currentTimeVisible, setCurrentTimeVisible] = (0, import_react66.useState)(false);
|
|
14426
|
+
(0, import_react66.useEffect)(() => {
|
|
14430
14427
|
const calculateTimePosition = () => {
|
|
14431
14428
|
const now = /* @__PURE__ */ new Date();
|
|
14432
14429
|
const hours = now.getHours();
|
|
@@ -14457,15 +14454,15 @@ function useCurrentTimeIndicator(currentDate, view) {
|
|
|
14457
14454
|
}
|
|
14458
14455
|
|
|
14459
14456
|
// src/components/event-calendar/hooks/use-event-visibility.ts
|
|
14460
|
-
var
|
|
14457
|
+
var import_react67 = require("react");
|
|
14461
14458
|
function useEventVisibility({
|
|
14462
14459
|
eventHeight,
|
|
14463
14460
|
eventGap
|
|
14464
14461
|
}) {
|
|
14465
|
-
const contentRef = (0,
|
|
14466
|
-
const observerRef = (0,
|
|
14467
|
-
const [contentHeight, setContentHeight] = (0,
|
|
14468
|
-
(0,
|
|
14462
|
+
const contentRef = (0, import_react67.useRef)(null);
|
|
14463
|
+
const observerRef = (0, import_react67.useRef)(null);
|
|
14464
|
+
const [contentHeight, setContentHeight] = (0, import_react67.useState)(null);
|
|
14465
|
+
(0, import_react67.useLayoutEffect)(() => {
|
|
14469
14466
|
if (!contentRef.current) return;
|
|
14470
14467
|
const updateHeight = () => {
|
|
14471
14468
|
if (contentRef.current) {
|
|
@@ -14485,7 +14482,7 @@ function useEventVisibility({
|
|
|
14485
14482
|
}
|
|
14486
14483
|
};
|
|
14487
14484
|
}, []);
|
|
14488
|
-
const getVisibleEventCount = (0,
|
|
14485
|
+
const getVisibleEventCount = (0, import_react67.useMemo)(() => {
|
|
14489
14486
|
return (totalEvents) => {
|
|
14490
14487
|
if (!contentHeight) return totalEvents;
|
|
14491
14488
|
const maxEvents = Math.floor(contentHeight / (eventHeight + eventGap));
|
|
@@ -14505,7 +14502,7 @@ function useEventVisibility({
|
|
|
14505
14502
|
// src/components/event-calendar/MonthView.tsx
|
|
14506
14503
|
var import_date_fns12 = require("date-fns");
|
|
14507
14504
|
var import_locale7 = require("date-fns/locale");
|
|
14508
|
-
var
|
|
14505
|
+
var import_react68 = require("react");
|
|
14509
14506
|
var import_jsx_runtime82 = require("react/jsx-runtime");
|
|
14510
14507
|
function MonthView({
|
|
14511
14508
|
currentDate,
|
|
@@ -14513,21 +14510,21 @@ function MonthView({
|
|
|
14513
14510
|
onEventSelect,
|
|
14514
14511
|
onEventCreate
|
|
14515
14512
|
}) {
|
|
14516
|
-
const days = (0,
|
|
14513
|
+
const days = (0, import_react68.useMemo)(() => {
|
|
14517
14514
|
const monthStart = (0, import_date_fns12.startOfMonth)(currentDate);
|
|
14518
14515
|
const monthEnd = (0, import_date_fns12.endOfMonth)(monthStart);
|
|
14519
14516
|
const calendarStart = (0, import_date_fns12.startOfWeek)(monthStart, { weekStartsOn: 0 });
|
|
14520
14517
|
const calendarEnd = (0, import_date_fns12.endOfWeek)(monthEnd, { weekStartsOn: 0 });
|
|
14521
14518
|
return (0, import_date_fns12.eachDayOfInterval)({ end: calendarEnd, start: calendarStart });
|
|
14522
14519
|
}, [currentDate]);
|
|
14523
|
-
const weekdays = (0,
|
|
14520
|
+
const weekdays = (0, import_react68.useMemo)(() => {
|
|
14524
14521
|
return Array.from({ length: 7 }).map((_, i) => {
|
|
14525
14522
|
const date = (0, import_date_fns12.addDays)((0, import_date_fns12.startOfWeek)(/* @__PURE__ */ new Date(), { weekStartsOn: 0 }), i);
|
|
14526
14523
|
const short = (0, import_date_fns12.format)(date, "EEE", { locale: import_locale7.ptBR });
|
|
14527
14524
|
return short.charAt(0).toUpperCase() + short.slice(1);
|
|
14528
14525
|
});
|
|
14529
14526
|
}, []);
|
|
14530
|
-
const weeks = (0,
|
|
14527
|
+
const weeks = (0, import_react68.useMemo)(() => {
|
|
14531
14528
|
const result = [];
|
|
14532
14529
|
let week = [];
|
|
14533
14530
|
for (let i = 0; i < days.length; i++) {
|
|
@@ -14543,12 +14540,12 @@ function MonthView({
|
|
|
14543
14540
|
e.stopPropagation();
|
|
14544
14541
|
onEventSelect(event);
|
|
14545
14542
|
};
|
|
14546
|
-
const [isMounted, setIsMounted] = (0,
|
|
14543
|
+
const [isMounted, setIsMounted] = (0, import_react68.useState)(false);
|
|
14547
14544
|
const { contentRef, getVisibleEventCount } = useEventVisibility({
|
|
14548
14545
|
eventGap: EventGap,
|
|
14549
14546
|
eventHeight: EventHeight
|
|
14550
14547
|
});
|
|
14551
|
-
(0,
|
|
14548
|
+
(0, import_react68.useEffect)(() => {
|
|
14552
14549
|
setIsMounted(true);
|
|
14553
14550
|
}, []);
|
|
14554
14551
|
return /* @__PURE__ */ (0, import_jsx_runtime82.jsxs)("div", { className: "contents", "data-slot": "month-view", children: [
|
|
@@ -14824,7 +14821,7 @@ function addHoursToDate(date, hours) {
|
|
|
14824
14821
|
// src/components/event-calendar/WeekView.tsx
|
|
14825
14822
|
var import_date_fns15 = require("date-fns");
|
|
14826
14823
|
var import_locale8 = require("date-fns/locale");
|
|
14827
|
-
var
|
|
14824
|
+
var import_react69 = require("react");
|
|
14828
14825
|
var import_jsx_runtime83 = require("react/jsx-runtime");
|
|
14829
14826
|
function WeekView({
|
|
14830
14827
|
currentDate,
|
|
@@ -14832,23 +14829,23 @@ function WeekView({
|
|
|
14832
14829
|
onEventSelect,
|
|
14833
14830
|
onEventCreate
|
|
14834
14831
|
}) {
|
|
14835
|
-
const days = (0,
|
|
14832
|
+
const days = (0, import_react69.useMemo)(() => {
|
|
14836
14833
|
const weekStart2 = (0, import_date_fns15.startOfWeek)(currentDate, { weekStartsOn: 0 });
|
|
14837
14834
|
const weekEnd = (0, import_date_fns15.endOfWeek)(currentDate, { weekStartsOn: 0 });
|
|
14838
14835
|
return (0, import_date_fns15.eachDayOfInterval)({ end: weekEnd, start: weekStart2 });
|
|
14839
14836
|
}, [currentDate]);
|
|
14840
|
-
const weekStart = (0,
|
|
14837
|
+
const weekStart = (0, import_react69.useMemo)(
|
|
14841
14838
|
() => (0, import_date_fns15.startOfWeek)(currentDate, { weekStartsOn: 0 }),
|
|
14842
14839
|
[currentDate]
|
|
14843
14840
|
);
|
|
14844
|
-
const hours = (0,
|
|
14841
|
+
const hours = (0, import_react69.useMemo)(() => {
|
|
14845
14842
|
const dayStart = (0, import_date_fns15.startOfDay)(currentDate);
|
|
14846
14843
|
return (0, import_date_fns15.eachHourOfInterval)({
|
|
14847
14844
|
end: (0, import_date_fns15.addHours)(dayStart, EndHour - 1),
|
|
14848
14845
|
start: (0, import_date_fns15.addHours)(dayStart, StartHour)
|
|
14849
14846
|
});
|
|
14850
14847
|
}, [currentDate]);
|
|
14851
|
-
const allDayEvents = (0,
|
|
14848
|
+
const allDayEvents = (0, import_react69.useMemo)(() => {
|
|
14852
14849
|
return events.filter((event) => {
|
|
14853
14850
|
return event.allDay || isMultiDayEvent(event);
|
|
14854
14851
|
}).filter((event) => {
|
|
@@ -14859,7 +14856,7 @@ function WeekView({
|
|
|
14859
14856
|
);
|
|
14860
14857
|
});
|
|
14861
14858
|
}, [events, days]);
|
|
14862
|
-
const processedDayEvents = (0,
|
|
14859
|
+
const processedDayEvents = (0, import_react69.useMemo)(() => {
|
|
14863
14860
|
const result = days.map((day) => {
|
|
14864
14861
|
const dayEvents = events.filter((event) => {
|
|
14865
14862
|
if (event.allDay || isMultiDayEvent(event)) return false;
|
|
@@ -15105,11 +15102,11 @@ function WeekView({
|
|
|
15105
15102
|
}
|
|
15106
15103
|
|
|
15107
15104
|
// src/components/ui/form/CheckBoxThree.tsx
|
|
15108
|
-
var
|
|
15105
|
+
var import_react70 = require("react");
|
|
15109
15106
|
var import_framer_motion19 = require("framer-motion");
|
|
15110
15107
|
var import_jsx_runtime84 = require("react/jsx-runtime");
|
|
15111
15108
|
function useCheckboxTree(initialTree) {
|
|
15112
|
-
const initialCheckedNodes = (0,
|
|
15109
|
+
const initialCheckedNodes = (0, import_react70.useMemo)(() => {
|
|
15113
15110
|
const checkedSet = /* @__PURE__ */ new Set();
|
|
15114
15111
|
const initializeCheckedNodes = (node) => {
|
|
15115
15112
|
if (node.defaultChecked) {
|
|
@@ -15120,8 +15117,8 @@ function useCheckboxTree(initialTree) {
|
|
|
15120
15117
|
initializeCheckedNodes(initialTree);
|
|
15121
15118
|
return checkedSet;
|
|
15122
15119
|
}, [initialTree]);
|
|
15123
|
-
const [checkedNodes, setCheckedNodes] = (0,
|
|
15124
|
-
const isChecked = (0,
|
|
15120
|
+
const [checkedNodes, setCheckedNodes] = (0, import_react70.useState)(initialCheckedNodes);
|
|
15121
|
+
const isChecked = (0, import_react70.useCallback)(
|
|
15125
15122
|
(node) => {
|
|
15126
15123
|
if (!node.children) {
|
|
15127
15124
|
return checkedNodes.has(node.id);
|
|
@@ -15139,7 +15136,7 @@ function useCheckboxTree(initialTree) {
|
|
|
15139
15136
|
},
|
|
15140
15137
|
[checkedNodes]
|
|
15141
15138
|
);
|
|
15142
|
-
const handleCheck = (0,
|
|
15139
|
+
const handleCheck = (0, import_react70.useCallback)(
|
|
15143
15140
|
(node) => {
|
|
15144
15141
|
const newCheckedNodes = new Set(checkedNodes);
|
|
15145
15142
|
const toggleNode = (n, check) => {
|
|
@@ -15169,9 +15166,9 @@ function CheckboxTree({ tree, renderNode }) {
|
|
|
15169
15166
|
onCheckedChange,
|
|
15170
15167
|
children
|
|
15171
15168
|
}) => {
|
|
15172
|
-
const [open, setOpen] = (0,
|
|
15173
|
-
const checkboxRef = (0,
|
|
15174
|
-
(0,
|
|
15169
|
+
const [open, setOpen] = (0, import_react70.useState)(() => !!node.children && status !== false);
|
|
15170
|
+
const checkboxRef = (0, import_react70.useRef)(null);
|
|
15171
|
+
(0, import_react70.useEffect)(() => {
|
|
15175
15172
|
if (checkboxRef.current) {
|
|
15176
15173
|
checkboxRef.current.indeterminate = status === "indeterminate";
|
|
15177
15174
|
}
|
|
@@ -15255,11 +15252,11 @@ function CheckboxTree({ tree, renderNode }) {
|
|
|
15255
15252
|
}
|
|
15256
15253
|
|
|
15257
15254
|
// src/components/selects/MultiSelectBase.tsx
|
|
15258
|
-
var
|
|
15259
|
-
var
|
|
15255
|
+
var import_react71 = require("@phosphor-icons/react");
|
|
15256
|
+
var import_react72 = require("react");
|
|
15260
15257
|
var import_framer_motion20 = require("framer-motion");
|
|
15261
15258
|
var import_jsx_runtime85 = require("react/jsx-runtime");
|
|
15262
|
-
var MultiSelectContext = (0,
|
|
15259
|
+
var MultiSelectContext = (0, import_react72.createContext)(null);
|
|
15263
15260
|
function MultiSelectBase({
|
|
15264
15261
|
children,
|
|
15265
15262
|
values,
|
|
@@ -15269,12 +15266,12 @@ function MultiSelectBase({
|
|
|
15269
15266
|
empty,
|
|
15270
15267
|
error
|
|
15271
15268
|
}) {
|
|
15272
|
-
const [open, setOpen] = (0,
|
|
15273
|
-
const [internalValues, setInternalValues] = (0,
|
|
15269
|
+
const [open, setOpen] = (0, import_react72.useState)(false);
|
|
15270
|
+
const [internalValues, setInternalValues] = (0, import_react72.useState)(
|
|
15274
15271
|
new Set(values ?? defaultValues)
|
|
15275
15272
|
);
|
|
15276
15273
|
const selectedValues = values ? new Set(values) : internalValues;
|
|
15277
|
-
const [items, setItems] = (0,
|
|
15274
|
+
const [items, setItems] = (0, import_react72.useState)(/* @__PURE__ */ new Map());
|
|
15278
15275
|
function toggleValue(value) {
|
|
15279
15276
|
if (disabled) return;
|
|
15280
15277
|
const getNewSet = (prev) => {
|
|
@@ -15289,7 +15286,7 @@ function MultiSelectBase({
|
|
|
15289
15286
|
setInternalValues(getNewSet);
|
|
15290
15287
|
onValuesChange?.([...getNewSet(selectedValues)]);
|
|
15291
15288
|
}
|
|
15292
|
-
const onItemAdded = (0,
|
|
15289
|
+
const onItemAdded = (0, import_react72.useCallback)((value, label) => {
|
|
15293
15290
|
setItems((prev) => {
|
|
15294
15291
|
if (prev.get(value) === label) return prev;
|
|
15295
15292
|
return new Map(prev).set(value, label);
|
|
@@ -15346,7 +15343,7 @@ function MultiSelectTriggerBase({
|
|
|
15346
15343
|
),
|
|
15347
15344
|
children: [
|
|
15348
15345
|
children,
|
|
15349
|
-
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
15346
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)(import_react71.CaretUpDownIcon, { className: "size-4 shrink-0 opacity-50" })
|
|
15350
15347
|
]
|
|
15351
15348
|
}
|
|
15352
15349
|
) }),
|
|
@@ -15361,13 +15358,13 @@ function MultiSelectValueBase({
|
|
|
15361
15358
|
...props
|
|
15362
15359
|
}) {
|
|
15363
15360
|
const { selectedValues, toggleValue, items, open } = useMultiSelectContext();
|
|
15364
|
-
const [overflowAmount, setOverflowAmount] = (0,
|
|
15365
|
-
const valueRef = (0,
|
|
15366
|
-
const overflowRef = (0,
|
|
15367
|
-
const mutationObserverRef = (0,
|
|
15368
|
-
const resizeObserverRef = (0,
|
|
15361
|
+
const [overflowAmount, setOverflowAmount] = (0, import_react72.useState)(0);
|
|
15362
|
+
const valueRef = (0, import_react72.useRef)(null);
|
|
15363
|
+
const overflowRef = (0, import_react72.useRef)(null);
|
|
15364
|
+
const mutationObserverRef = (0, import_react72.useRef)(null);
|
|
15365
|
+
const resizeObserverRef = (0, import_react72.useRef)(null);
|
|
15369
15366
|
const shouldWrap = overflowBehavior === "wrap" || overflowBehavior === "wrap-when-open" && open;
|
|
15370
|
-
const checkOverflow = (0,
|
|
15367
|
+
const checkOverflow = (0, import_react72.useCallback)(() => {
|
|
15371
15368
|
if (valueRef.current == null) return;
|
|
15372
15369
|
const containerElement = valueRef.current;
|
|
15373
15370
|
const overflowElement = overflowRef.current;
|
|
@@ -15388,7 +15385,7 @@ function MultiSelectValueBase({
|
|
|
15388
15385
|
}
|
|
15389
15386
|
setOverflowAmount(amount);
|
|
15390
15387
|
}, []);
|
|
15391
|
-
const handleResize = (0,
|
|
15388
|
+
const handleResize = (0, import_react72.useCallback)(
|
|
15392
15389
|
(node) => {
|
|
15393
15390
|
if (node == null) {
|
|
15394
15391
|
valueRef.current = null;
|
|
@@ -15451,7 +15448,7 @@ function MultiSelectValueBase({
|
|
|
15451
15448
|
} : void 0,
|
|
15452
15449
|
children: [
|
|
15453
15450
|
items.get(value),
|
|
15454
|
-
clickToRemove && /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
15451
|
+
clickToRemove && /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(import_react71.XIcon, { className: "size-3 text-muted-foreground group-hover:text-destructive" })
|
|
15455
15452
|
]
|
|
15456
15453
|
},
|
|
15457
15454
|
value
|
|
@@ -15511,7 +15508,7 @@ function MultiSelectItemBase({
|
|
|
15511
15508
|
}) {
|
|
15512
15509
|
const { toggleValue, selectedValues, onItemAdded } = useMultiSelectContext();
|
|
15513
15510
|
const isSelected = selectedValues.has(value);
|
|
15514
|
-
(0,
|
|
15511
|
+
(0, import_react72.useEffect)(() => {
|
|
15515
15512
|
onItemAdded(value, badgeLabel ?? children);
|
|
15516
15513
|
}, [value, children, onItemAdded, badgeLabel]);
|
|
15517
15514
|
return /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
@@ -15535,7 +15532,7 @@ function MultiSelectItemBase({
|
|
|
15535
15532
|
initial: { scale: 0 },
|
|
15536
15533
|
animate: { scale: isSelected ? 1 : 0 },
|
|
15537
15534
|
transition: { type: "spring", stiffness: 500, damping: 30 },
|
|
15538
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
15535
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(import_react71.CheckIcon, { className: "size-4" })
|
|
15539
15536
|
}
|
|
15540
15537
|
) }),
|
|
15541
15538
|
children
|
|
@@ -15552,7 +15549,7 @@ function MultiSelectSeparatorBase(props) {
|
|
|
15552
15549
|
return /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(CommandSeparatorBase, { ...props });
|
|
15553
15550
|
}
|
|
15554
15551
|
function useMultiSelectContext() {
|
|
15555
|
-
const context = (0,
|
|
15552
|
+
const context = (0, import_react72.useContext)(MultiSelectContext);
|
|
15556
15553
|
if (context == null) {
|
|
15557
15554
|
throw new Error(
|
|
15558
15555
|
"useMultiSelectContext must be used within a MultiSelectContext"
|
|
@@ -15569,13 +15566,13 @@ function debounce(func, wait) {
|
|
|
15569
15566
|
}
|
|
15570
15567
|
|
|
15571
15568
|
// src/hooks/use-drag.tsx
|
|
15572
|
-
var
|
|
15569
|
+
var import_react73 = require("react");
|
|
15573
15570
|
var useDrag = (options = {}) => {
|
|
15574
|
-
const [isDragging, setIsDragging] = (0,
|
|
15575
|
-
const [positions, setPositions] = (0,
|
|
15576
|
-
const dragStartPos = (0,
|
|
15577
|
-
const dragId = (0,
|
|
15578
|
-
const handleMouseDown = (0,
|
|
15571
|
+
const [isDragging, setIsDragging] = (0, import_react73.useState)(null);
|
|
15572
|
+
const [positions, setPositions] = (0, import_react73.useState)({});
|
|
15573
|
+
const dragStartPos = (0, import_react73.useRef)(null);
|
|
15574
|
+
const dragId = (0, import_react73.useRef)(null);
|
|
15575
|
+
const handleMouseDown = (0, import_react73.useCallback)((id, e) => {
|
|
15579
15576
|
e.preventDefault();
|
|
15580
15577
|
const currentPosition = positions[id] || { top: 0, left: 0 };
|
|
15581
15578
|
dragStartPos.current = {
|
|
@@ -15588,7 +15585,7 @@ var useDrag = (options = {}) => {
|
|
|
15588
15585
|
setIsDragging(id);
|
|
15589
15586
|
options.onDragStart?.(id);
|
|
15590
15587
|
}, [positions, options]);
|
|
15591
|
-
const handleMouseMove = (0,
|
|
15588
|
+
const handleMouseMove = (0, import_react73.useCallback)((e) => {
|
|
15592
15589
|
if (!isDragging || !dragStartPos.current || !dragId.current) return;
|
|
15593
15590
|
const deltaX = e.clientX - dragStartPos.current.x;
|
|
15594
15591
|
const deltaY = e.clientY - dragStartPos.current.y;
|
|
@@ -15604,7 +15601,7 @@ var useDrag = (options = {}) => {
|
|
|
15604
15601
|
}));
|
|
15605
15602
|
options.onDrag?.(dragId.current, newPosition);
|
|
15606
15603
|
}, [isDragging, options]);
|
|
15607
|
-
const handleMouseUp = (0,
|
|
15604
|
+
const handleMouseUp = (0, import_react73.useCallback)(() => {
|
|
15608
15605
|
if (dragId.current) {
|
|
15609
15606
|
options.onDragEnd?.(dragId.current);
|
|
15610
15607
|
}
|
|
@@ -15612,7 +15609,7 @@ var useDrag = (options = {}) => {
|
|
|
15612
15609
|
dragStartPos.current = null;
|
|
15613
15610
|
dragId.current = null;
|
|
15614
15611
|
}, [options]);
|
|
15615
|
-
(0,
|
|
15612
|
+
(0, import_react73.useEffect)(() => {
|
|
15616
15613
|
if (isDragging) {
|
|
15617
15614
|
document.addEventListener("mousemove", handleMouseMove);
|
|
15618
15615
|
document.addEventListener("mouseup", handleMouseUp);
|
|
@@ -15624,16 +15621,16 @@ var useDrag = (options = {}) => {
|
|
|
15624
15621
|
};
|
|
15625
15622
|
}
|
|
15626
15623
|
}, [isDragging, handleMouseMove, handleMouseUp]);
|
|
15627
|
-
const setPosition = (0,
|
|
15624
|
+
const setPosition = (0, import_react73.useCallback)((id, position) => {
|
|
15628
15625
|
setPositions((prev) => ({
|
|
15629
15626
|
...prev,
|
|
15630
15627
|
[id]: position
|
|
15631
15628
|
}));
|
|
15632
15629
|
}, []);
|
|
15633
|
-
const getPosition = (0,
|
|
15630
|
+
const getPosition = (0, import_react73.useCallback)((id) => {
|
|
15634
15631
|
return positions[id] || { top: 0, left: 0 };
|
|
15635
15632
|
}, [positions]);
|
|
15636
|
-
const isElementDragging = (0,
|
|
15633
|
+
const isElementDragging = (0, import_react73.useCallback)((id) => {
|
|
15637
15634
|
return isDragging === id;
|
|
15638
15635
|
}, [isDragging]);
|
|
15639
15636
|
return {
|
package/dist/index.mjs
CHANGED
|
@@ -12900,19 +12900,14 @@ function EventCalendar({
|
|
|
12900
12900
|
onEventUpdate,
|
|
12901
12901
|
onEventDelete,
|
|
12902
12902
|
className,
|
|
12903
|
-
initialView = "month"
|
|
12904
|
-
mode = "default"
|
|
12903
|
+
initialView = "month"
|
|
12905
12904
|
}) {
|
|
12906
|
-
const isAgendaOnly = mode === "agenda-only";
|
|
12907
12905
|
const [currentDate, setCurrentDate] = useState24(/* @__PURE__ */ new Date());
|
|
12908
|
-
const [view, setView] = useState24(
|
|
12909
|
-
isAgendaOnly ? "agenda" : initialView
|
|
12910
|
-
);
|
|
12906
|
+
const [view, setView] = useState24(initialView);
|
|
12911
12907
|
const [isFading, setIsFading] = useState24(false);
|
|
12912
12908
|
const FADE_DURATION = 220;
|
|
12913
12909
|
const changeView = useCallback12(
|
|
12914
12910
|
(next) => {
|
|
12915
|
-
if (isAgendaOnly) return;
|
|
12916
12911
|
if (next === view) return;
|
|
12917
12912
|
setIsFading(true);
|
|
12918
12913
|
window.setTimeout(() => {
|
|
@@ -12920,7 +12915,7 @@ function EventCalendar({
|
|
|
12920
12915
|
requestAnimationFrame(() => setIsFading(false));
|
|
12921
12916
|
}, FADE_DURATION);
|
|
12922
12917
|
},
|
|
12923
|
-
[view
|
|
12918
|
+
[view]
|
|
12924
12919
|
);
|
|
12925
12920
|
const [isPaging, setIsPaging] = useState24(false);
|
|
12926
12921
|
const [pageDirection, setPageDirection] = useState24(
|
|
@@ -12950,7 +12945,6 @@ function EventCalendar({
|
|
|
12950
12945
|
if (isEventDialogOpen || e.target instanceof HTMLInputElement || e.target instanceof HTMLTextAreaElement || e.target instanceof HTMLElement && e.target.isContentEditable) {
|
|
12951
12946
|
return;
|
|
12952
12947
|
}
|
|
12953
|
-
if (isAgendaOnly) return;
|
|
12954
12948
|
switch (e.key.toLowerCase()) {
|
|
12955
12949
|
case "m":
|
|
12956
12950
|
changeView("month");
|
|
@@ -12971,7 +12965,7 @@ function EventCalendar({
|
|
|
12971
12965
|
return () => {
|
|
12972
12966
|
window.removeEventListener("keydown", handleKeyDown);
|
|
12973
12967
|
};
|
|
12974
|
-
}, [isEventDialogOpen, changeView
|
|
12968
|
+
}, [isEventDialogOpen, changeView]);
|
|
12975
12969
|
const handlePrevious = () => {
|
|
12976
12970
|
pageTransition(() => {
|
|
12977
12971
|
if (view === "month") {
|
|
@@ -13002,13 +12996,11 @@ function EventCalendar({
|
|
|
13002
12996
|
setCurrentDate(/* @__PURE__ */ new Date());
|
|
13003
12997
|
};
|
|
13004
12998
|
const handleEventSelect = (event) => {
|
|
13005
|
-
if (isAgendaOnly) return;
|
|
13006
12999
|
console.log("Event selected:", event);
|
|
13007
13000
|
setSelectedEvent(event);
|
|
13008
13001
|
setIsEventDialogOpen(true);
|
|
13009
13002
|
};
|
|
13010
13003
|
const handleEventCreate = (startTime) => {
|
|
13011
|
-
if (isAgendaOnly) return;
|
|
13012
13004
|
console.log("Creating new event at:", startTime);
|
|
13013
13005
|
const minutes = startTime.getMinutes();
|
|
13014
13006
|
const remainder = minutes % 15;
|
|
@@ -13035,9 +13027,13 @@ function EventCalendar({
|
|
|
13035
13027
|
if (event.id) {
|
|
13036
13028
|
onEventUpdate?.(event);
|
|
13037
13029
|
toast3(`Evento "${event.title}" atualizado`, {
|
|
13038
|
-
description: format5(
|
|
13039
|
-
|
|
13040
|
-
|
|
13030
|
+
description: format5(
|
|
13031
|
+
new Date(event.start ?? event.attend_date ?? event.end ?? Date.now()),
|
|
13032
|
+
"d 'de' MMMM 'de' yyyy",
|
|
13033
|
+
{
|
|
13034
|
+
locale: ptBR4
|
|
13035
|
+
}
|
|
13036
|
+
),
|
|
13041
13037
|
position: "bottom-left"
|
|
13042
13038
|
});
|
|
13043
13039
|
} else {
|
|
@@ -13046,9 +13042,11 @@ function EventCalendar({
|
|
|
13046
13042
|
id: Math.random().toString(36).substring(2, 11)
|
|
13047
13043
|
});
|
|
13048
13044
|
toast3(`Evento "${event.title}" adicionado`, {
|
|
13049
|
-
description: format5(
|
|
13050
|
-
|
|
13051
|
-
|
|
13045
|
+
description: format5(
|
|
13046
|
+
new Date(event.start ?? event.attend_date ?? event.end ?? Date.now()),
|
|
13047
|
+
"d 'de' MMMM 'de' yyyy",
|
|
13048
|
+
{ locale: ptBR4 }
|
|
13049
|
+
),
|
|
13052
13050
|
position: "bottom-left"
|
|
13053
13051
|
});
|
|
13054
13052
|
}
|
|
@@ -13063,7 +13061,9 @@ function EventCalendar({
|
|
|
13063
13061
|
if (deletedEvent) {
|
|
13064
13062
|
toast3(`Evento "${deletedEvent.title}" exclu\xEDdo`, {
|
|
13065
13063
|
description: format5(
|
|
13066
|
-
new Date(
|
|
13064
|
+
new Date(
|
|
13065
|
+
deletedEvent.start ?? deletedEvent.attend_date ?? deletedEvent.end ?? Date.now()
|
|
13066
|
+
),
|
|
13067
13067
|
"d 'de' MMMM 'de' yyyy",
|
|
13068
13068
|
{ locale: ptBR4 }
|
|
13069
13069
|
),
|
|
@@ -13075,7 +13075,9 @@ function EventCalendar({
|
|
|
13075
13075
|
onEventUpdate?.(updatedEvent);
|
|
13076
13076
|
toast3(`Evento "${updatedEvent.title}" movido`, {
|
|
13077
13077
|
description: format5(
|
|
13078
|
-
new Date(
|
|
13078
|
+
new Date(
|
|
13079
|
+
updatedEvent.start ?? updatedEvent.attend_date ?? updatedEvent.end ?? Date.now()
|
|
13080
|
+
),
|
|
13079
13081
|
"d 'de' MMMM 'de' yyyy",
|
|
13080
13082
|
{ locale: ptBR4 }
|
|
13081
13083
|
),
|
|
@@ -13133,7 +13135,7 @@ function EventCalendar({
|
|
|
13133
13135
|
),
|
|
13134
13136
|
children: [
|
|
13135
13137
|
/* @__PURE__ */ jsxs58("div", { className: "flex items-center gap-1 sm:gap-4", children: [
|
|
13136
|
-
|
|
13138
|
+
/* @__PURE__ */ jsxs58(
|
|
13137
13139
|
ButtonBase,
|
|
13138
13140
|
{
|
|
13139
13141
|
className: "max-[479px]:aspect-square max-[479px]:p-0!",
|
|
@@ -13176,7 +13178,7 @@ function EventCalendar({
|
|
|
13176
13178
|
] }),
|
|
13177
13179
|
/* @__PURE__ */ jsx78("h2", { className: "font-semibold text-sm sm:text-lg md:text-xl", children: viewTitle })
|
|
13178
13180
|
] }),
|
|
13179
|
-
/* @__PURE__ */ jsx78("div", { className: "flex items-center gap-2", children:
|
|
13181
|
+
/* @__PURE__ */ jsx78("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ jsxs58(Fragment11, { children: [
|
|
13180
13182
|
/* @__PURE__ */ jsxs58(DropDownMenuBase, { children: [
|
|
13181
13183
|
/* @__PURE__ */ jsx78(DropDownMenuTriggerBase, { asChild: true, children: /* @__PURE__ */ jsxs58(
|
|
13182
13184
|
ButtonBase,
|
|
@@ -13221,8 +13223,7 @@ function EventCalendar({
|
|
|
13221
13223
|
/* @__PURE__ */ jsx78(DropDownMenuShortcutBase, { children: "M" })
|
|
13222
13224
|
] }),
|
|
13223
13225
|
/* @__PURE__ */ jsxs58(DropDownMenuItemBase, { onClick: () => changeView("week"), children: [
|
|
13224
|
-
"Semana",
|
|
13225
|
-
" ",
|
|
13226
|
+
"Semana ",
|
|
13226
13227
|
/* @__PURE__ */ jsx78(DropDownMenuShortcutBase, { children: "S" })
|
|
13227
13228
|
] }),
|
|
13228
13229
|
/* @__PURE__ */ jsxs58(DropDownMenuItemBase, { onClick: () => changeView("day"), children: [
|
|
@@ -13230,8 +13231,7 @@ function EventCalendar({
|
|
|
13230
13231
|
/* @__PURE__ */ jsx78(DropDownMenuShortcutBase, { children: "D" })
|
|
13231
13232
|
] }),
|
|
13232
13233
|
/* @__PURE__ */ jsxs58(DropDownMenuItemBase, { onClick: () => changeView("agenda"), children: [
|
|
13233
|
-
"Agenda",
|
|
13234
|
-
" ",
|
|
13234
|
+
"Agenda ",
|
|
13235
13235
|
/* @__PURE__ */ jsx78(DropDownMenuShortcutBase, { children: "A" })
|
|
13236
13236
|
] })
|
|
13237
13237
|
] })
|
|
@@ -13303,8 +13303,7 @@ function EventCalendar({
|
|
|
13303
13303
|
{
|
|
13304
13304
|
currentDate,
|
|
13305
13305
|
events,
|
|
13306
|
-
onEventSelect:
|
|
13307
|
-
showUndatedEvents: isAgendaOnly
|
|
13306
|
+
onEventSelect: handleEventSelect
|
|
13308
13307
|
}
|
|
13309
13308
|
)
|
|
13310
13309
|
]
|
|
@@ -13333,7 +13332,7 @@ function EventCalendar({
|
|
|
13333
13332
|
"--event-height": `${EventHeight}px`,
|
|
13334
13333
|
"--week-cells-height": `${WeekCellsHeight}px`
|
|
13335
13334
|
},
|
|
13336
|
-
children:
|
|
13335
|
+
children: /* @__PURE__ */ jsx78(CalendarDndProvider, { onEventUpdate: handleEventUpdate, children: calendarContent })
|
|
13337
13336
|
}
|
|
13338
13337
|
);
|
|
13339
13338
|
}
|
|
@@ -13803,6 +13802,9 @@ function EventDialog({
|
|
|
13803
13802
|
// src/components/event-calendar/EventItem.tsx
|
|
13804
13803
|
import { differenceInMinutes as differenceInMinutes3, format as format7, isPast } from "date-fns";
|
|
13805
13804
|
import { useMemo as useMemo13 } from "react";
|
|
13805
|
+
import {
|
|
13806
|
+
ClockUserIcon
|
|
13807
|
+
} from "@phosphor-icons/react";
|
|
13806
13808
|
import { Fragment as Fragment12, jsx as jsx80, jsxs as jsxs60 } from "react/jsx-runtime";
|
|
13807
13809
|
var formatTimeWithOptionalMinutes = (date) => {
|
|
13808
13810
|
return format7(date, "HH:mm");
|
|
@@ -13830,17 +13832,26 @@ function EventWrapper({
|
|
|
13830
13832
|
onTouchStart,
|
|
13831
13833
|
ariaLabel
|
|
13832
13834
|
}) {
|
|
13833
|
-
const hasValidTimeForWrapper = isValidDate(event.start) && isValidDate(event.end);
|
|
13834
|
-
const displayEnd =
|
|
13835
|
-
|
|
13836
|
-
|
|
13835
|
+
const hasValidTimeForWrapper = isValidDate(event.start) && isValidDate(event.end) || isValidDate(event.attend_date);
|
|
13836
|
+
const displayEnd = (() => {
|
|
13837
|
+
if (isValidDate(event.start) && isValidDate(event.end)) {
|
|
13838
|
+
return currentTime ? new Date(
|
|
13839
|
+
new Date(currentTime).getTime() + (new Date(event.end).getTime() - new Date(event.start).getTime())
|
|
13840
|
+
) : new Date(event.end);
|
|
13841
|
+
}
|
|
13842
|
+
if (isValidDate(event.attend_date)) {
|
|
13843
|
+
const start = new Date(event.attend_date);
|
|
13844
|
+
return addHoursToDate(start, 1);
|
|
13845
|
+
}
|
|
13846
|
+
return void 0;
|
|
13847
|
+
})();
|
|
13837
13848
|
const isEventInPast = displayEnd ? isPast(displayEnd) : false;
|
|
13838
13849
|
const colorClasses = hasValidTimeForWrapper ? getEventColorClasses(event.color) : "bg-gray-200/50 hover:bg-gray-200/40 text-gray-900/80 dark:bg-gray-700/25 dark:text-gray-200/90 shadow-none";
|
|
13839
13850
|
return /* @__PURE__ */ jsx80(
|
|
13840
13851
|
"button",
|
|
13841
13852
|
{
|
|
13842
13853
|
className: cn(
|
|
13843
|
-
"flex w-full select-none overflow-hidden 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
|
|
13854
|
+
"flex w-full select-none overflow-hidden 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 ",
|
|
13844
13855
|
colorClasses,
|
|
13845
13856
|
getBorderRadiusClasses(isFirstDay, isLastDay),
|
|
13846
13857
|
className
|
|
@@ -13861,7 +13872,6 @@ function EventWrapper({
|
|
|
13861
13872
|
function EventItem({
|
|
13862
13873
|
event,
|
|
13863
13874
|
view,
|
|
13864
|
-
isDragging,
|
|
13865
13875
|
onClick,
|
|
13866
13876
|
showTime,
|
|
13867
13877
|
currentTime,
|
|
@@ -13940,12 +13950,9 @@ function EventItem({
|
|
|
13940
13950
|
dndListeners,
|
|
13941
13951
|
event,
|
|
13942
13952
|
ariaLabel,
|
|
13943
|
-
isDragging,
|
|
13944
13953
|
isFirstDay,
|
|
13945
13954
|
isLastDay,
|
|
13946
13955
|
onClick,
|
|
13947
|
-
onMouseDown,
|
|
13948
|
-
onTouchStart,
|
|
13949
13956
|
children: children || /* @__PURE__ */ jsxs60("span", { className: "flex items-center gap-2 truncate", children: [
|
|
13950
13957
|
!event.allDay && hasValidTime && displayStart && /* @__PURE__ */ jsx80("span", { className: "truncate font-normal opacity-80 sm:text-[11px] bg-white/10 px-2 py-0.5 rounded-full text-[11px]", children: formatTimeWithOptionalMinutes(displayStart) }),
|
|
13951
13958
|
/* @__PURE__ */ jsx80(
|
|
@@ -13977,27 +13984,22 @@ function EventItem({
|
|
|
13977
13984
|
dndListeners,
|
|
13978
13985
|
event,
|
|
13979
13986
|
ariaLabel,
|
|
13980
|
-
isDragging,
|
|
13981
13987
|
isFirstDay,
|
|
13982
13988
|
isLastDay,
|
|
13983
|
-
onClick,
|
|
13984
|
-
onMouseDown,
|
|
13985
|
-
onTouchStart,
|
|
13986
13989
|
children: durationMinutes < 45 ? /* @__PURE__ */ jsxs60("div", { className: "flex items-center justify-between w-full", children: [
|
|
13987
|
-
/* @__PURE__ */ jsx80("div", { className: cn("truncate
|
|
13990
|
+
/* @__PURE__ */ jsx80("div", { className: cn("truncate text-lg"), children: event.title }),
|
|
13988
13991
|
showTime && hasValidTime && displayStart && /* @__PURE__ */ jsx80("span", { className: "ml-2 inline-block bg-white/10 px-2 py-0.5 rounded-full text-[11px] opacity-90", children: formatTimeWithOptionalMinutes(displayStart) })
|
|
13989
13992
|
] }) : /* @__PURE__ */ jsxs60(Fragment12, { children: [
|
|
13990
13993
|
/* @__PURE__ */ jsx80(
|
|
13991
13994
|
"div",
|
|
13992
13995
|
{
|
|
13993
13996
|
className: cn(
|
|
13994
|
-
"truncate font-medium"
|
|
13995
|
-
agendaOnly ? "text-lg" : ""
|
|
13997
|
+
"truncate font-medium text-lg"
|
|
13996
13998
|
),
|
|
13997
13999
|
children: event.title
|
|
13998
14000
|
}
|
|
13999
14001
|
),
|
|
14000
|
-
showTime && hasValidTime && /* @__PURE__ */ jsx80("div", { className: "truncate font-normal opacity-70 sm:text-[
|
|
14002
|
+
showTime && hasValidTime && /* @__PURE__ */ jsx80("div", { className: "truncate font-normal opacity-70 sm:text-[15px]", children: /* @__PURE__ */ jsx80("span", { className: "inline-block bg-white/5 px-0.5 py-0.5 rounded-full", children: getEventTime() }) })
|
|
14001
14003
|
] })
|
|
14002
14004
|
}
|
|
14003
14005
|
);
|
|
@@ -14038,7 +14040,7 @@ function EventItem({
|
|
|
14038
14040
|
{
|
|
14039
14041
|
className: cn(
|
|
14040
14042
|
"my-1 opacity-90",
|
|
14041
|
-
agendaOnly ? "text-
|
|
14043
|
+
agendaOnly ? "text-md" : "text-xs"
|
|
14042
14044
|
),
|
|
14043
14045
|
style: {
|
|
14044
14046
|
display: "-webkit-box",
|
|
@@ -14057,7 +14059,7 @@ function EventItem({
|
|
|
14057
14059
|
"button",
|
|
14058
14060
|
{
|
|
14059
14061
|
className: cn(
|
|
14060
|
-
"flex w-full flex-col gap-2 rounded-lg p-3 text-left outline-none transition-shadow duration-150 ease-out hover:bg-white/3 focus-visible:ring-2 focus-visible:ring-ring/50 focus-visible:border-ring data-past-event:line-through data-past-event:opacity-90",
|
|
14062
|
+
"flex w-full flex-col gap-2 rounded-lg p-3 text-left outline-none transition-shadow duration-150 ease-out hover:bg-white/3 focus-visible:ring-2 focus-visible:ring-ring/50 focus-visible:border-ring data-past-event:line-through data-past-event:opacity-90 border-2 border-border",
|
|
14061
14063
|
colorClasses,
|
|
14062
14064
|
className
|
|
14063
14065
|
),
|
|
@@ -14070,32 +14072,29 @@ function EventItem({
|
|
|
14070
14072
|
...dndListeners,
|
|
14071
14073
|
...dndAttributes,
|
|
14072
14074
|
children: [
|
|
14073
|
-
/* @__PURE__ */
|
|
14074
|
-
|
|
14075
|
-
|
|
14076
|
-
|
|
14077
|
-
|
|
14078
|
-
|
|
14079
|
-
|
|
14080
|
-
|
|
14081
|
-
|
|
14082
|
-
event.allDay ? /* @__PURE__ */ jsx80("span", { className: "uppercase", children: "All day" }) : /* @__PURE__ */ jsxs60("span", { className: "uppercase", children: [
|
|
14075
|
+
/* @__PURE__ */ jsxs60("div", { className: "flex w-full justify-between border-b-2 border-black/5 ", children: [
|
|
14076
|
+
/* @__PURE__ */ jsx80("div", { className: cn("font-bold text-lg"), children: event.title }),
|
|
14077
|
+
/* @__PURE__ */ jsx80(
|
|
14078
|
+
"div",
|
|
14079
|
+
{
|
|
14080
|
+
className: cn(
|
|
14081
|
+
"opacity-90 flex items-center gap-2 text-lg"
|
|
14082
|
+
),
|
|
14083
|
+
children: event.allDay ? /* @__PURE__ */ jsx80("span", { children: "Dia todo" }) : /* @__PURE__ */ jsxs60("span", { className: "uppercase font-semibold flex items-center gap-2", children: [
|
|
14083
14084
|
formatTimeWithOptionalMinutes(displayStart),
|
|
14084
|
-
" -",
|
|
14085
|
-
|
|
14086
|
-
|
|
14087
|
-
] }),
|
|
14088
|
-
event.location && /* @__PURE__ */ jsxs60("span", { className: "opacity-80 flex items-center gap-1", children: [
|
|
14089
|
-
"-",
|
|
14090
|
-
/* @__PURE__ */ jsx80("span", { className: "truncate", children: event.location })
|
|
14085
|
+
/* @__PURE__ */ jsx80("span", { className: "opacity-70", children: "-" }),
|
|
14086
|
+
formatTimeWithOptionalMinutes(displayEnd),
|
|
14087
|
+
/* @__PURE__ */ jsx80(ClockUserIcon, {})
|
|
14091
14088
|
] })
|
|
14092
|
-
|
|
14093
|
-
|
|
14094
|
-
),
|
|
14089
|
+
}
|
|
14090
|
+
)
|
|
14091
|
+
] }),
|
|
14095
14092
|
event.description && /* @__PURE__ */ jsx80(
|
|
14096
14093
|
"div",
|
|
14097
14094
|
{
|
|
14098
|
-
className: cn(
|
|
14095
|
+
className: cn(
|
|
14096
|
+
"my-1 opacity-90 flex text-md"
|
|
14097
|
+
),
|
|
14099
14098
|
style: {
|
|
14100
14099
|
display: "-webkit-box",
|
|
14101
14100
|
WebkitLineClamp: 2,
|