@underverse-ui/underverse 0.2.91 → 0.2.93
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.cjs +263 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +32 -1
- package/dist/index.d.ts +32 -1
- package/dist/index.js +263 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -6596,6 +6596,17 @@ function Calendar2({
|
|
|
6596
6596
|
animate = false,
|
|
6597
6597
|
showEventBadges = false,
|
|
6598
6598
|
highlightWeekends = false,
|
|
6599
|
+
cellMode = "compact",
|
|
6600
|
+
maxEventsPerDay = 3,
|
|
6601
|
+
onEventClick,
|
|
6602
|
+
renderEvent,
|
|
6603
|
+
enableEventSheet,
|
|
6604
|
+
eventSheetSize = "md",
|
|
6605
|
+
renderEventSheet,
|
|
6606
|
+
selectedEventId,
|
|
6607
|
+
eventSheetOpen,
|
|
6608
|
+
onEventSheetOpenChange,
|
|
6609
|
+
onSelectedEventIdChange,
|
|
6599
6610
|
...rest
|
|
6600
6611
|
}) {
|
|
6601
6612
|
const isControlledMonth = month != null;
|
|
@@ -6626,6 +6637,60 @@ function Calendar2({
|
|
|
6626
6637
|
}
|
|
6627
6638
|
return map;
|
|
6628
6639
|
}, [events]);
|
|
6640
|
+
const effectiveEnableEventSheet = enableEventSheet ?? !!renderEventSheet;
|
|
6641
|
+
const isEventSheetOpenControlled = eventSheetOpen !== void 0;
|
|
6642
|
+
const [internalEventSheetOpen, setInternalEventSheetOpen] = React24.useState(false);
|
|
6643
|
+
const activeEventSheetOpen = isEventSheetOpenControlled ? !!eventSheetOpen : internalEventSheetOpen;
|
|
6644
|
+
const isSelectedEventControlled = selectedEventId !== void 0;
|
|
6645
|
+
const [internalSelectedEventRef, setInternalSelectedEventRef] = React24.useState(null);
|
|
6646
|
+
const setEventSheetOpen = React24.useCallback(
|
|
6647
|
+
(open) => {
|
|
6648
|
+
if (!isEventSheetOpenControlled) setInternalEventSheetOpen(open);
|
|
6649
|
+
onEventSheetOpenChange?.(open);
|
|
6650
|
+
if (!open) {
|
|
6651
|
+
if (!isSelectedEventControlled) setInternalSelectedEventRef(null);
|
|
6652
|
+
onSelectedEventIdChange?.(void 0);
|
|
6653
|
+
}
|
|
6654
|
+
},
|
|
6655
|
+
[isEventSheetOpenControlled, isSelectedEventControlled, onEventSheetOpenChange, onSelectedEventIdChange]
|
|
6656
|
+
);
|
|
6657
|
+
const selectedEventRef = React24.useMemo(() => {
|
|
6658
|
+
if (isSelectedEventControlled && selectedEventId != null) {
|
|
6659
|
+
const ev = events.find((e) => e.id === selectedEventId);
|
|
6660
|
+
if (!ev) return null;
|
|
6661
|
+
const d = toDate(ev.date);
|
|
6662
|
+
const dayKey = `${d.getFullYear()}-${d.getMonth()}-${d.getDate()}`;
|
|
6663
|
+
return { dayKey, eventId: selectedEventId };
|
|
6664
|
+
}
|
|
6665
|
+
return internalSelectedEventRef;
|
|
6666
|
+
}, [events, internalSelectedEventRef, isSelectedEventControlled, selectedEventId]);
|
|
6667
|
+
const selectedEvent = React24.useMemo(() => {
|
|
6668
|
+
if (!selectedEventRef) return null;
|
|
6669
|
+
const list = byDay.get(selectedEventRef.dayKey) || [];
|
|
6670
|
+
if (selectedEventRef.eventId != null) {
|
|
6671
|
+
return list.find((e) => e.id === selectedEventRef.eventId) || null;
|
|
6672
|
+
}
|
|
6673
|
+
const idx = selectedEventRef.index ?? -1;
|
|
6674
|
+
return idx >= 0 && idx < list.length ? list[idx] : null;
|
|
6675
|
+
}, [byDay, selectedEventRef]);
|
|
6676
|
+
const selectedEventDate = React24.useMemo(() => {
|
|
6677
|
+
if (!selectedEventRef) return null;
|
|
6678
|
+
const [y, m, d] = selectedEventRef.dayKey.split("-").map((x) => Number(x));
|
|
6679
|
+
if (!Number.isFinite(y) || !Number.isFinite(m) || !Number.isFinite(d)) return null;
|
|
6680
|
+
return new Date(y, m, d);
|
|
6681
|
+
}, [selectedEventRef]);
|
|
6682
|
+
const handleEventActivate = React24.useCallback(
|
|
6683
|
+
(event, date, dayKey, index) => {
|
|
6684
|
+
onEventClick?.(event, date);
|
|
6685
|
+
onSelectedEventIdChange?.(event.id ?? void 0);
|
|
6686
|
+
if (!effectiveEnableEventSheet) return;
|
|
6687
|
+
if (!isSelectedEventControlled) {
|
|
6688
|
+
setInternalSelectedEventRef({ dayKey, eventId: event.id, index });
|
|
6689
|
+
}
|
|
6690
|
+
setEventSheetOpen(true);
|
|
6691
|
+
},
|
|
6692
|
+
[effectiveEnableEventSheet, isSelectedEventControlled, onEventClick, onSelectedEventIdChange, setEventSheetOpen]
|
|
6693
|
+
);
|
|
6629
6694
|
const isSelected = (d) => {
|
|
6630
6695
|
if (!selected) return false;
|
|
6631
6696
|
if (selectMode === "single" && selected instanceof Date) return isSameDay(selected, d);
|
|
@@ -6688,6 +6753,13 @@ function Calendar2({
|
|
|
6688
6753
|
xl: { day: "w-14 h-14 text-lg", grid: dense ? "gap-2" : "gap-2.5", head: "text-base", header: "text-lg" }
|
|
6689
6754
|
};
|
|
6690
6755
|
const sz = SIZE_STYLES3[size];
|
|
6756
|
+
const CELL_EVENT_STYLES = {
|
|
6757
|
+
sm: { cell: dense ? "min-h-20 p-1.5" : "min-h-24 p-2", day: "text-[12px]" },
|
|
6758
|
+
md: { cell: dense ? "min-h-28 p-2" : "min-h-32 p-2.5", day: "text-sm" },
|
|
6759
|
+
lg: { cell: dense ? "min-h-36 p-2.5" : "min-h-40 p-3", day: "text-base" },
|
|
6760
|
+
xl: { cell: dense ? "min-h-44 p-3" : "min-h-52 p-3.5", day: "text-lg" }
|
|
6761
|
+
};
|
|
6762
|
+
const cellSz = CELL_EVENT_STYLES[size];
|
|
6691
6763
|
const VARIANT_STYLES2 = {
|
|
6692
6764
|
default: "border border-border rounded-2xl bg-card",
|
|
6693
6765
|
bordered: "border-2 border-border rounded-2xl bg-card shadow-sm",
|
|
@@ -6711,6 +6783,84 @@ function Calendar2({
|
|
|
6711
6783
|
const k = `${d.getFullYear()}-${d.getMonth()}-${d.getDate()}`;
|
|
6712
6784
|
const dayEvents = byDay.get(k) || [];
|
|
6713
6785
|
const disabled = isDateDisabled(d);
|
|
6786
|
+
const isWeekend = d.getDay() === 0 || d.getDay() === 6;
|
|
6787
|
+
const customDay = renderDay?.({ date: d, isCurrentMonth: inMonth, isToday: isToday2, isSelected: selectedDay, events: dayEvents });
|
|
6788
|
+
if (customDay) return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(React24.Fragment, { children: customDay }, `${monthLabel}-${idx}`);
|
|
6789
|
+
if (cellMode === "events") {
|
|
6790
|
+
const limit = Math.max(0, maxEventsPerDay);
|
|
6791
|
+
const visibleEvents = dayEvents.slice(0, limit);
|
|
6792
|
+
const hiddenCount = Math.max(0, dayEvents.length - visibleEvents.length);
|
|
6793
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
|
|
6794
|
+
"div",
|
|
6795
|
+
{
|
|
6796
|
+
className: cn(
|
|
6797
|
+
"rounded-xl border border-border/50 bg-background/40 overflow-hidden",
|
|
6798
|
+
"transition-colors duration-150",
|
|
6799
|
+
animate && "will-change-transform",
|
|
6800
|
+
cellSz.cell,
|
|
6801
|
+
!inMonth && "opacity-60",
|
|
6802
|
+
disabled && "opacity-40",
|
|
6803
|
+
highlightWeekends && isWeekend && "bg-accent/10",
|
|
6804
|
+
isToday2 && !selectedDay && "ring-1 ring-primary/40",
|
|
6805
|
+
selectedDay && "border-primary/50 bg-primary/10"
|
|
6806
|
+
),
|
|
6807
|
+
children: [
|
|
6808
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "flex items-center justify-between gap-2", children: [
|
|
6809
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
6810
|
+
"button",
|
|
6811
|
+
{
|
|
6812
|
+
type: "button",
|
|
6813
|
+
onClick: () => !disabled && handleClickDay(d),
|
|
6814
|
+
disabled,
|
|
6815
|
+
className: cn(
|
|
6816
|
+
"inline-flex items-center justify-center rounded-lg px-2 py-1",
|
|
6817
|
+
"transition-colors duration-150 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40",
|
|
6818
|
+
cellSz.day,
|
|
6819
|
+
selectedDay ? "bg-primary text-primary-foreground" : "hover:bg-accent hover:text-accent-foreground",
|
|
6820
|
+
disabled && "cursor-not-allowed hover:bg-transparent"
|
|
6821
|
+
),
|
|
6822
|
+
title: d.toDateString(),
|
|
6823
|
+
children: d.getDate()
|
|
6824
|
+
}
|
|
6825
|
+
),
|
|
6826
|
+
dayEvents.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "text-[11px] text-muted-foreground tabular-nums", children: dayEvents.length })
|
|
6827
|
+
] }),
|
|
6828
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: cn("mt-2 space-y-1", dense ? "mt-1.5" : "mt-2"), children: [
|
|
6829
|
+
visibleEvents.map((e, i) => {
|
|
6830
|
+
const key = e.id ?? `${k}-${i}`;
|
|
6831
|
+
const node = renderEvent?.({ event: e, date: d });
|
|
6832
|
+
if (node) return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { children: node }, String(key));
|
|
6833
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
|
|
6834
|
+
"button",
|
|
6835
|
+
{
|
|
6836
|
+
type: "button",
|
|
6837
|
+
onClick: () => handleEventActivate(e, d, k, i),
|
|
6838
|
+
className: cn(
|
|
6839
|
+
"w-full text-left rounded-lg px-2 py-1",
|
|
6840
|
+
"transition-colors duration-150 hover:bg-accent/60 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40",
|
|
6841
|
+
"text-xs flex items-center gap-2"
|
|
6842
|
+
),
|
|
6843
|
+
title: e.title,
|
|
6844
|
+
children: [
|
|
6845
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "h-2 w-2 rounded-full shrink-0", style: { backgroundColor: e.color || "hsl(var(--primary))" } }),
|
|
6846
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "truncate flex-1", children: e.title ?? "Event" }),
|
|
6847
|
+
showEventBadges && e.badge && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "shrink-0 rounded-full bg-muted px-2 py-0.5 text-[10px] text-muted-foreground", children: e.badge })
|
|
6848
|
+
]
|
|
6849
|
+
},
|
|
6850
|
+
String(key)
|
|
6851
|
+
);
|
|
6852
|
+
}),
|
|
6853
|
+
hiddenCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "px-2 text-[11px] text-muted-foreground", children: [
|
|
6854
|
+
"+",
|
|
6855
|
+
hiddenCount,
|
|
6856
|
+
" more"
|
|
6857
|
+
] })
|
|
6858
|
+
] })
|
|
6859
|
+
]
|
|
6860
|
+
},
|
|
6861
|
+
`${monthLabel}-${idx}`
|
|
6862
|
+
);
|
|
6863
|
+
}
|
|
6714
6864
|
return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
|
|
6715
6865
|
"button",
|
|
6716
6866
|
{
|
|
@@ -6721,6 +6871,7 @@ function Calendar2({
|
|
|
6721
6871
|
sz.day,
|
|
6722
6872
|
!inMonth && "text-muted-foreground/60",
|
|
6723
6873
|
disabled && "opacity-40 cursor-not-allowed",
|
|
6874
|
+
highlightWeekends && isWeekend && "bg-accent/10",
|
|
6724
6875
|
isToday2 && !selectedDay && "ring-1 ring-primary/50",
|
|
6725
6876
|
selectedDay && "bg-primary text-primary-foreground hover:bg-primary/90",
|
|
6726
6877
|
!selectedDay && "hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground"
|
|
@@ -6728,7 +6879,14 @@ function Calendar2({
|
|
|
6728
6879
|
title: d.toDateString(),
|
|
6729
6880
|
children: [
|
|
6730
6881
|
d.getDate(),
|
|
6731
|
-
dayEvents.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "absolute -bottom-1 inline-flex gap-0.5", children: dayEvents.slice(0, 3).map((e, i) => /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
6882
|
+
dayEvents.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "absolute -bottom-1 inline-flex gap-0.5", children: dayEvents.slice(0, 3).map((e, i) => /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
6883
|
+
"span",
|
|
6884
|
+
{
|
|
6885
|
+
className: "h-1.5 w-1.5 rounded-full",
|
|
6886
|
+
style: { backgroundColor: e.color || "hsl(var(--primary))" }
|
|
6887
|
+
},
|
|
6888
|
+
String(e.id ?? i)
|
|
6889
|
+
)) })
|
|
6732
6890
|
]
|
|
6733
6891
|
},
|
|
6734
6892
|
`${monthLabel}-${idx}`
|
|
@@ -6791,6 +6949,82 @@ function Calendar2({
|
|
|
6791
6949
|
const k = `${d.getFullYear()}-${d.getMonth()}-${d.getDate()}`;
|
|
6792
6950
|
const dayEvents = byDay.get(k) || [];
|
|
6793
6951
|
const disabled = isDateDisabled(d);
|
|
6952
|
+
const isWeekend = d.getDay() === 0 || d.getDay() === 6;
|
|
6953
|
+
const customDay = renderDay?.({ date: d, isCurrentMonth: inMonth, isToday: isToday2, isSelected: selectedDay, events: dayEvents });
|
|
6954
|
+
if (customDay) return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(React24.Fragment, { children: customDay }, `wd-${idx}`);
|
|
6955
|
+
if (cellMode === "events") {
|
|
6956
|
+
const limit = Math.max(0, maxEventsPerDay);
|
|
6957
|
+
const visibleEvents = dayEvents.slice(0, limit);
|
|
6958
|
+
const hiddenCount = Math.max(0, dayEvents.length - visibleEvents.length);
|
|
6959
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
|
|
6960
|
+
"div",
|
|
6961
|
+
{
|
|
6962
|
+
className: cn(
|
|
6963
|
+
"rounded-xl border border-border/50 bg-background/40 overflow-hidden",
|
|
6964
|
+
"transition-colors duration-150",
|
|
6965
|
+
cellSz.cell,
|
|
6966
|
+
disabled && "opacity-40",
|
|
6967
|
+
highlightWeekends && isWeekend && "bg-accent/10",
|
|
6968
|
+
isToday2 && !selectedDay && "ring-1 ring-primary/40",
|
|
6969
|
+
selectedDay && "border-primary/50 bg-primary/10"
|
|
6970
|
+
),
|
|
6971
|
+
children: [
|
|
6972
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "flex items-center justify-between gap-2", children: [
|
|
6973
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
6974
|
+
"button",
|
|
6975
|
+
{
|
|
6976
|
+
type: "button",
|
|
6977
|
+
onClick: () => !disabled && handleClickDay(d),
|
|
6978
|
+
disabled,
|
|
6979
|
+
className: cn(
|
|
6980
|
+
"inline-flex items-center justify-center rounded-lg px-2 py-1",
|
|
6981
|
+
"transition-colors duration-150 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40",
|
|
6982
|
+
cellSz.day,
|
|
6983
|
+
selectedDay ? "bg-primary text-primary-foreground" : "hover:bg-accent hover:text-accent-foreground",
|
|
6984
|
+
disabled && "cursor-not-allowed hover:bg-transparent"
|
|
6985
|
+
),
|
|
6986
|
+
title: d.toDateString(),
|
|
6987
|
+
children: d.getDate()
|
|
6988
|
+
}
|
|
6989
|
+
),
|
|
6990
|
+
dayEvents.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "text-[11px] text-muted-foreground tabular-nums", children: dayEvents.length })
|
|
6991
|
+
] }),
|
|
6992
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: cn("mt-2 space-y-1", dense ? "mt-1.5" : "mt-2"), children: [
|
|
6993
|
+
visibleEvents.map((e, i) => {
|
|
6994
|
+
const key = e.id ?? `${k}-${i}`;
|
|
6995
|
+
const node = renderEvent?.({ event: e, date: d });
|
|
6996
|
+
if (node) return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { children: node }, String(key));
|
|
6997
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
|
|
6998
|
+
"button",
|
|
6999
|
+
{
|
|
7000
|
+
type: "button",
|
|
7001
|
+
onClick: () => handleEventActivate(e, d, k, i),
|
|
7002
|
+
className: cn(
|
|
7003
|
+
"w-full text-left rounded-lg px-2 py-1",
|
|
7004
|
+
"transition-colors duration-150 hover:bg-accent/60 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40",
|
|
7005
|
+
"text-xs flex items-center gap-2"
|
|
7006
|
+
),
|
|
7007
|
+
title: e.title,
|
|
7008
|
+
children: [
|
|
7009
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "h-2 w-2 rounded-full shrink-0", style: { backgroundColor: e.color || "hsl(var(--primary))" } }),
|
|
7010
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "truncate flex-1", children: e.title ?? "Event" }),
|
|
7011
|
+
showEventBadges && e.badge && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "shrink-0 rounded-full bg-muted px-2 py-0.5 text-[10px] text-muted-foreground", children: e.badge })
|
|
7012
|
+
]
|
|
7013
|
+
},
|
|
7014
|
+
String(key)
|
|
7015
|
+
);
|
|
7016
|
+
}),
|
|
7017
|
+
hiddenCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "px-2 text-[11px] text-muted-foreground", children: [
|
|
7018
|
+
"+",
|
|
7019
|
+
hiddenCount,
|
|
7020
|
+
" more"
|
|
7021
|
+
] })
|
|
7022
|
+
] })
|
|
7023
|
+
]
|
|
7024
|
+
},
|
|
7025
|
+
`wd-${idx}`
|
|
7026
|
+
);
|
|
7027
|
+
}
|
|
6794
7028
|
return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
|
|
6795
7029
|
"button",
|
|
6796
7030
|
{
|
|
@@ -6800,6 +7034,7 @@ function Calendar2({
|
|
|
6800
7034
|
"rounded-lg flex items-center justify-center relative cursor-pointer",
|
|
6801
7035
|
sz.day,
|
|
6802
7036
|
disabled && "opacity-40 cursor-not-allowed",
|
|
7037
|
+
highlightWeekends && isWeekend && "bg-accent/10",
|
|
6803
7038
|
isToday2 && !selectedDay && "ring-1 ring-primary/50",
|
|
6804
7039
|
selectedDay && "bg-primary text-primary-foreground hover:bg-primary/90",
|
|
6805
7040
|
!selectedDay && "hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground"
|
|
@@ -6807,13 +7042,38 @@ function Calendar2({
|
|
|
6807
7042
|
title: d.toDateString(),
|
|
6808
7043
|
children: [
|
|
6809
7044
|
d.getDate(),
|
|
6810
|
-
dayEvents.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "absolute -bottom-1 inline-flex gap-0.5", children: dayEvents.slice(0, 3).map((e, i) => /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "h-1.5 w-1.5 rounded-full", style: { backgroundColor: e.color || "hsl(var(--primary))" } }, i)) })
|
|
7045
|
+
dayEvents.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "absolute -bottom-1 inline-flex gap-0.5", children: dayEvents.slice(0, 3).map((e, i) => /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "h-1.5 w-1.5 rounded-full", style: { backgroundColor: e.color || "hsl(var(--primary))" } }, String(e.id ?? i))) })
|
|
6811
7046
|
]
|
|
6812
7047
|
},
|
|
6813
7048
|
`wd-${idx}`
|
|
6814
7049
|
);
|
|
6815
7050
|
}) })
|
|
6816
|
-
] }) : /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: cn(months > 1 ? "grid md:grid-cols-2 lg:grid-cols-3 gap-4" : ""), children: Array.from({ length: Math.max(1, months) }, (_, i) => /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(React24.Fragment, { children: renderMonth(addMonths(view, i)) }, `cal-month-${view.getFullYear()}-${view.getMonth()}-${i}`)) })
|
|
7051
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: cn(months > 1 ? "grid md:grid-cols-2 lg:grid-cols-3 gap-4" : ""), children: Array.from({ length: Math.max(1, months) }, (_, i) => /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(React24.Fragment, { children: renderMonth(addMonths(view, i)) }, `cal-month-${view.getFullYear()}-${view.getMonth()}-${i}`)) }),
|
|
7052
|
+
effectiveEnableEventSheet && selectedEvent && selectedEventDate ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
7053
|
+
Sheet,
|
|
7054
|
+
{
|
|
7055
|
+
open: activeEventSheetOpen,
|
|
7056
|
+
onOpenChange: setEventSheetOpen,
|
|
7057
|
+
side: "right",
|
|
7058
|
+
size: eventSheetSize,
|
|
7059
|
+
title: selectedEvent.title ?? "Event",
|
|
7060
|
+
description: selectedEventDate.toDateString(),
|
|
7061
|
+
children: renderEventSheet ? renderEventSheet({ event: selectedEvent, date: selectedEventDate, close: () => setEventSheetOpen(false) }) : /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "space-y-3", children: [
|
|
7062
|
+
selectedEvent.id != null ? /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { children: [
|
|
7063
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "text-xs text-muted-foreground", children: "ID" }),
|
|
7064
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "font-mono text-xs break-all", children: String(selectedEvent.id) })
|
|
7065
|
+
] }) : null,
|
|
7066
|
+
selectedEvent.badge ? /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { children: [
|
|
7067
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "text-xs text-muted-foreground", children: "Badge" }),
|
|
7068
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "text-sm", children: selectedEvent.badge })
|
|
7069
|
+
] }) : null,
|
|
7070
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
7071
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "h-3 w-3 rounded-full", style: { backgroundColor: selectedEvent.color || "hsl(var(--primary))" } }),
|
|
7072
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "text-sm text-muted-foreground", children: "Color" })
|
|
7073
|
+
] })
|
|
7074
|
+
] })
|
|
7075
|
+
}
|
|
7076
|
+
) : null
|
|
6817
7077
|
] });
|
|
6818
7078
|
}
|
|
6819
7079
|
|