calendarkit-prov2 2.0.8 → 2.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +7 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +566 -449
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +485 -368
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var React18 = require('react');
|
|
4
4
|
var reactDom = require('react-dom');
|
|
5
5
|
var core = require('@dnd-kit/core');
|
|
6
6
|
var modifiers = require('@dnd-kit/modifiers');
|
|
@@ -33,7 +33,7 @@ function _interopNamespace(e) {
|
|
|
33
33
|
return Object.freeze(n);
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
var
|
|
36
|
+
var React18__namespace = /*#__PURE__*/_interopNamespace(React18);
|
|
37
37
|
|
|
38
38
|
function cn(...inputs) {
|
|
39
39
|
return tailwindMerge.twMerge(clsx.clsx(inputs));
|
|
@@ -65,10 +65,10 @@ var buttonVariants = classVarianceAuthority.cva(
|
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
67
|
);
|
|
68
|
-
var Button =
|
|
68
|
+
var Button = React18__namespace.forwardRef(
|
|
69
69
|
({ className, variant, size, asChild = false, ...props }, ref) => {
|
|
70
70
|
const Comp = "button";
|
|
71
|
-
return /* @__PURE__ */
|
|
71
|
+
return /* @__PURE__ */ React18__namespace.createElement(
|
|
72
72
|
Comp,
|
|
73
73
|
{
|
|
74
74
|
className: cn(buttonVariants({ variant, size, className })),
|
|
@@ -1565,33 +1565,33 @@ var CalendarHeader = ({
|
|
|
1565
1565
|
eventCount,
|
|
1566
1566
|
hideLanguageSwitcher = false
|
|
1567
1567
|
}) => {
|
|
1568
|
-
const [isLangOpen, setIsLangOpen] =
|
|
1569
|
-
const [isCustomViewOpen, setIsCustomViewOpen] =
|
|
1570
|
-
const langButtonRef =
|
|
1571
|
-
const langDropdownRef =
|
|
1572
|
-
const customViewDropdownRef =
|
|
1573
|
-
const customViewButtonRef =
|
|
1574
|
-
const [langPos, setLangPos] =
|
|
1575
|
-
const [customViewPos, setCustomViewPos] =
|
|
1576
|
-
const updateLangPos =
|
|
1568
|
+
const [isLangOpen, setIsLangOpen] = React18.useState(false);
|
|
1569
|
+
const [isCustomViewOpen, setIsCustomViewOpen] = React18.useState(false);
|
|
1570
|
+
const langButtonRef = React18.useRef(null);
|
|
1571
|
+
const langDropdownRef = React18.useRef(null);
|
|
1572
|
+
const customViewDropdownRef = React18.useRef(null);
|
|
1573
|
+
const customViewButtonRef = React18.useRef(null);
|
|
1574
|
+
const [langPos, setLangPos] = React18.useState(null);
|
|
1575
|
+
const [customViewPos, setCustomViewPos] = React18.useState(null);
|
|
1576
|
+
const updateLangPos = React18.useCallback(() => {
|
|
1577
1577
|
const el = langButtonRef.current;
|
|
1578
1578
|
if (!el) return;
|
|
1579
1579
|
setLangPos(getDropdownPosition(el.getBoundingClientRect(), LANG_DROPDOWN_WIDTH));
|
|
1580
1580
|
}, []);
|
|
1581
|
-
const updateCustomViewPos =
|
|
1581
|
+
const updateCustomViewPos = React18.useCallback(() => {
|
|
1582
1582
|
const el = customViewButtonRef.current;
|
|
1583
1583
|
if (!el) return;
|
|
1584
1584
|
setCustomViewPos(getDropdownPosition(el.getBoundingClientRect(), CUSTOM_VIEW_DROPDOWN_WIDTH));
|
|
1585
1585
|
}, []);
|
|
1586
|
-
|
|
1586
|
+
React18.useLayoutEffect(() => {
|
|
1587
1587
|
if (!isLangOpen) return;
|
|
1588
1588
|
updateLangPos();
|
|
1589
1589
|
}, [isLangOpen, updateLangPos]);
|
|
1590
|
-
|
|
1590
|
+
React18.useLayoutEffect(() => {
|
|
1591
1591
|
if (!isCustomViewOpen) return;
|
|
1592
1592
|
updateCustomViewPos();
|
|
1593
1593
|
}, [isCustomViewOpen, updateCustomViewPos]);
|
|
1594
|
-
|
|
1594
|
+
React18.useEffect(() => {
|
|
1595
1595
|
if (!isLangOpen) return;
|
|
1596
1596
|
const handle = () => updateLangPos();
|
|
1597
1597
|
window.addEventListener("resize", handle);
|
|
@@ -1601,7 +1601,7 @@ var CalendarHeader = ({
|
|
|
1601
1601
|
window.removeEventListener("scroll", handle, true);
|
|
1602
1602
|
};
|
|
1603
1603
|
}, [isLangOpen, updateLangPos]);
|
|
1604
|
-
|
|
1604
|
+
React18.useEffect(() => {
|
|
1605
1605
|
if (!isCustomViewOpen) return;
|
|
1606
1606
|
const handle = () => updateCustomViewPos();
|
|
1607
1607
|
window.addEventListener("resize", handle);
|
|
@@ -1611,7 +1611,7 @@ var CalendarHeader = ({
|
|
|
1611
1611
|
window.removeEventListener("scroll", handle, true);
|
|
1612
1612
|
};
|
|
1613
1613
|
}, [isCustomViewOpen, updateCustomViewPos]);
|
|
1614
|
-
|
|
1614
|
+
React18.useEffect(() => {
|
|
1615
1615
|
const handleClickOutside = (e) => {
|
|
1616
1616
|
const target = e.target;
|
|
1617
1617
|
const insideButton = langButtonRef.current?.contains(target);
|
|
@@ -1621,7 +1621,7 @@ var CalendarHeader = ({
|
|
|
1621
1621
|
if (isLangOpen) document.addEventListener("mousedown", handleClickOutside);
|
|
1622
1622
|
return () => document.removeEventListener("mousedown", handleClickOutside);
|
|
1623
1623
|
}, [isLangOpen]);
|
|
1624
|
-
|
|
1624
|
+
React18.useEffect(() => {
|
|
1625
1625
|
const handleClickOutside = (e) => {
|
|
1626
1626
|
const target = e.target;
|
|
1627
1627
|
const insideButton = customViewButtonRef.current?.contains(target);
|
|
@@ -1638,7 +1638,7 @@ var CalendarHeader = ({
|
|
|
1638
1638
|
{ key: "agenda", icon: lucideReact.ListTodo }
|
|
1639
1639
|
];
|
|
1640
1640
|
const currentLang = LANGUAGE_META[language] ?? LANGUAGE_META["tr"];
|
|
1641
|
-
return /* @__PURE__ */
|
|
1641
|
+
return /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "flex flex-col md:flex-row items-center justify-between px-3 md:px-5 py-3 border-b-[0px] border-border/50 bg-gradient-to-r from-background via-background to-muted/20 gap-3 md:gap-0 min-h-[64px]" }, /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "flex items-center gap-2 w-full md:w-auto justify-between md:justify-start" }, /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "flex items-center gap-2 md:gap-3" }, /* @__PURE__ */ React18__namespace.default.createElement(
|
|
1642
1642
|
Button,
|
|
1643
1643
|
{
|
|
1644
1644
|
variant: "ghost",
|
|
@@ -1646,8 +1646,8 @@ var CalendarHeader = ({
|
|
|
1646
1646
|
className: "text-muted-foreground hover:text-foreground hover:bg-accent/80 rounded-xl h-10 w-10 transition-all duration-200",
|
|
1647
1647
|
onClick: onMenuClick
|
|
1648
1648
|
},
|
|
1649
|
-
/* @__PURE__ */
|
|
1650
|
-
), /* @__PURE__ */
|
|
1649
|
+
/* @__PURE__ */ React18__namespace.default.createElement(lucideReact.Menu, { className: "h-5 w-5" })
|
|
1650
|
+
), /* @__PURE__ */ React18__namespace.default.createElement(
|
|
1651
1651
|
Button,
|
|
1652
1652
|
{
|
|
1653
1653
|
variant: "outline",
|
|
@@ -1655,15 +1655,15 @@ var CalendarHeader = ({
|
|
|
1655
1655
|
className: "h-9 px-5 rounded-xl text-sm font-medium hidden sm:inline-flex border-[0.5px] border-border/60 hover:border-primary/40 hover:bg-primary/5 hover:text-primary transition-all duration-200"
|
|
1656
1656
|
},
|
|
1657
1657
|
translations.today
|
|
1658
|
-
), onCreateEvent && /* @__PURE__ */
|
|
1658
|
+
), onCreateEvent && /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "relative group hidden sm:block" }, /* @__PURE__ */ React18__namespace.default.createElement(
|
|
1659
1659
|
Button,
|
|
1660
1660
|
{
|
|
1661
1661
|
onClick: onCreateEvent,
|
|
1662
1662
|
size: "icon",
|
|
1663
1663
|
className: "h-9 w-9 rounded-xl shadow-sm shadow-primary/20 transition-all duration-200"
|
|
1664
1664
|
},
|
|
1665
|
-
/* @__PURE__ */
|
|
1666
|
-
), /* @__PURE__ */
|
|
1665
|
+
/* @__PURE__ */ React18__namespace.default.createElement(lucideReact.Plus, { className: "h-4 w-4" })
|
|
1666
|
+
), /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "pointer-events-none absolute left-1/2 -translate-x-1/2 top-full mt-2 z-50 opacity-0 group-hover:opacity-100 transition-opacity duration-150" }, /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "bg-popover text-popover-foreground text-xs font-medium px-2.5 py-1.5 rounded-lg shadow-md border border-border/60 whitespace-nowrap" }, translations.createEvent ?? translations.create), /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "absolute -top-1 left-1/2 -translate-x-1/2 w-2 h-2 bg-popover border-l border-t border-border/60 rotate-45" }))), /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "flex items-center bg-muted/40 rounded-xl p-0.5" }, /* @__PURE__ */ React18__namespace.default.createElement(
|
|
1667
1667
|
Button,
|
|
1668
1668
|
{
|
|
1669
1669
|
variant: "ghost",
|
|
@@ -1671,8 +1671,8 @@ var CalendarHeader = ({
|
|
|
1671
1671
|
onClick: onPrev,
|
|
1672
1672
|
className: "rounded-lg h-8 w-8 hover:bg-background/80 transition-all duration-200"
|
|
1673
1673
|
},
|
|
1674
|
-
/* @__PURE__ */
|
|
1675
|
-
), /* @__PURE__ */
|
|
1674
|
+
/* @__PURE__ */ React18__namespace.default.createElement(lucideReact.ChevronLeft, { className: "h-4 w-4 text-muted-foreground" })
|
|
1675
|
+
), /* @__PURE__ */ React18__namespace.default.createElement(
|
|
1676
1676
|
Button,
|
|
1677
1677
|
{
|
|
1678
1678
|
variant: "ghost",
|
|
@@ -1680,8 +1680,8 @@ var CalendarHeader = ({
|
|
|
1680
1680
|
onClick: onNext,
|
|
1681
1681
|
className: "rounded-lg h-8 w-8 hover:bg-background/80 transition-all duration-200"
|
|
1682
1682
|
},
|
|
1683
|
-
/* @__PURE__ */
|
|
1684
|
-
)), /* @__PURE__ */
|
|
1683
|
+
/* @__PURE__ */ React18__namespace.default.createElement(lucideReact.ChevronRight, { className: "h-4 w-4 text-muted-foreground" })
|
|
1684
|
+
)), /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "ml-2 md:ml-4 hidden sm:block" }, /* @__PURE__ */ React18__namespace.default.createElement("h2", { className: "text-lg md:text-xl font-semibold text-foreground whitespace-nowrap capitalize tracking-tight" }, dateFns.format(currentDate, "MMMM yyyy", { locale })))), /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "sm:hidden" }, /* @__PURE__ */ React18__namespace.default.createElement("h2", { className: "text-lg font-semibold text-foreground whitespace-nowrap capitalize tracking-tight" }, dateFns.format(currentDate, "MMMM yyyy", { locale })))), /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "flex items-center gap-2 md:gap-3 w-full md:w-auto justify-end" }, onLanguageChange && !hideLanguageSwitcher && /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "relative" }, /* @__PURE__ */ React18__namespace.default.createElement(
|
|
1685
1685
|
"button",
|
|
1686
1686
|
{
|
|
1687
1687
|
ref: langButtonRef,
|
|
@@ -1693,20 +1693,20 @@ var CalendarHeader = ({
|
|
|
1693
1693
|
),
|
|
1694
1694
|
title: currentLang.english
|
|
1695
1695
|
},
|
|
1696
|
-
/* @__PURE__ */
|
|
1697
|
-
/* @__PURE__ */
|
|
1698
|
-
/* @__PURE__ */
|
|
1699
|
-
/* @__PURE__ */
|
|
1696
|
+
/* @__PURE__ */ React18__namespace.default.createElement(lucideReact.Globe, { className: "h-3.5 w-3.5" }),
|
|
1697
|
+
/* @__PURE__ */ React18__namespace.default.createElement("span", { className: "text-base leading-none" }, currentLang.flag),
|
|
1698
|
+
/* @__PURE__ */ React18__namespace.default.createElement("span", { className: "hidden sm:inline text-xs font-semibold uppercase tracking-wider" }, language),
|
|
1699
|
+
/* @__PURE__ */ React18__namespace.default.createElement(lucideReact.ChevronDown, { className: cn("h-3.5 w-3.5 transition-transform duration-200", isLangOpen && "rotate-180") })
|
|
1700
1700
|
), isLangOpen && langPos && reactDom.createPortal(
|
|
1701
|
-
/* @__PURE__ */
|
|
1701
|
+
/* @__PURE__ */ React18__namespace.default.createElement(
|
|
1702
1702
|
"div",
|
|
1703
1703
|
{
|
|
1704
1704
|
ref: langDropdownRef,
|
|
1705
1705
|
className: "fixed w-52 bg-background border border-border/60 rounded-2xl shadow-2xl z-[9999] overflow-hidden py-1.5",
|
|
1706
1706
|
style: { top: langPos.top, left: langPos.left, width: LANG_DROPDOWN_WIDTH }
|
|
1707
1707
|
},
|
|
1708
|
-
/* @__PURE__ */
|
|
1709
|
-
/* @__PURE__ */
|
|
1708
|
+
/* @__PURE__ */ React18__namespace.default.createElement("div", { className: "px-3 py-2 border-b border-border/40 mb-1" }, /* @__PURE__ */ React18__namespace.default.createElement("p", { className: "text-xs font-semibold text-muted-foreground uppercase tracking-wider" }, "Language / Dil")),
|
|
1709
|
+
/* @__PURE__ */ React18__namespace.default.createElement("div", { className: "max-h-72 overflow-y-auto" }, Object.entries(LANGUAGE_META).map(([code, meta]) => /* @__PURE__ */ React18__namespace.default.createElement(
|
|
1710
1710
|
"button",
|
|
1711
1711
|
{
|
|
1712
1712
|
key: code,
|
|
@@ -1720,13 +1720,13 @@ var CalendarHeader = ({
|
|
|
1720
1720
|
language === code ? "bg-primary/10 text-primary font-semibold" : "text-foreground"
|
|
1721
1721
|
)
|
|
1722
1722
|
},
|
|
1723
|
-
/* @__PURE__ */
|
|
1724
|
-
/* @__PURE__ */
|
|
1725
|
-
language === code && /* @__PURE__ */
|
|
1723
|
+
/* @__PURE__ */ React18__namespace.default.createElement("span", { className: "text-lg leading-none w-6 text-center" }, meta.flag),
|
|
1724
|
+
/* @__PURE__ */ React18__namespace.default.createElement("div", { className: "flex-1 text-left" }, /* @__PURE__ */ React18__namespace.default.createElement("div", { className: cn("font-medium", meta.rtl && "text-right") }, meta.native), /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "text-xs text-muted-foreground" }, meta.english)),
|
|
1725
|
+
language === code && /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "w-2 h-2 rounded-full bg-primary shrink-0" })
|
|
1726
1726
|
)))
|
|
1727
1727
|
),
|
|
1728
1728
|
document.body
|
|
1729
|
-
)), onThemeToggle && /* @__PURE__ */
|
|
1729
|
+
)), onThemeToggle && /* @__PURE__ */ React18__namespace.default.createElement(
|
|
1730
1730
|
Button,
|
|
1731
1731
|
{
|
|
1732
1732
|
variant: "ghost",
|
|
@@ -1734,16 +1734,16 @@ var CalendarHeader = ({
|
|
|
1734
1734
|
className: "rounded-xl h-9 w-9 hover:bg-accent/80 transition-all duration-200",
|
|
1735
1735
|
onClick: onThemeToggle
|
|
1736
1736
|
},
|
|
1737
|
-
isDarkMode ? /* @__PURE__ */
|
|
1738
|
-
), typeof eventCount === "number" && !hideViewSwitcher && /* @__PURE__ */
|
|
1737
|
+
isDarkMode ? /* @__PURE__ */ React18__namespace.default.createElement(lucideReact.Sun, { className: "h-4 w-4 text-amber-500" }) : /* @__PURE__ */ React18__namespace.default.createElement(lucideReact.Moon, { className: "h-4 w-4 text-muted-foreground" })
|
|
1738
|
+
), typeof eventCount === "number" && !hideViewSwitcher && /* @__PURE__ */ React18__namespace.default.createElement(
|
|
1739
1739
|
"div",
|
|
1740
1740
|
{
|
|
1741
1741
|
className: "flex items-center gap-1.5 h-8 px-3 rounded-xl bg-primary/10 text-primary text-xs font-semibold tabular-nums select-none border border-primary/20 shadow-sm shadow-primary/10",
|
|
1742
1742
|
title: `${eventCount} event${eventCount !== 1 ? "s" : ""}`
|
|
1743
1743
|
},
|
|
1744
|
-
/* @__PURE__ */
|
|
1745
|
-
/* @__PURE__ */
|
|
1746
|
-
), !hideViewSwitcher && /* @__PURE__ */
|
|
1744
|
+
/* @__PURE__ */ React18__namespace.default.createElement(lucideReact.CalendarCheck2, { className: "w-3.5 h-3.5 shrink-0" }),
|
|
1745
|
+
/* @__PURE__ */ React18__namespace.default.createElement("span", null, eventCount)
|
|
1746
|
+
), !hideViewSwitcher && /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "flex items-center bg-muted/50 backdrop-blur-sm rounded-xl p-1 gap-0.5" }, viewConfig.map(({ key, icon: Icon }) => /* @__PURE__ */ React18__namespace.default.createElement(
|
|
1747
1747
|
Button,
|
|
1748
1748
|
{
|
|
1749
1749
|
key,
|
|
@@ -1758,9 +1758,9 @@ var CalendarHeader = ({
|
|
|
1758
1758
|
view === key && !activeCustomViewId ? "bg-background shadow-sm text-foreground font-medium border-[0.5px] border-border/50" : "text-muted-foreground hover:text-foreground hover:bg-background/50"
|
|
1759
1759
|
)
|
|
1760
1760
|
},
|
|
1761
|
-
/* @__PURE__ */
|
|
1762
|
-
/* @__PURE__ */
|
|
1763
|
-
)), customViews && customViews.length > 0 && /* @__PURE__ */
|
|
1761
|
+
/* @__PURE__ */ React18__namespace.default.createElement(Icon, { className: "h-3.5 w-3.5" }),
|
|
1762
|
+
/* @__PURE__ */ React18__namespace.default.createElement("span", { className: "hidden sm:inline" }, translations[key])
|
|
1763
|
+
)), customViews && customViews.length > 0 && /* @__PURE__ */ React18__namespace.default.createElement(React18__namespace.default.Fragment, null, /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "w-px h-5 bg-border/60 mx-0.5 shrink-0" }), /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "relative" }, /* @__PURE__ */ React18__namespace.default.createElement(
|
|
1764
1764
|
Button,
|
|
1765
1765
|
{
|
|
1766
1766
|
ref: customViewButtonRef,
|
|
@@ -1773,17 +1773,17 @@ var CalendarHeader = ({
|
|
|
1773
1773
|
),
|
|
1774
1774
|
title: "Daha fazla g\xF6r\xFCn\xFCm"
|
|
1775
1775
|
},
|
|
1776
|
-
activeCustomViewId ? customViews.find((cv) => cv.id === activeCustomViewId)?.label : /* @__PURE__ */
|
|
1777
|
-
/* @__PURE__ */
|
|
1776
|
+
activeCustomViewId ? customViews.find((cv) => cv.id === activeCustomViewId)?.label : /* @__PURE__ */ React18__namespace.default.createElement(lucideReact.MoreHorizontal, { className: "h-3.5 w-3.5" }),
|
|
1777
|
+
/* @__PURE__ */ React18__namespace.default.createElement(lucideReact.ChevronDown, { className: cn("h-3 w-3 transition-transform duration-150", isCustomViewOpen && "rotate-180") })
|
|
1778
1778
|
), isCustomViewOpen && customViewPos && reactDom.createPortal(
|
|
1779
|
-
/* @__PURE__ */
|
|
1779
|
+
/* @__PURE__ */ React18__namespace.default.createElement(
|
|
1780
1780
|
"div",
|
|
1781
1781
|
{
|
|
1782
1782
|
ref: customViewDropdownRef,
|
|
1783
1783
|
className: "fixed min-w-[160px] bg-background border border-border/60 rounded-2xl shadow-2xl z-[9999] overflow-hidden py-1.5",
|
|
1784
1784
|
style: { top: customViewPos.top, left: customViewPos.left, minWidth: CUSTOM_VIEW_DROPDOWN_WIDTH }
|
|
1785
1785
|
},
|
|
1786
|
-
customViews.map((cv) => /* @__PURE__ */
|
|
1786
|
+
customViews.map((cv) => /* @__PURE__ */ React18__namespace.default.createElement(
|
|
1787
1787
|
"button",
|
|
1788
1788
|
{
|
|
1789
1789
|
key: cv.id,
|
|
@@ -1797,9 +1797,9 @@ var CalendarHeader = ({
|
|
|
1797
1797
|
activeCustomViewId === cv.id ? "bg-primary/10 text-primary font-semibold" : "text-foreground"
|
|
1798
1798
|
)
|
|
1799
1799
|
},
|
|
1800
|
-
cv.icon && /* @__PURE__ */
|
|
1801
|
-
/* @__PURE__ */
|
|
1802
|
-
activeCustomViewId === cv.id && /* @__PURE__ */
|
|
1800
|
+
cv.icon && /* @__PURE__ */ React18__namespace.default.createElement("span", { className: "w-4 h-4 flex items-center justify-center shrink-0" }, cv.icon),
|
|
1801
|
+
/* @__PURE__ */ React18__namespace.default.createElement("span", null, cv.label),
|
|
1802
|
+
activeCustomViewId === cv.id && /* @__PURE__ */ React18__namespace.default.createElement("span", { className: "ml-auto w-1.5 h-1.5 rounded-full bg-primary shrink-0" })
|
|
1803
1803
|
))
|
|
1804
1804
|
),
|
|
1805
1805
|
document.body
|
|
@@ -1826,12 +1826,12 @@ var MiniCalendar = ({
|
|
|
1826
1826
|
className,
|
|
1827
1827
|
locale
|
|
1828
1828
|
}) => {
|
|
1829
|
-
const [viewDate, setViewDate] =
|
|
1830
|
-
|
|
1829
|
+
const [viewDate, setViewDate] = React18__namespace.default.useState(currentDate);
|
|
1830
|
+
React18__namespace.default.useEffect(() => {
|
|
1831
1831
|
setViewDate(currentDate);
|
|
1832
1832
|
}, [currentDate]);
|
|
1833
|
-
const days =
|
|
1834
|
-
const weekDays =
|
|
1833
|
+
const days = React18__namespace.default.useMemo(() => getMonthGrid(viewDate), [viewDate]);
|
|
1834
|
+
const weekDays = React18__namespace.default.useMemo(() => {
|
|
1835
1835
|
const base = new Date(2024, 0, 7);
|
|
1836
1836
|
return Array.from({ length: 7 }, (_, i) => {
|
|
1837
1837
|
const d = new Date(base);
|
|
@@ -1855,7 +1855,7 @@ var MiniCalendar = ({
|
|
|
1855
1855
|
onDateChange(day);
|
|
1856
1856
|
if (onViewChange) onViewChange("day");
|
|
1857
1857
|
};
|
|
1858
|
-
return /* @__PURE__ */
|
|
1858
|
+
return /* @__PURE__ */ React18__namespace.default.createElement("div", { className: cn("px-4 w-[260px]", className) }, /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "flex items-center justify-between mb-4" }, /* @__PURE__ */ React18__namespace.default.createElement("span", { className: "text-sm font-semibold text-foreground capitalize" }, dateFns.format(viewDate, "MMMM yyyy", { locale })), /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "flex items-center bg-muted/40 rounded-lg p-0.5" }, /* @__PURE__ */ React18__namespace.default.createElement(
|
|
1859
1859
|
Button,
|
|
1860
1860
|
{
|
|
1861
1861
|
variant: "ghost",
|
|
@@ -1864,8 +1864,8 @@ var MiniCalendar = ({
|
|
|
1864
1864
|
onClick: handlePrev,
|
|
1865
1865
|
"aria-label": "Previous month"
|
|
1866
1866
|
},
|
|
1867
|
-
/* @__PURE__ */
|
|
1868
|
-
), /* @__PURE__ */
|
|
1867
|
+
/* @__PURE__ */ React18__namespace.default.createElement(lucideReact.ChevronLeft, { className: "h-4 w-4" })
|
|
1868
|
+
), /* @__PURE__ */ React18__namespace.default.createElement(
|
|
1869
1869
|
Button,
|
|
1870
1870
|
{
|
|
1871
1871
|
variant: "ghost",
|
|
@@ -1874,12 +1874,12 @@ var MiniCalendar = ({
|
|
|
1874
1874
|
onClick: handleNext,
|
|
1875
1875
|
"aria-label": "Next month"
|
|
1876
1876
|
},
|
|
1877
|
-
/* @__PURE__ */
|
|
1878
|
-
))), /* @__PURE__ */
|
|
1877
|
+
/* @__PURE__ */ React18__namespace.default.createElement(lucideReact.ChevronRight, { className: "h-4 w-4" })
|
|
1878
|
+
))), /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "grid grid-cols-7 gap-y-2 text-center mb-2" }, weekDays.map((day, i) => /* @__PURE__ */ React18__namespace.default.createElement("div", { key: `${day}-${i}`, className: "text-[10px] text-muted-foreground/70 font-semibold uppercase" }, day))), /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "grid grid-cols-7 gap-y-1 text-center" }, days.map((day) => {
|
|
1879
1879
|
const isSelected = dateFns.isSameDay(day, currentDate);
|
|
1880
1880
|
const isCurrentMonth = dateFns.isSameMonth(day, viewDate);
|
|
1881
1881
|
const isTodayDate = dateFns.isToday(day);
|
|
1882
|
-
return /* @__PURE__ */
|
|
1882
|
+
return /* @__PURE__ */ React18__namespace.default.createElement(
|
|
1883
1883
|
"button",
|
|
1884
1884
|
{
|
|
1885
1885
|
key: day.toISOString(),
|
|
@@ -1919,12 +1919,12 @@ var Sidebar = ({
|
|
|
1919
1919
|
onCustomViewChange,
|
|
1920
1920
|
locale
|
|
1921
1921
|
}) => {
|
|
1922
|
-
const [calendarsOpen, setCalendarsOpen] =
|
|
1923
|
-
const [timezoneOpen, setTimezoneOpen] =
|
|
1924
|
-
const [now, setNow] =
|
|
1925
|
-
const [hasMounted, setHasMounted] =
|
|
1926
|
-
const [menusExpanded, setMenusExpanded] =
|
|
1927
|
-
|
|
1922
|
+
const [calendarsOpen, setCalendarsOpen] = React18.useState(true);
|
|
1923
|
+
const [timezoneOpen, setTimezoneOpen] = React18.useState(false);
|
|
1924
|
+
const [now, setNow] = React18.useState(null);
|
|
1925
|
+
const [hasMounted, setHasMounted] = React18.useState(false);
|
|
1926
|
+
const [menusExpanded, setMenusExpanded] = React18.useState(false);
|
|
1927
|
+
React18.useEffect(() => {
|
|
1928
1928
|
setHasMounted(true);
|
|
1929
1929
|
setNow(/* @__PURE__ */ new Date());
|
|
1930
1930
|
const timer = setInterval(() => setNow(/* @__PURE__ */ new Date()), 6e4);
|
|
@@ -1961,7 +1961,7 @@ var Sidebar = ({
|
|
|
1961
1961
|
];
|
|
1962
1962
|
const formatTzLabel = (tz, showTime = true) => {
|
|
1963
1963
|
if (!hasMounted || !now || !showTime) {
|
|
1964
|
-
return /* @__PURE__ */
|
|
1964
|
+
return /* @__PURE__ */ React18__namespace.default.createElement("span", null, tz.label);
|
|
1965
1965
|
}
|
|
1966
1966
|
let time = "";
|
|
1967
1967
|
let acronym = tz.acronym;
|
|
@@ -1981,29 +1981,29 @@ var Sidebar = ({
|
|
|
1981
1981
|
}
|
|
1982
1982
|
}
|
|
1983
1983
|
} catch (e) {
|
|
1984
|
-
return /* @__PURE__ */
|
|
1984
|
+
return /* @__PURE__ */ React18__namespace.default.createElement("span", null, tz.label);
|
|
1985
1985
|
}
|
|
1986
|
-
return /* @__PURE__ */
|
|
1986
|
+
return /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "flex justify-between w-full" }, /* @__PURE__ */ React18__namespace.default.createElement("span", null, tz.label), /* @__PURE__ */ React18__namespace.default.createElement("span", { className: "text-muted-foreground ml-2 tabular-nums" }, time, " ", /* @__PURE__ */ React18__namespace.default.createElement("span", { className: "text-xs opacity-75" }, "(", acronym, ")")));
|
|
1987
1987
|
};
|
|
1988
1988
|
const selectedTzObj = timezones.find((t) => t.value === (timezone || ""));
|
|
1989
1989
|
const selectedTimezoneLabel = selectedTzObj ? formatTzLabel(selectedTzObj) : translations?.localTime ?? "Local Time";
|
|
1990
|
-
return /* @__PURE__ */
|
|
1990
|
+
return /* @__PURE__ */ React18__namespace.default.createElement("div", { className: cn("flex flex-col w-[260px] overflow-x-hidden h-full bg-gradient-to-b scrollbar-hide from-background via-background to-muted/10 pt-4 pb-4 overflow-y-auto", className) }, sidebarMenus && sidebarMenus.length > 0 && /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "px-4 mb-4" }, !menusExpanded && /* @__PURE__ */ React18__namespace.default.createElement(
|
|
1991
1991
|
Button,
|
|
1992
1992
|
{
|
|
1993
1993
|
variant: "outline",
|
|
1994
1994
|
className: "w-full rounded-2xl h-11 gap-2.5 justify-start border-[0.5px] border-border/60 hover:border-primary/40 hover:bg-primary/5 hover:text-primary transition-all duration-200 font-medium text-sm",
|
|
1995
1995
|
onClick: () => setMenusExpanded(true)
|
|
1996
1996
|
},
|
|
1997
|
-
/* @__PURE__ */
|
|
1998
|
-
/* @__PURE__ */
|
|
1999
|
-
), menusExpanded && /* @__PURE__ */
|
|
1997
|
+
/* @__PURE__ */ React18__namespace.default.createElement(lucideReact.LayoutGrid, { className: "w-4 h-4" }),
|
|
1998
|
+
/* @__PURE__ */ React18__namespace.default.createElement("span", null, translations?.operations ?? "\u0130\u015Flemler")
|
|
1999
|
+
), menusExpanded && /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "animate-in fade-in slide-in-from-top-2 duration-200" }, /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "flex items-center justify-between mb-2 px-1" }, /* @__PURE__ */ React18__namespace.default.createElement("span", { className: "text-xs font-semibold text-muted-foreground uppercase tracking-wider" }, translations?.operations ?? "\u0130\u015Flemler"), /* @__PURE__ */ React18__namespace.default.createElement(
|
|
2000
2000
|
"button",
|
|
2001
2001
|
{
|
|
2002
2002
|
onClick: () => setMenusExpanded(false),
|
|
2003
2003
|
className: "w-6 h-6 rounded-lg flex items-center justify-center text-muted-foreground hover:text-foreground hover:bg-accent/60 transition-all duration-150"
|
|
2004
2004
|
},
|
|
2005
|
-
/* @__PURE__ */
|
|
2006
|
-
)), /* @__PURE__ */
|
|
2005
|
+
/* @__PURE__ */ React18__namespace.default.createElement(lucideReact.X, { className: "w-3.5 h-3.5" })
|
|
2006
|
+
)), /* @__PURE__ */ React18__namespace.default.createElement("nav", { className: "space-y-0.5" }, /* @__PURE__ */ React18__namespace.default.createElement(
|
|
2007
2007
|
"button",
|
|
2008
2008
|
{
|
|
2009
2009
|
onClick: () => {
|
|
@@ -2015,10 +2015,10 @@ var Sidebar = ({
|
|
|
2015
2015
|
activeCustomMenu === null ? "bg-primary/10 text-primary" : "text-muted-foreground hover:bg-accent/60 hover:text-foreground"
|
|
2016
2016
|
)
|
|
2017
2017
|
},
|
|
2018
|
-
/* @__PURE__ */
|
|
2019
|
-
/* @__PURE__ */
|
|
2020
|
-
activeCustomMenu === null && /* @__PURE__ */
|
|
2021
|
-
), sidebarMenus?.map((item) => /* @__PURE__ */
|
|
2018
|
+
/* @__PURE__ */ React18__namespace.default.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", className: "w-4 h-4 shrink-0", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ React18__namespace.default.createElement("rect", { x: "3", y: "4", width: "18", height: "18", rx: "2", ry: "2" }), /* @__PURE__ */ React18__namespace.default.createElement("line", { x1: "16", y1: "2", x2: "16", y2: "6" }), /* @__PURE__ */ React18__namespace.default.createElement("line", { x1: "8", y1: "2", x2: "8", y2: "6" }), /* @__PURE__ */ React18__namespace.default.createElement("line", { x1: "3", y1: "10", x2: "21", y2: "10" })),
|
|
2019
|
+
/* @__PURE__ */ React18__namespace.default.createElement("span", null, translations?.calendar ?? "Takvim"),
|
|
2020
|
+
activeCustomMenu === null && /* @__PURE__ */ React18__namespace.default.createElement("span", { className: "ml-auto w-1.5 h-1.5 rounded-full bg-primary" })
|
|
2021
|
+
), sidebarMenus?.map((item) => /* @__PURE__ */ React18__namespace.default.createElement(
|
|
2022
2022
|
"button",
|
|
2023
2023
|
{
|
|
2024
2024
|
key: item.id,
|
|
@@ -2031,10 +2031,10 @@ var Sidebar = ({
|
|
|
2031
2031
|
activeCustomMenu === item.id ? "bg-primary/10 text-primary" : "text-muted-foreground hover:bg-accent/60 hover:text-foreground"
|
|
2032
2032
|
)
|
|
2033
2033
|
},
|
|
2034
|
-
item.icon && /* @__PURE__ */
|
|
2035
|
-
/* @__PURE__ */
|
|
2036
|
-
activeCustomMenu === item.id && /* @__PURE__ */
|
|
2037
|
-
))))), onEventCreate && /* @__PURE__ */
|
|
2034
|
+
item.icon && /* @__PURE__ */ React18__namespace.default.createElement("span", { className: "w-4 h-4 shrink-0 flex items-center justify-center" }, item.icon),
|
|
2035
|
+
/* @__PURE__ */ React18__namespace.default.createElement("span", { className: "truncate" }, item.label),
|
|
2036
|
+
activeCustomMenu === item.id && /* @__PURE__ */ React18__namespace.default.createElement("span", { className: "ml-auto w-1.5 h-1.5 rounded-full bg-primary" })
|
|
2037
|
+
))))), onEventCreate && /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "md:hidden px-4 mb-4" }, /* @__PURE__ */ React18__namespace.default.createElement(
|
|
2038
2038
|
Button,
|
|
2039
2039
|
{
|
|
2040
2040
|
onClick: () => {
|
|
@@ -2042,9 +2042,9 @@ var Sidebar = ({
|
|
|
2042
2042
|
},
|
|
2043
2043
|
className: "w-full rounded-2xl h-11 gap-2.5 justify-center shadow-sm shadow-primary/20 transition-all duration-200 font-medium text-sm"
|
|
2044
2044
|
},
|
|
2045
|
-
/* @__PURE__ */
|
|
2046
|
-
/* @__PURE__ */
|
|
2047
|
-
)), onReverseTimeChange && /* @__PURE__ */
|
|
2045
|
+
/* @__PURE__ */ React18__namespace.default.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", className: "w-4 h-4 shrink-0", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2.5, strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ React18__namespace.default.createElement("path", { d: "M5 12h14" }), /* @__PURE__ */ React18__namespace.default.createElement("path", { d: "M12 5v14" })),
|
|
2046
|
+
/* @__PURE__ */ React18__namespace.default.createElement("span", null, translations?.createEvent ?? "Etkinlik Olu\u015Ftur")
|
|
2047
|
+
)), onReverseTimeChange && /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "px-4 mb-4" }, /* @__PURE__ */ React18__namespace.default.createElement(
|
|
2048
2048
|
"button",
|
|
2049
2049
|
{
|
|
2050
2050
|
onClick: () => onReverseTimeChange(!reverseTime),
|
|
@@ -2053,33 +2053,33 @@ var Sidebar = ({
|
|
|
2053
2053
|
reverseTime ? "bg-primary/10 border-primary/30 text-primary" : "bg-muted/30 border-border/50 text-muted-foreground hover:border-primary/30 hover:text-foreground"
|
|
2054
2054
|
)
|
|
2055
2055
|
},
|
|
2056
|
-
/* @__PURE__ */
|
|
2057
|
-
/* @__PURE__ */
|
|
2056
|
+
/* @__PURE__ */ React18__namespace.default.createElement("div", { className: "flex items-center gap-2.5" }, /* @__PURE__ */ React18__namespace.default.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", className: "w-4 h-4 shrink-0", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ React18__namespace.default.createElement("line", { x1: "12", y1: "19", x2: "12", y2: "5" }), /* @__PURE__ */ React18__namespace.default.createElement("polyline", { points: "5 12 12 5 19 12" }), /* @__PURE__ */ React18__namespace.default.createElement("line", { x1: "12", y1: "5", x2: "12", y2: "19", className: "opacity-40" }), /* @__PURE__ */ React18__namespace.default.createElement("polyline", { points: "5 12 12 19 19 12", className: "opacity-40" })), /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "text-left" }, /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "text-xs font-semibold leading-tight" }, translations?.reverseTimeLabel ?? "Saat Y\xF6n\xFC"), /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "text-[10px] leading-tight opacity-70 mt-0.5" }, reverseTime ? "23:00 \u2192 00:00" : "00:00 \u2192 23:00"))),
|
|
2057
|
+
/* @__PURE__ */ React18__namespace.default.createElement("div", { className: cn(
|
|
2058
2058
|
"relative w-9 h-5 rounded-full transition-colors duration-200 shrink-0",
|
|
2059
2059
|
reverseTime ? "bg-primary" : "bg-border"
|
|
2060
|
-
) }, /* @__PURE__ */
|
|
2060
|
+
) }, /* @__PURE__ */ React18__namespace.default.createElement("span", { className: cn(
|
|
2061
2061
|
"absolute top-0.5 w-4 h-4 bg-white rounded-full shadow-sm transition-all duration-200",
|
|
2062
2062
|
reverseTime ? "left-4" : "left-0.5"
|
|
2063
2063
|
) }))
|
|
2064
2064
|
)), renderMiniCalendar ? (
|
|
2065
2065
|
// Custom mini-calendar: receives the same props as the built-in one
|
|
2066
2066
|
renderMiniCalendar({ currentDate, onDateChange, onViewChange })
|
|
2067
|
-
) : /* @__PURE__ */
|
|
2067
|
+
) : /* @__PURE__ */ React18__namespace.default.createElement(MiniCalendar, { currentDate, onDateChange, onViewChange, locale }), /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "flex-1 px-4 space-y-5 mt-5" }, /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "bg-muted/20 rounded-2xl p-3 border-[0px] border-border/30" }, /* @__PURE__ */ React18__namespace.default.createElement(
|
|
2068
2068
|
"div",
|
|
2069
2069
|
{
|
|
2070
2070
|
className: "flex items-center justify-between cursor-pointer hover:bg-accent/50 p-2 -m-1 rounded-xl mb-2 transition-all duration-200",
|
|
2071
2071
|
onClick: () => setCalendarsOpen(!calendarsOpen)
|
|
2072
2072
|
},
|
|
2073
|
-
/* @__PURE__ */
|
|
2074
|
-
/* @__PURE__ */
|
|
2075
|
-
), calendarsOpen && /* @__PURE__ */
|
|
2073
|
+
/* @__PURE__ */ React18__namespace.default.createElement("span", { className: "text-sm font-semibold text-foreground" }, translations?.calendars),
|
|
2074
|
+
/* @__PURE__ */ React18__namespace.default.createElement(lucideReact.ChevronDown, { className: cn("w-4 h-4 text-muted-foreground transition-transform duration-200", calendarsOpen && "rotate-180") })
|
|
2075
|
+
), calendarsOpen && /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "space-y-1" }, displayCalendars.map((cal) => /* @__PURE__ */ React18__namespace.default.createElement(
|
|
2076
2076
|
"div",
|
|
2077
2077
|
{
|
|
2078
2078
|
key: cal.id,
|
|
2079
2079
|
className: "flex items-center gap-3 py-2 px-2 hover:bg-accent/60 rounded-xl cursor-pointer group transition-all duration-200",
|
|
2080
2080
|
onClick: () => onCalendarToggle?.(cal.id, !(cal.active ?? true))
|
|
2081
2081
|
},
|
|
2082
|
-
/* @__PURE__ */
|
|
2082
|
+
/* @__PURE__ */ React18__namespace.default.createElement("div", { className: "relative flex items-center justify-center" }, /* @__PURE__ */ React18__namespace.default.createElement(
|
|
2083
2083
|
"input",
|
|
2084
2084
|
{
|
|
2085
2085
|
type: "checkbox",
|
|
@@ -2092,7 +2092,7 @@ var Sidebar = ({
|
|
|
2092
2092
|
style: { "--primary-color": cal.color },
|
|
2093
2093
|
"data-cal-id": cal.id
|
|
2094
2094
|
}
|
|
2095
|
-
), /* @__PURE__ */
|
|
2095
|
+
), /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "absolute inset-0 flex items-center justify-center pointer-events-none opacity-0 peer-checked:opacity-100 transition-opacity" }, /* @__PURE__ */ React18__namespace.default.createElement("svg", { className: "w-3.5 h-3.5 text-white", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 3 }, /* @__PURE__ */ React18__namespace.default.createElement("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" }))), /* @__PURE__ */ React18__namespace.default.createElement("style", null, `
|
|
2096
2096
|
input[type="checkbox"][data-cal-id="${cal.id}"]:checked {
|
|
2097
2097
|
background-color: ${cal.color} !important;
|
|
2098
2098
|
border-color: ${cal.color} !important;
|
|
@@ -2101,23 +2101,23 @@ var Sidebar = ({
|
|
|
2101
2101
|
--tw-ring-color: ${cal.color}40 !important;
|
|
2102
2102
|
}
|
|
2103
2103
|
`)),
|
|
2104
|
-
/* @__PURE__ */
|
|
2105
|
-
/* @__PURE__ */
|
|
2104
|
+
/* @__PURE__ */ React18__namespace.default.createElement("div", { className: "flex items-center gap-2 flex-1 min-w-0" }, /* @__PURE__ */ React18__namespace.default.createElement("span", { className: "text-sm text-foreground/90 truncate font-medium" }, cal.label)),
|
|
2105
|
+
/* @__PURE__ */ React18__namespace.default.createElement(
|
|
2106
2106
|
"div",
|
|
2107
2107
|
{
|
|
2108
2108
|
className: "w-2 h-2 rounded-full opacity-60 group-hover:opacity-100 transition-opacity",
|
|
2109
2109
|
style: { backgroundColor: cal.color }
|
|
2110
2110
|
}
|
|
2111
2111
|
)
|
|
2112
|
-
))))), /* @__PURE__ */
|
|
2112
|
+
))))), /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "mt-auto px-4 pt-5" }, /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "bg-muted/20 rounded-2xl p-3" }, /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "flex items-center gap-2 mb-3" }, /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "p-1.5 bg-primary/10 rounded-lg" }, /* @__PURE__ */ React18__namespace.default.createElement(lucideReact.Globe, { className: "w-4 h-4 text-primary" })), /* @__PURE__ */ React18__namespace.default.createElement("span", { className: "text-sm font-semibold text-foreground" }, translations?.timezone)), /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "relative" }, /* @__PURE__ */ React18__namespace.default.createElement(
|
|
2113
2113
|
"button",
|
|
2114
2114
|
{
|
|
2115
2115
|
onClick: () => setTimezoneOpen(!timezoneOpen),
|
|
2116
2116
|
className: "w-full flex items-center justify-between bg-blue-200/40 hover:bg-blue-200/80 rounded-xl py-2.5 pl-4 pr-3 text-sm text-foreground focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary/50 transition-all duration-200 text-left"
|
|
2117
2117
|
},
|
|
2118
|
-
/* @__PURE__ */
|
|
2119
|
-
/* @__PURE__ */
|
|
2120
|
-
), timezoneOpen && /* @__PURE__ */
|
|
2118
|
+
/* @__PURE__ */ React18__namespace.default.createElement("div", { className: "flex-1 truncate mr-2 font-medium" }, selectedTimezoneLabel),
|
|
2119
|
+
/* @__PURE__ */ React18__namespace.default.createElement(lucideReact.ChevronDown, { className: cn("w-4 h-4 text-muted-foreground transition-transform duration-200", timezoneOpen && "rotate-180") })
|
|
2120
|
+
), timezoneOpen && /* @__PURE__ */ React18__namespace.default.createElement(React18__namespace.default.Fragment, null, /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "fixed inset-0 z-40", onClick: () => setTimezoneOpen(false) }), /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "absolute bottom-full left-0 w-full mb-2 bg-background rounded-xl shadow-2xl z-50 max-h-[260px] overflow-y-auto p-1.5 animate-in fade-in zoom-in-95 duration-200 backdrop-blur-none" }, timezones.map((tz) => /* @__PURE__ */ React18__namespace.default.createElement(
|
|
2121
2121
|
"div",
|
|
2122
2122
|
{
|
|
2123
2123
|
key: tz.value,
|
|
@@ -2150,7 +2150,7 @@ var DraggableEvent = ({ event, children, className, style: propStyle, ...props }
|
|
|
2150
2150
|
opacity: isDragging ? 0 : propStyle?.opacity
|
|
2151
2151
|
// Hiding original element completely
|
|
2152
2152
|
};
|
|
2153
|
-
return /* @__PURE__ */
|
|
2153
|
+
return /* @__PURE__ */ React18__namespace.default.createElement(
|
|
2154
2154
|
"div",
|
|
2155
2155
|
{
|
|
2156
2156
|
ref: setNodeRef,
|
|
@@ -2171,7 +2171,7 @@ var DroppableCell = ({ id, date, resourceId, children, className, style, onClick
|
|
|
2171
2171
|
const minutes = date.getMinutes();
|
|
2172
2172
|
const quarterClass = minutes === 0 ? "hover:bg-blue-50/50 dark:hover:bg-blue-900/10" : minutes === 15 ? "hover:bg-blue-50/80 dark:hover:bg-blue-900/20" : minutes === 30 ? "hover:bg-blue-100/50 dark:hover:bg-blue-900/30" : "hover:bg-blue-100/80 dark:hover:bg-blue-900/40";
|
|
2173
2173
|
const activeQuarterClass = minutes === 0 ? "bg-blue-50/50 dark:bg-blue-900/10 ring-2 ring-primary ring-inset" : minutes === 15 ? "bg-blue-50/80 dark:bg-blue-900/20 ring-2 ring-primary ring-inset" : minutes === 30 ? "bg-blue-100/50 dark:bg-blue-900/30 ring-2 ring-primary ring-inset" : "bg-blue-100/80 dark:bg-blue-900/40 ring-2 ring-primary ring-inset";
|
|
2174
|
-
return /* @__PURE__ */
|
|
2174
|
+
return /* @__PURE__ */ React18__namespace.default.createElement(
|
|
2175
2175
|
"div",
|
|
2176
2176
|
{
|
|
2177
2177
|
ref: setNodeRef,
|
|
@@ -2188,7 +2188,7 @@ var DroppableCell = ({ id, date, resourceId, children, className, style, onClick
|
|
|
2188
2188
|
};
|
|
2189
2189
|
|
|
2190
2190
|
// src/views/MonthView.tsx
|
|
2191
|
-
var EventItem =
|
|
2191
|
+
var EventItem = React18__namespace.default.memo(({ event, onEventClick }) => /* @__PURE__ */ React18__namespace.default.createElement(DraggableEvent, { event }, /* @__PURE__ */ React18__namespace.default.createElement(
|
|
2192
2192
|
"div",
|
|
2193
2193
|
{
|
|
2194
2194
|
className: cn(
|
|
@@ -2206,7 +2206,7 @@ var EventItem = React17__namespace.default.memo(({ event, onEventClick }) => /*
|
|
|
2206
2206
|
onEventClick?.(event);
|
|
2207
2207
|
}
|
|
2208
2208
|
},
|
|
2209
|
-
/* @__PURE__ */
|
|
2209
|
+
/* @__PURE__ */ React18__namespace.default.createElement("span", { className: "font-medium" }, event.title)
|
|
2210
2210
|
)));
|
|
2211
2211
|
EventItem.displayName = "EventItem";
|
|
2212
2212
|
var MonthView = ({
|
|
@@ -2217,16 +2217,16 @@ var MonthView = ({
|
|
|
2217
2217
|
timezone,
|
|
2218
2218
|
locale
|
|
2219
2219
|
}) => {
|
|
2220
|
-
const days =
|
|
2221
|
-
const weekDays =
|
|
2220
|
+
const days = React18.useMemo(() => getMonthGrid(currentDate), [currentDate]);
|
|
2221
|
+
const weekDays = React18.useMemo(() => {
|
|
2222
2222
|
const start = dateFns.startOfWeek(currentDate, { weekStartsOn: 1 });
|
|
2223
2223
|
const end = dateFns.endOfWeek(currentDate, { weekStartsOn: 1 });
|
|
2224
2224
|
return dateFns.eachDayOfInterval({ start, end });
|
|
2225
2225
|
}, [currentDate]);
|
|
2226
|
-
const getZonedDate =
|
|
2226
|
+
const getZonedDate = React18.useCallback((date) => {
|
|
2227
2227
|
return timezone ? dateFnsTz.toZonedTime(date, timezone) : date;
|
|
2228
2228
|
}, [timezone]);
|
|
2229
|
-
const eventsByDay =
|
|
2229
|
+
const eventsByDay = React18.useMemo(() => {
|
|
2230
2230
|
const map = /* @__PURE__ */ new Map();
|
|
2231
2231
|
events.forEach((event) => {
|
|
2232
2232
|
const zonedStart = getZonedDate(event.start);
|
|
@@ -2238,19 +2238,19 @@ var MonthView = ({
|
|
|
2238
2238
|
});
|
|
2239
2239
|
return map;
|
|
2240
2240
|
}, [events, getZonedDate]);
|
|
2241
|
-
return /* @__PURE__ */
|
|
2241
|
+
return /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "flex flex-col h-full min-h-0 bg-background border-[0.5px] scrollbar-hide border-border/50 rounded-2xl overflow-hidden min-w-[800px] md:min-w-0 shadow-sm" }, /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "overflow-y-auto flex-1 min-h-0 relative" }, /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "grid grid-cols-7 border-b-[0.5px] border-border/50 bg-gradient-to-r from-muted/30 via-muted/40 to-muted/30 sticky top-0 z-20 backdrop-blur-sm" }, weekDays.map((day) => /* @__PURE__ */ React18__namespace.default.createElement(
|
|
2242
2242
|
"div",
|
|
2243
2243
|
{
|
|
2244
2244
|
key: day.toISOString(),
|
|
2245
2245
|
className: "py-3 text-center text-xs font-semibold text-muted-foreground border-r-[0.5px] border-border/30 last:border-r-0 uppercase tracking-wider"
|
|
2246
2246
|
},
|
|
2247
2247
|
dateFns.format(day, "EEE", { locale })
|
|
2248
|
-
))), /* @__PURE__ */
|
|
2248
|
+
))), /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "grid grid-cols-7", style: { gridAutoRows: "130px" } }, days.map((day) => {
|
|
2249
2249
|
const dayKey = dateFns.format(day, "yyyy-MM-dd");
|
|
2250
2250
|
const dayEvents = eventsByDay.get(dayKey) || [];
|
|
2251
2251
|
const isCurrentMonth = dateFns.isSameMonth(day, currentDate);
|
|
2252
2252
|
const cellId = day.toISOString();
|
|
2253
|
-
return /* @__PURE__ */
|
|
2253
|
+
return /* @__PURE__ */ React18__namespace.default.createElement(
|
|
2254
2254
|
DroppableCell,
|
|
2255
2255
|
{
|
|
2256
2256
|
key: cellId,
|
|
@@ -2263,11 +2263,11 @@ var MonthView = ({
|
|
|
2263
2263
|
),
|
|
2264
2264
|
onClick: () => onDateClick?.(day)
|
|
2265
2265
|
},
|
|
2266
|
-
/* @__PURE__ */
|
|
2266
|
+
/* @__PURE__ */ React18__namespace.default.createElement("div", { className: "flex justify-between items-start" }, /* @__PURE__ */ React18__namespace.default.createElement("div", { className: cn(
|
|
2267
2267
|
"text-sm font-semibold w-7 h-7 flex items-center justify-center rounded-full transition-all duration-200",
|
|
2268
2268
|
dateFns.isToday(day) ? "bg-primary text-primary-foreground shadow-md shadow-primary/30" : "group-hover:bg-accent"
|
|
2269
|
-
) }, dateFns.format(day, "d", { locale })), dayEvents.length > 0 && /* @__PURE__ */
|
|
2270
|
-
/* @__PURE__ */
|
|
2269
|
+
) }, dateFns.format(day, "d", { locale })), dayEvents.length > 0 && /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "text-[10px] font-medium text-muted-foreground/60 bg-muted/50 px-1.5 py-0.5 rounded-full" }, dayEvents.length)),
|
|
2270
|
+
/* @__PURE__ */ React18__namespace.default.createElement("div", { className: "flex-1 flex flex-col gap-1 scrollbar-hide overflow-y-auto overflow-x-hidden" }, dayEvents.slice(0, 4).map((event) => /* @__PURE__ */ React18__namespace.default.createElement(EventItem, { key: `${event.id}-${dayKey}`, event, onEventClick })), dayEvents.length > 4 && /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "text-[10px] text-primary font-semibold text-center py-1 px-2 rounded-md bg-primary/5 hover:bg-primary/10 cursor-pointer transition-colors" }, "+", dayEvents.length - 4, " more"))
|
|
2271
2271
|
);
|
|
2272
2272
|
}))));
|
|
2273
2273
|
};
|
|
@@ -2281,12 +2281,12 @@ var ResizableEvent = ({
|
|
|
2281
2281
|
style,
|
|
2282
2282
|
readonly
|
|
2283
2283
|
}) => {
|
|
2284
|
-
const [isResizing, setIsResizing] =
|
|
2285
|
-
const [resizeHeight, setResizeHeight] =
|
|
2286
|
-
const containerRef =
|
|
2287
|
-
const startYRef =
|
|
2288
|
-
const startHeightRef =
|
|
2289
|
-
const handleResizeStart =
|
|
2284
|
+
const [isResizing, setIsResizing] = React18.useState(false);
|
|
2285
|
+
const [resizeHeight, setResizeHeight] = React18.useState(null);
|
|
2286
|
+
const containerRef = React18.useRef(null);
|
|
2287
|
+
const startYRef = React18.useRef(0);
|
|
2288
|
+
const startHeightRef = React18.useRef(0);
|
|
2289
|
+
const handleResizeStart = React18.useCallback((e) => {
|
|
2290
2290
|
e.preventDefault();
|
|
2291
2291
|
e.stopPropagation();
|
|
2292
2292
|
const clientY = "touches" in e ? e.touches[0].clientY : e.clientY;
|
|
@@ -2328,7 +2328,7 @@ var ResizableEvent = ({
|
|
|
2328
2328
|
document.addEventListener("touchmove", handleMove, { passive: false });
|
|
2329
2329
|
document.addEventListener("touchend", handleEnd);
|
|
2330
2330
|
}, [event, hourHeight, minDuration, onResize, resizeHeight]);
|
|
2331
|
-
return /* @__PURE__ */
|
|
2331
|
+
return /* @__PURE__ */ React18__namespace.default.createElement(
|
|
2332
2332
|
"div",
|
|
2333
2333
|
{
|
|
2334
2334
|
ref: containerRef,
|
|
@@ -2339,7 +2339,7 @@ var ResizableEvent = ({
|
|
|
2339
2339
|
}
|
|
2340
2340
|
},
|
|
2341
2341
|
children,
|
|
2342
|
-
/* @__PURE__ */
|
|
2342
|
+
/* @__PURE__ */ React18__namespace.default.createElement(
|
|
2343
2343
|
"div",
|
|
2344
2344
|
{
|
|
2345
2345
|
className: cn(
|
|
@@ -2351,12 +2351,12 @@ var ResizableEvent = ({
|
|
|
2351
2351
|
onMouseDown: readonly ? void 0 : handleResizeStart,
|
|
2352
2352
|
onTouchStart: readonly ? void 0 : handleResizeStart
|
|
2353
2353
|
},
|
|
2354
|
-
/* @__PURE__ */
|
|
2354
|
+
/* @__PURE__ */ React18__namespace.default.createElement("div", { className: cn(
|
|
2355
2355
|
"w-8 h-1 rounded-full transition-all",
|
|
2356
2356
|
isResizing ? "bg-primary" : "bg-muted-foreground/30 group-hover:bg-primary/50"
|
|
2357
2357
|
) })
|
|
2358
2358
|
),
|
|
2359
|
-
isResizing && /* @__PURE__ */
|
|
2359
|
+
isResizing && /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "absolute inset-0 border-2 border-primary border-dashed rounded-md pointer-events-none bg-primary/5" })
|
|
2360
2360
|
);
|
|
2361
2361
|
};
|
|
2362
2362
|
var EventCardBadge = ({
|
|
@@ -2365,7 +2365,7 @@ var EventCardBadge = ({
|
|
|
2365
2365
|
className
|
|
2366
2366
|
}) => {
|
|
2367
2367
|
if (!badge?.icon || !badge?.name) return null;
|
|
2368
|
-
return /* @__PURE__ */
|
|
2368
|
+
return /* @__PURE__ */ React18__namespace.default.createElement(
|
|
2369
2369
|
"div",
|
|
2370
2370
|
{
|
|
2371
2371
|
className: cn(
|
|
@@ -2378,26 +2378,121 @@ var EventCardBadge = ({
|
|
|
2378
2378
|
),
|
|
2379
2379
|
title: badge.name
|
|
2380
2380
|
},
|
|
2381
|
-
/* @__PURE__ */
|
|
2382
|
-
!compact && /* @__PURE__ */
|
|
2381
|
+
/* @__PURE__ */ React18__namespace.default.createElement("span", { className: "shrink-0 flex items-center justify-center [&>svg]:w-2.5 [&>svg]:h-2.5" }, badge.icon),
|
|
2382
|
+
!compact && /* @__PURE__ */ React18__namespace.default.createElement("span", { className: "truncate max-w-[72px]" }, badge.name)
|
|
2383
2383
|
);
|
|
2384
2384
|
};
|
|
2385
|
+
var EventHoverPopover = ({
|
|
2386
|
+
enabled,
|
|
2387
|
+
event,
|
|
2388
|
+
timeRange,
|
|
2389
|
+
children,
|
|
2390
|
+
className
|
|
2391
|
+
}) => {
|
|
2392
|
+
const triggerRef = React18.useRef(null);
|
|
2393
|
+
const [open, setOpen] = React18.useState(false);
|
|
2394
|
+
const [coords, setCoords] = React18.useState({ top: 0, left: 0, placeAbove: true });
|
|
2395
|
+
const hideTimerRef = React18.useRef(null);
|
|
2396
|
+
const updatePosition = React18.useCallback(() => {
|
|
2397
|
+
const el = triggerRef.current;
|
|
2398
|
+
if (!el) return;
|
|
2399
|
+
const rect = el.getBoundingClientRect();
|
|
2400
|
+
const placeAbove = rect.top > 160;
|
|
2401
|
+
setCoords({
|
|
2402
|
+
top: placeAbove ? rect.top - 8 : rect.bottom + 8,
|
|
2403
|
+
left: Math.min(
|
|
2404
|
+
Math.max(rect.left + rect.width / 2, 120),
|
|
2405
|
+
window.innerWidth - 120
|
|
2406
|
+
),
|
|
2407
|
+
placeAbove
|
|
2408
|
+
});
|
|
2409
|
+
}, []);
|
|
2410
|
+
const show = React18.useCallback(() => {
|
|
2411
|
+
if (!enabled) return;
|
|
2412
|
+
if (hideTimerRef.current) {
|
|
2413
|
+
clearTimeout(hideTimerRef.current);
|
|
2414
|
+
hideTimerRef.current = null;
|
|
2415
|
+
}
|
|
2416
|
+
updatePosition();
|
|
2417
|
+
setOpen(true);
|
|
2418
|
+
}, [enabled, updatePosition]);
|
|
2419
|
+
const scheduleHide = React18.useCallback(() => {
|
|
2420
|
+
if (hideTimerRef.current) clearTimeout(hideTimerRef.current);
|
|
2421
|
+
hideTimerRef.current = setTimeout(() => setOpen(false), 80);
|
|
2422
|
+
}, []);
|
|
2423
|
+
React18.useEffect(() => {
|
|
2424
|
+
if (!open) return;
|
|
2425
|
+
const onMove = () => updatePosition();
|
|
2426
|
+
window.addEventListener("scroll", onMove, true);
|
|
2427
|
+
window.addEventListener("resize", onMove);
|
|
2428
|
+
return () => {
|
|
2429
|
+
window.removeEventListener("scroll", onMove, true);
|
|
2430
|
+
window.removeEventListener("resize", onMove);
|
|
2431
|
+
};
|
|
2432
|
+
}, [open, updatePosition]);
|
|
2433
|
+
React18.useEffect(() => () => {
|
|
2434
|
+
if (hideTimerRef.current) clearTimeout(hideTimerRef.current);
|
|
2435
|
+
}, []);
|
|
2436
|
+
if (!enabled) {
|
|
2437
|
+
return /* @__PURE__ */ React18__namespace.default.createElement(React18__namespace.default.Fragment, null, children);
|
|
2438
|
+
}
|
|
2439
|
+
const accent = event.color || "hsl(var(--primary))";
|
|
2440
|
+
return /* @__PURE__ */ React18__namespace.default.createElement(React18__namespace.default.Fragment, null, /* @__PURE__ */ React18__namespace.default.createElement(
|
|
2441
|
+
"div",
|
|
2442
|
+
{
|
|
2443
|
+
ref: triggerRef,
|
|
2444
|
+
className: cn("h-full w-full", className),
|
|
2445
|
+
onMouseEnter: show,
|
|
2446
|
+
onMouseLeave: scheduleHide
|
|
2447
|
+
},
|
|
2448
|
+
children
|
|
2449
|
+
), open && typeof document !== "undefined" && reactDom.createPortal(
|
|
2450
|
+
/* @__PURE__ */ React18__namespace.default.createElement(
|
|
2451
|
+
"div",
|
|
2452
|
+
{
|
|
2453
|
+
role: "tooltip",
|
|
2454
|
+
className: cn(
|
|
2455
|
+
"fixed z-[10000] w-64 max-w-[min(16rem,calc(100vw-1.5rem))]",
|
|
2456
|
+
"rounded-xl border border-border/60 bg-popover text-popover-foreground",
|
|
2457
|
+
"shadow-xl shadow-black/10 backdrop-blur-md",
|
|
2458
|
+
"pointer-events-none transition-opacity duration-150"
|
|
2459
|
+
),
|
|
2460
|
+
style: {
|
|
2461
|
+
top: coords.top,
|
|
2462
|
+
left: coords.left,
|
|
2463
|
+
transform: coords.placeAbove ? "translate(-50%, -100%)" : "translate(-50%, 0)"
|
|
2464
|
+
},
|
|
2465
|
+
onMouseEnter: show,
|
|
2466
|
+
onMouseLeave: scheduleHide
|
|
2467
|
+
},
|
|
2468
|
+
/* @__PURE__ */ React18__namespace.default.createElement(
|
|
2469
|
+
"div",
|
|
2470
|
+
{
|
|
2471
|
+
className: "h-1 rounded-t-xl",
|
|
2472
|
+
style: { backgroundColor: accent }
|
|
2473
|
+
}
|
|
2474
|
+
),
|
|
2475
|
+
/* @__PURE__ */ React18__namespace.default.createElement("div", { className: "p-3 space-y-2" }, /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "text-sm font-semibold leading-snug text-foreground" }, event.title), /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "text-xs font-medium text-muted-foreground tabular-nums" }, timeRange), event.description && /* @__PURE__ */ React18__namespace.default.createElement("p", { className: "text-xs text-muted-foreground/90 leading-relaxed line-clamp-4" }, event.description), event.guests?.length || event.attachments?.length || event.reminders?.length ? /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "flex flex-wrap gap-1.5 pt-0.5" }, event.guests && event.guests.length > 0 && /* @__PURE__ */ React18__namespace.default.createElement("span", { className: "rounded-md bg-muted/60 px-1.5 py-0.5 text-[10px] text-muted-foreground" }, event.guests.length, " guest", event.guests.length !== 1 ? "s" : ""), event.attachments && event.attachments.length > 0 && /* @__PURE__ */ React18__namespace.default.createElement("span", { className: "rounded-md bg-muted/60 px-1.5 py-0.5 text-[10px] text-muted-foreground" }, event.attachments.length, " file", event.attachments.length !== 1 ? "s" : ""), event.reminders && event.reminders.length > 0 && /* @__PURE__ */ React18__namespace.default.createElement("span", { className: "rounded-md bg-muted/60 px-1.5 py-0.5 text-[10px] text-muted-foreground" }, event.reminders.length, " reminder", event.reminders.length !== 1 ? "s" : "")) : null)
|
|
2476
|
+
),
|
|
2477
|
+
document.body
|
|
2478
|
+
));
|
|
2479
|
+
};
|
|
2385
2480
|
var ICON_CLASS = "w-2.5 h-2.5";
|
|
2386
2481
|
var EVENT_BADGE_ICONS = {
|
|
2387
|
-
privateLesson: /* @__PURE__ */
|
|
2388
|
-
groupLesson: /* @__PURE__ */
|
|
2389
|
-
packageLesson: /* @__PURE__ */
|
|
2390
|
-
online: /* @__PURE__ */
|
|
2391
|
-
inPerson: /* @__PURE__ */
|
|
2392
|
-
homeVisit: /* @__PURE__ */
|
|
2393
|
-
trial: /* @__PURE__ */
|
|
2394
|
-
makeup: /* @__PURE__ */
|
|
2395
|
-
exam: /* @__PURE__ */
|
|
2396
|
-
workshop: /* @__PURE__ */
|
|
2397
|
-
priority: /* @__PURE__ */
|
|
2398
|
-
holiday: /* @__PURE__ */
|
|
2399
|
-
cancelled: /* @__PURE__ */
|
|
2400
|
-
listening: /* @__PURE__ */
|
|
2482
|
+
privateLesson: /* @__PURE__ */ React18__namespace.default.createElement(lucideReact.User, { className: ICON_CLASS }),
|
|
2483
|
+
groupLesson: /* @__PURE__ */ React18__namespace.default.createElement(lucideReact.Users, { className: ICON_CLASS }),
|
|
2484
|
+
packageLesson: /* @__PURE__ */ React18__namespace.default.createElement(lucideReact.Package, { className: ICON_CLASS }),
|
|
2485
|
+
online: /* @__PURE__ */ React18__namespace.default.createElement(lucideReact.Video, { className: ICON_CLASS }),
|
|
2486
|
+
inPerson: /* @__PURE__ */ React18__namespace.default.createElement(lucideReact.MapPin, { className: ICON_CLASS }),
|
|
2487
|
+
homeVisit: /* @__PURE__ */ React18__namespace.default.createElement(lucideReact.Home, { className: ICON_CLASS }),
|
|
2488
|
+
trial: /* @__PURE__ */ React18__namespace.default.createElement(lucideReact.Sparkles, { className: ICON_CLASS }),
|
|
2489
|
+
makeup: /* @__PURE__ */ React18__namespace.default.createElement(lucideReact.RefreshCw, { className: ICON_CLASS }),
|
|
2490
|
+
exam: /* @__PURE__ */ React18__namespace.default.createElement(lucideReact.ClipboardCheck, { className: ICON_CLASS }),
|
|
2491
|
+
workshop: /* @__PURE__ */ React18__namespace.default.createElement(lucideReact.Presentation, { className: ICON_CLASS }),
|
|
2492
|
+
priority: /* @__PURE__ */ React18__namespace.default.createElement(lucideReact.Star, { className: ICON_CLASS }),
|
|
2493
|
+
holiday: /* @__PURE__ */ React18__namespace.default.createElement(lucideReact.PartyPopper, { className: ICON_CLASS }),
|
|
2494
|
+
cancelled: /* @__PURE__ */ React18__namespace.default.createElement(lucideReact.Ban, { className: ICON_CLASS }),
|
|
2495
|
+
listening: /* @__PURE__ */ React18__namespace.default.createElement(lucideReact.Headphones, { className: ICON_CLASS })
|
|
2401
2496
|
};
|
|
2402
2497
|
var EVENT_BADGE_LABELS = {
|
|
2403
2498
|
tr: {
|
|
@@ -2480,20 +2575,21 @@ var WeekView = ({
|
|
|
2480
2575
|
readonly,
|
|
2481
2576
|
language = "tr",
|
|
2482
2577
|
initialScrollHour = 8,
|
|
2483
|
-
reverseTime = false
|
|
2578
|
+
reverseTime = false,
|
|
2579
|
+
compactShortEvents = true
|
|
2484
2580
|
}) => {
|
|
2485
2581
|
const start = dateFns.startOfWeek(currentDate, { weekStartsOn: 1 });
|
|
2486
2582
|
const end = dateFns.endOfWeek(currentDate, { weekStartsOn: 1 });
|
|
2487
2583
|
const weekDays = dateFns.eachDayOfInterval({ start, end });
|
|
2488
2584
|
const hours = reverseTime ? Array.from({ length: 24 }, (_, i) => 23 - i) : Array.from({ length: 24 }, (_, i) => i);
|
|
2489
2585
|
const hourHeight = 60;
|
|
2490
|
-
const scrollContainerRef =
|
|
2491
|
-
const [now, setNow] =
|
|
2492
|
-
|
|
2586
|
+
const scrollContainerRef = React18__namespace.default.useRef(null);
|
|
2587
|
+
const [now, setNow] = React18__namespace.default.useState(/* @__PURE__ */ new Date());
|
|
2588
|
+
React18__namespace.default.useEffect(() => {
|
|
2493
2589
|
const interval = setInterval(() => setNow(/* @__PURE__ */ new Date()), 6e4);
|
|
2494
2590
|
return () => clearInterval(interval);
|
|
2495
2591
|
}, []);
|
|
2496
|
-
|
|
2592
|
+
React18__namespace.default.useEffect(() => {
|
|
2497
2593
|
if (scrollContainerRef.current) {
|
|
2498
2594
|
scrollContainerRef.current.scrollTop = reverseTime ? (23 - initialScrollHour) * hourHeight : initialScrollHour * hourHeight;
|
|
2499
2595
|
}
|
|
@@ -2523,44 +2619,44 @@ var WeekView = ({
|
|
|
2523
2619
|
acronym = tz;
|
|
2524
2620
|
}
|
|
2525
2621
|
}
|
|
2526
|
-
return /* @__PURE__ */
|
|
2622
|
+
return /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "flex flex-col items-center justify-center leading-tight" }, /* @__PURE__ */ React18__namespace.default.createElement("span", null, displayTime), /* @__PURE__ */ React18__namespace.default.createElement("span", { className: "text-[10px] opacity-75" }, "(", acronym, ")"));
|
|
2527
2623
|
};
|
|
2528
2624
|
const timeFormat = getTimeFormat(language);
|
|
2529
2625
|
const eventTimeFormat = getTimeFormatFull(language);
|
|
2530
2626
|
const nowFormat = getTimeFormatFull(language);
|
|
2531
|
-
return /* @__PURE__ */
|
|
2627
|
+
return /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "flex flex-col h-full min-h-0 bg-background border-[0.5px] border-border/50 rounded-2xl overflow-hidden min-w-[800px] md:min-w-0 shadow-sm" }, /* @__PURE__ */ React18__namespace.default.createElement(
|
|
2532
2628
|
"div",
|
|
2533
2629
|
{
|
|
2534
2630
|
ref: scrollContainerRef,
|
|
2535
2631
|
className: "flex-1 min-h-0 overflow-y-auto scrollbar-hide relative bg-background scroll-smooth",
|
|
2536
2632
|
style: { scrollbarGutter: "stable" }
|
|
2537
2633
|
},
|
|
2538
|
-
/* @__PURE__ */
|
|
2634
|
+
/* @__PURE__ */ React18__namespace.default.createElement("div", { className: "flex border-b-[0.5px] border-border/50 bg-gradient-to-r from-muted/20 via-background to-muted/20 z-20 sticky top-0 backdrop-blur-sm" }, /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "flex-none p-3 text-center text-xs font-semibold text-muted-foreground w-16 flex items-center justify-center border-r-[0.5px] border-border/30 bg-muted/10" }, getTimezoneDisplay(timezone)), /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "flex-1 grid grid-cols-7" }, weekDays.map((day, index) => /* @__PURE__ */ React18__namespace.default.createElement("div", { key: day.toISOString(), className: cn("py-3 px-2 text-center", index > 0 && "border-l-[0.5px] border-border/30") }, /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "text-[10px] font-semibold text-muted-foreground uppercase tracking-wider mb-1.5" }, dateFns.format(day, "EEE", { locale })), /* @__PURE__ */ React18__namespace.default.createElement("div", { className: cn(
|
|
2539
2635
|
"w-9 h-9 flex items-center justify-center rounded-xl mx-auto text-sm font-semibold transition-all duration-200",
|
|
2540
2636
|
dateFns.isToday(day) ? "bg-primary text-primary-foreground shadow-lg shadow-primary/30 scale-110" : "text-foreground hover:bg-accent/80"
|
|
2541
2637
|
) }, dateFns.format(day, "d", { locale })))))),
|
|
2542
|
-
/* @__PURE__ */
|
|
2638
|
+
/* @__PURE__ */ React18__namespace.default.createElement(
|
|
2543
2639
|
"div",
|
|
2544
2640
|
{
|
|
2545
2641
|
className: "flex min-w-full relative",
|
|
2546
2642
|
style: { height: hours.length * hourHeight }
|
|
2547
2643
|
},
|
|
2548
|
-
/* @__PURE__ */
|
|
2644
|
+
/* @__PURE__ */ React18__namespace.default.createElement("div", { className: "flex-none w-16 border-r-[0.5px] border-border/30 relative bg-muted/5" }, hours.map((hour) => /* @__PURE__ */ React18__namespace.default.createElement(
|
|
2549
2645
|
"div",
|
|
2550
2646
|
{
|
|
2551
2647
|
key: hour,
|
|
2552
2648
|
className: "relative w-full text-[11px] text-muted-foreground/80 text-right pr-3 font-medium tabular-nums box-border",
|
|
2553
2649
|
style: { height: hourHeight }
|
|
2554
2650
|
},
|
|
2555
|
-
/* @__PURE__ */
|
|
2651
|
+
/* @__PURE__ */ React18__namespace.default.createElement("span", { className: "block -translate-y-1/2" }, hour !== 0 && dateFns.format((/* @__PURE__ */ new Date()).setHours(hour, 0, 0, 0), timeFormat, { locale }))
|
|
2556
2652
|
))),
|
|
2557
|
-
/* @__PURE__ */
|
|
2653
|
+
/* @__PURE__ */ React18__namespace.default.createElement("div", { className: "flex-1 grid grid-cols-7 relative" }, weekDays.map((day, dayIndex) => {
|
|
2558
2654
|
const dayEvents = events.filter((e) => {
|
|
2559
2655
|
const zonedStart = getZonedDate(e.start);
|
|
2560
2656
|
return dateFns.isSameDay(zonedStart, day);
|
|
2561
2657
|
});
|
|
2562
|
-
return /* @__PURE__ */
|
|
2563
|
-
return /* @__PURE__ */
|
|
2658
|
+
return /* @__PURE__ */ React18__namespace.default.createElement("div", { key: day.toISOString(), className: cn("relative h-full", dayIndex > 0 && "border-l-[0.5px] border-border/30") }, hours.map((hour) => {
|
|
2659
|
+
return /* @__PURE__ */ React18__namespace.default.createElement(
|
|
2564
2660
|
"div",
|
|
2565
2661
|
{
|
|
2566
2662
|
key: hour,
|
|
@@ -2571,7 +2667,7 @@ var WeekView = ({
|
|
|
2571
2667
|
const cellDate = new Date(day);
|
|
2572
2668
|
cellDate.setHours(hour, minute, 0, 0);
|
|
2573
2669
|
const cellId = cellDate.toISOString();
|
|
2574
|
-
return /* @__PURE__ */
|
|
2670
|
+
return /* @__PURE__ */ React18__namespace.default.createElement(
|
|
2575
2671
|
DroppableCell,
|
|
2576
2672
|
{
|
|
2577
2673
|
key: minute,
|
|
@@ -2583,7 +2679,7 @@ var WeekView = ({
|
|
|
2583
2679
|
top: `${minute / 60 * 100}%`
|
|
2584
2680
|
}
|
|
2585
2681
|
},
|
|
2586
|
-
/* @__PURE__ */
|
|
2682
|
+
/* @__PURE__ */ React18__namespace.default.createElement(
|
|
2587
2683
|
"div",
|
|
2588
2684
|
{
|
|
2589
2685
|
className: "w-full h-full bg-transparent cursor-pointer",
|
|
@@ -2616,10 +2712,10 @@ var WeekView = ({
|
|
|
2616
2712
|
const durationMinutes = dateFns.differenceInMinutes(zonedEventEnd, zonedEventStart);
|
|
2617
2713
|
const height = durationMinutes / 60 * hourHeight;
|
|
2618
2714
|
const top = reverseTime ? (1440 - startMinutes - durationMinutes) / 60 * hourHeight : startMinutes / 60 * hourHeight;
|
|
2619
|
-
const isShortEvent = durationMinutes < 60;
|
|
2620
|
-
const resolvedBadge = resolveEventBadge(event, language);
|
|
2715
|
+
const isShortEvent = compactShortEvents && durationMinutes < 60;
|
|
2716
|
+
const resolvedBadge = !isShortEvent ? resolveEventBadge(event, language) : void 0;
|
|
2621
2717
|
const hasBadge = Boolean(resolvedBadge);
|
|
2622
|
-
return /* @__PURE__ */
|
|
2718
|
+
return /* @__PURE__ */ React18__namespace.default.createElement(
|
|
2623
2719
|
DraggableEvent,
|
|
2624
2720
|
{
|
|
2625
2721
|
key: `${event.id}-${day.toISOString()}`,
|
|
@@ -2634,7 +2730,7 @@ var WeekView = ({
|
|
|
2634
2730
|
paddingRight: count > 1 ? "2px" : "0"
|
|
2635
2731
|
}
|
|
2636
2732
|
},
|
|
2637
|
-
/* @__PURE__ */
|
|
2733
|
+
/* @__PURE__ */ React18__namespace.default.createElement(
|
|
2638
2734
|
ResizableEvent,
|
|
2639
2735
|
{
|
|
2640
2736
|
readonly,
|
|
@@ -2644,48 +2740,56 @@ var WeekView = ({
|
|
|
2644
2740
|
className: "h-full",
|
|
2645
2741
|
style: { height: "100%" }
|
|
2646
2742
|
},
|
|
2647
|
-
/* @__PURE__ */
|
|
2648
|
-
|
|
2743
|
+
/* @__PURE__ */ React18__namespace.default.createElement(
|
|
2744
|
+
EventHoverPopover,
|
|
2649
2745
|
{
|
|
2650
|
-
|
|
2651
|
-
|
|
2652
|
-
|
|
2653
|
-
readonly ? "cursor-default" : "cursor-grab active:cursor-grabbing",
|
|
2654
|
-
!event.color && "border-primary/20 bg-primary/10",
|
|
2655
|
-
isShortEvent ? "px-1 flex items-center justify-center" : "p-2",
|
|
2656
|
-
// Reserve space under the badge so title/time do not overlap
|
|
2657
|
-
hasBadge && !isShortEvent && "pt-4",
|
|
2658
|
-
// Add active border for overlapped events to distinguish them
|
|
2659
|
-
count > 1 && "border-l-4 border-l-primary/50"
|
|
2660
|
-
),
|
|
2661
|
-
style: {
|
|
2662
|
-
height: "100%",
|
|
2663
|
-
backgroundColor: event.color ? `${event.color}15` : void 0,
|
|
2664
|
-
borderColor: event.color ? `${event.color}40` : void 0,
|
|
2665
|
-
borderLeftWidth: "3px",
|
|
2666
|
-
borderLeftColor: event.color || "var(--primary)"
|
|
2667
|
-
},
|
|
2668
|
-
onClick: (e) => {
|
|
2669
|
-
e.stopPropagation();
|
|
2670
|
-
onEventClick?.(event);
|
|
2671
|
-
},
|
|
2672
|
-
title: count > 1 ? `${event.title} (${index + 1}/${count})` : void 0
|
|
2746
|
+
enabled: isShortEvent,
|
|
2747
|
+
event,
|
|
2748
|
+
timeRange: `${dateFns.format(zonedEventStart, eventTimeFormat, { locale })} - ${dateFns.format(zonedEventEnd, eventTimeFormat, { locale })}`
|
|
2673
2749
|
},
|
|
2674
|
-
|
|
2675
|
-
|
|
2750
|
+
/* @__PURE__ */ React18__namespace.default.createElement(
|
|
2751
|
+
"div",
|
|
2676
2752
|
{
|
|
2677
|
-
|
|
2678
|
-
|
|
2679
|
-
|
|
2680
|
-
|
|
2681
|
-
|
|
2682
|
-
|
|
2683
|
-
|
|
2684
|
-
|
|
2753
|
+
className: cn(
|
|
2754
|
+
"rounded-md border shadow-sm transition-all hover:shadow-md group overflow-hidden relative",
|
|
2755
|
+
"glass",
|
|
2756
|
+
readonly ? "cursor-default" : "cursor-grab active:cursor-grabbing",
|
|
2757
|
+
!event.color && "border-primary/20 bg-primary/10",
|
|
2758
|
+
isShortEvent ? "px-1 flex items-center justify-center" : "p-2",
|
|
2759
|
+
// Reserve space under the badge so title/time do not overlap
|
|
2760
|
+
hasBadge && !isShortEvent && "pt-4",
|
|
2761
|
+
// Add active border for overlapped events to distinguish them
|
|
2762
|
+
count > 1 && "border-l-4 border-l-primary/50"
|
|
2763
|
+
),
|
|
2764
|
+
style: {
|
|
2765
|
+
height: "100%",
|
|
2766
|
+
backgroundColor: event.color ? `${event.color}15` : void 0,
|
|
2767
|
+
borderColor: event.color ? `${event.color}40` : void 0,
|
|
2768
|
+
borderLeftWidth: "3px",
|
|
2769
|
+
borderLeftColor: event.color || "var(--primary)"
|
|
2770
|
+
},
|
|
2771
|
+
onClick: (e) => {
|
|
2772
|
+
e.stopPropagation();
|
|
2773
|
+
onEventClick?.(event);
|
|
2774
|
+
},
|
|
2775
|
+
title: !isShortEvent && count > 1 ? `${event.title} (${index + 1}/${count})` : void 0
|
|
2776
|
+
},
|
|
2777
|
+
hasBadge && /* @__PURE__ */ React18__namespace.default.createElement(
|
|
2778
|
+
EventCardBadge,
|
|
2779
|
+
{
|
|
2780
|
+
badge: resolvedBadge,
|
|
2781
|
+
compact: false
|
|
2782
|
+
}
|
|
2783
|
+
),
|
|
2784
|
+
/* @__PURE__ */ React18__namespace.default.createElement("div", { className: "flex flex-col h-full overflow-hidden w-full" }, /* @__PURE__ */ React18__namespace.default.createElement("div", { className: cn(
|
|
2785
|
+
"font-semibold truncate text-foreground/90 leading-tight",
|
|
2786
|
+
isShortEvent ? "text-xs text-center" : "text-xs"
|
|
2787
|
+
) }, event.title), !isShortEvent && /* @__PURE__ */ React18__namespace.default.createElement(React18__namespace.default.Fragment, null, /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "text-[10px] text-muted-foreground truncate mt-0.5 font-medium leading-tight" }, dateFns.format(zonedEventStart, eventTimeFormat, { locale }), " - ", dateFns.format(zonedEventEnd, eventTimeFormat, { locale })), event.description && height > 50 && /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "text-[10px] text-muted-foreground/80 truncate mt-1 leading-tight opacity-80" }, event.description)), count > 1 && !isShortEvent && /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "absolute top-1 right-1 bg-background/80 backdrop-blur-sm rounded-full w-4 h-4 flex items-center justify-center text-[9px] font-bold text-muted-foreground border border-border shadow-sm" }, count))
|
|
2788
|
+
)
|
|
2685
2789
|
)
|
|
2686
2790
|
)
|
|
2687
2791
|
);
|
|
2688
|
-
}), dateFns.isToday(day) && /* @__PURE__ */
|
|
2792
|
+
}), dateFns.isToday(day) && /* @__PURE__ */ React18__namespace.default.createElement(
|
|
2689
2793
|
"div",
|
|
2690
2794
|
{
|
|
2691
2795
|
className: "absolute left-0 right-0 z-20 pointer-events-none flex items-center",
|
|
@@ -2693,12 +2797,12 @@ var WeekView = ({
|
|
|
2693
2797
|
top: reverseTime ? `${(1440 - (zonedNow.getHours() * 60 + zonedNow.getMinutes())) / 60 * hourHeight}px` : `${(zonedNow.getHours() * 60 + zonedNow.getMinutes()) / 60 * hourHeight}px`
|
|
2694
2798
|
}
|
|
2695
2799
|
},
|
|
2696
|
-
/* @__PURE__ */
|
|
2697
|
-
/* @__PURE__ */
|
|
2800
|
+
/* @__PURE__ */ React18__namespace.default.createElement("div", { className: "h-[2px] w-full bg-gradient-to-r from-primary via-primary to-primary/50" }),
|
|
2801
|
+
/* @__PURE__ */ React18__namespace.default.createElement("div", { className: "absolute -left-1.5 w-3 h-3 bg-primary rounded-full shadow-lg shadow-primary/40 ring-2 ring-background animate-pulse" })
|
|
2698
2802
|
));
|
|
2699
2803
|
}))
|
|
2700
2804
|
),
|
|
2701
|
-
/* @__PURE__ */
|
|
2805
|
+
/* @__PURE__ */ React18__namespace.default.createElement(
|
|
2702
2806
|
"div",
|
|
2703
2807
|
{
|
|
2704
2808
|
className: "absolute left-0 w-16 pointer-events-none z-30 flex justify-end pr-2",
|
|
@@ -2706,7 +2810,7 @@ var WeekView = ({
|
|
|
2706
2810
|
top: reverseTime ? `${(1440 - (zonedNow.getHours() * 60 + zonedNow.getMinutes())) / 60 * hourHeight + 80}px` : `${(zonedNow.getHours() * 60 + zonedNow.getMinutes()) / 60 * hourHeight + 80}px`
|
|
2707
2811
|
}
|
|
2708
2812
|
},
|
|
2709
|
-
/* @__PURE__ */
|
|
2813
|
+
/* @__PURE__ */ React18__namespace.default.createElement("span", { className: "text-[10px] font-bold text-primary-foreground bg-primary px-1.5 py-0.5 rounded-md shadow-md -translate-y-1/2 backdrop-blur-none" }, dateFns.format(zonedNow, nowFormat, { locale }))
|
|
2710
2814
|
)
|
|
2711
2815
|
));
|
|
2712
2816
|
};
|
|
@@ -2721,17 +2825,18 @@ var DayView = ({
|
|
|
2721
2825
|
readonly,
|
|
2722
2826
|
language = "tr",
|
|
2723
2827
|
initialScrollHour = 8,
|
|
2724
|
-
reverseTime = false
|
|
2828
|
+
reverseTime = false,
|
|
2829
|
+
compactShortEvents = true
|
|
2725
2830
|
}) => {
|
|
2726
2831
|
const hours = reverseTime ? Array.from({ length: 24 }, (_, i) => 23 - i) : Array.from({ length: 24 }, (_, i) => i);
|
|
2727
2832
|
const hourHeight = 80;
|
|
2728
|
-
const scrollContainerRef =
|
|
2729
|
-
const [now, setNow] =
|
|
2730
|
-
|
|
2833
|
+
const scrollContainerRef = React18__namespace.default.useRef(null);
|
|
2834
|
+
const [now, setNow] = React18__namespace.default.useState(/* @__PURE__ */ new Date());
|
|
2835
|
+
React18__namespace.default.useEffect(() => {
|
|
2731
2836
|
const interval = setInterval(() => setNow(/* @__PURE__ */ new Date()), 6e4);
|
|
2732
2837
|
return () => clearInterval(interval);
|
|
2733
2838
|
}, []);
|
|
2734
|
-
|
|
2839
|
+
React18__namespace.default.useEffect(() => {
|
|
2735
2840
|
if (scrollContainerRef.current) {
|
|
2736
2841
|
scrollContainerRef.current.scrollTop = reverseTime ? (23 - initialScrollHour) * hourHeight : initialScrollHour * hourHeight;
|
|
2737
2842
|
}
|
|
@@ -2747,15 +2852,15 @@ var DayView = ({
|
|
|
2747
2852
|
const timeFormat = getTimeFormat(language);
|
|
2748
2853
|
const eventTimeFormat = getTimeFormatFull(language);
|
|
2749
2854
|
const nowFormat = getTimeFormatFull(language);
|
|
2750
|
-
return /* @__PURE__ */
|
|
2855
|
+
return /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "flex flex-col h-full min-h-0 bg-background border-[0.5px] border-border/50 rounded-2xl overflow-hidden shadow-sm" }, /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "px-6 py-4 border-b-[0.5px] border-border/50 bg-gradient-to-r from-muted/20 via-background to-muted/20 text-center shrink-0" }, /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "flex items-center justify-center gap-3" }, /* @__PURE__ */ React18__namespace.default.createElement("h2", { className: "text-xl font-semibold capitalize text-foreground" }, dateFns.format(currentDate, "EEEE, MMMM d, yyyy", { locale })), dateFns.isToday(currentDate) && /* @__PURE__ */ React18__namespace.default.createElement("span", { className: "text-xs font-semibold bg-primary text-primary-foreground px-3 py-1 rounded-full shadow-md shadow-primary/20" }, "Today"))), /* @__PURE__ */ React18__namespace.default.createElement("div", { ref: scrollContainerRef, className: "flex-1 min-h-0 overflow-y-auto relative" }, /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "flex relative", style: { height: hours.length * hourHeight } }, /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "w-20 bg-muted/5 border-r-[0.5px] border-border/30 relative" }, hours.map((hour) => /* @__PURE__ */ React18__namespace.default.createElement(
|
|
2751
2856
|
"div",
|
|
2752
2857
|
{
|
|
2753
2858
|
key: hour,
|
|
2754
2859
|
className: "relative w-full",
|
|
2755
2860
|
style: { height: hourHeight }
|
|
2756
2861
|
},
|
|
2757
|
-
hour !== 0 && /* @__PURE__ */
|
|
2758
|
-
)), dateFns.isToday(currentDate) && /* @__PURE__ */
|
|
2862
|
+
hour !== 0 && /* @__PURE__ */ React18__namespace.default.createElement("span", { className: "absolute w-full text-center -top-3 left-1/2 -translate-x-1/2 text-[11px] text-muted-foreground/80 font-medium tabular-nums bg-background px-1.5 py-0.5 rounded-md" }, dateFns.format((/* @__PURE__ */ new Date()).setHours(hour, 0, 0, 0), timeFormat, { locale }))
|
|
2863
|
+
)), dateFns.isToday(currentDate) && /* @__PURE__ */ React18__namespace.default.createElement(
|
|
2759
2864
|
"div",
|
|
2760
2865
|
{
|
|
2761
2866
|
className: "absolute left-0 w-full pointer-events-none z-30 flex justify-end pr-2",
|
|
@@ -2763,9 +2868,9 @@ var DayView = ({
|
|
|
2763
2868
|
top: reverseTime ? `${(1440 - (zonedNow.getHours() * 60 + zonedNow.getMinutes())) / 60 * hourHeight}px` : `${(zonedNow.getHours() * 60 + zonedNow.getMinutes()) / 60 * hourHeight}px`
|
|
2764
2869
|
}
|
|
2765
2870
|
},
|
|
2766
|
-
/* @__PURE__ */
|
|
2767
|
-
)), /* @__PURE__ */
|
|
2768
|
-
return /* @__PURE__ */
|
|
2871
|
+
/* @__PURE__ */ React18__namespace.default.createElement("span", { className: "text-[10px] font-bold text-white bg-primary px-2 py-1 rounded-lg shadow-md shadow-primary/30 -translate-y-1/2" }, dateFns.format(zonedNow, nowFormat, { locale }))
|
|
2872
|
+
)), /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "flex-1 relative" }, hours.map((hour) => {
|
|
2873
|
+
return /* @__PURE__ */ React18__namespace.default.createElement(
|
|
2769
2874
|
"div",
|
|
2770
2875
|
{
|
|
2771
2876
|
key: hour,
|
|
@@ -2776,7 +2881,7 @@ var DayView = ({
|
|
|
2776
2881
|
const cellDate = new Date(currentDate);
|
|
2777
2882
|
cellDate.setHours(hour, minute, 0, 0);
|
|
2778
2883
|
const cellId = cellDate.toISOString();
|
|
2779
|
-
return /* @__PURE__ */
|
|
2884
|
+
return /* @__PURE__ */ React18__namespace.default.createElement(
|
|
2780
2885
|
DroppableCell,
|
|
2781
2886
|
{
|
|
2782
2887
|
key: minute,
|
|
@@ -2788,7 +2893,7 @@ var DayView = ({
|
|
|
2788
2893
|
top: `${minute / 60 * 100}%`
|
|
2789
2894
|
}
|
|
2790
2895
|
},
|
|
2791
|
-
/* @__PURE__ */
|
|
2896
|
+
/* @__PURE__ */ React18__namespace.default.createElement(
|
|
2792
2897
|
"div",
|
|
2793
2898
|
{
|
|
2794
2899
|
className: "h-full w-full bg-transparent cursor-pointer",
|
|
@@ -2820,8 +2925,9 @@ var DayView = ({
|
|
|
2820
2925
|
const durationMinutes = dateFns.differenceInMinutes(zonedEnd, zonedStart);
|
|
2821
2926
|
const height = durationMinutes / 60 * hourHeight;
|
|
2822
2927
|
const top = reverseTime ? (1440 - startMinutes - durationMinutes) / 60 * hourHeight : startMinutes / 60 * hourHeight;
|
|
2823
|
-
const isShortEvent = durationMinutes < 45;
|
|
2824
|
-
|
|
2928
|
+
const isShortEvent = compactShortEvents && durationMinutes < 45;
|
|
2929
|
+
const timeRange = `${dateFns.format(zonedStart, eventTimeFormat, { locale })} - ${dateFns.format(zonedEnd, eventTimeFormat, { locale })}`;
|
|
2930
|
+
return /* @__PURE__ */ React18__namespace.default.createElement(
|
|
2825
2931
|
DraggableEvent,
|
|
2826
2932
|
{
|
|
2827
2933
|
key: `${event.id}-${currentDate.toISOString()}`,
|
|
@@ -2835,7 +2941,7 @@ var DayView = ({
|
|
|
2835
2941
|
paddingRight: count > 1 ? "2px" : "0"
|
|
2836
2942
|
}
|
|
2837
2943
|
},
|
|
2838
|
-
/* @__PURE__ */
|
|
2944
|
+
/* @__PURE__ */ React18__namespace.default.createElement(
|
|
2839
2945
|
ResizableEvent,
|
|
2840
2946
|
{
|
|
2841
2947
|
readonly,
|
|
@@ -2845,38 +2951,46 @@ var DayView = ({
|
|
|
2845
2951
|
className: "h-full",
|
|
2846
2952
|
style: { height: "100%" }
|
|
2847
2953
|
},
|
|
2848
|
-
/* @__PURE__ */
|
|
2849
|
-
|
|
2954
|
+
/* @__PURE__ */ React18__namespace.default.createElement(
|
|
2955
|
+
EventHoverPopover,
|
|
2850
2956
|
{
|
|
2851
|
-
|
|
2852
|
-
|
|
2853
|
-
|
|
2854
|
-
readonly ? "cursor-default" : "cursor-grab active:cursor-grabbing",
|
|
2855
|
-
!event.color && "bg-primary/10 border-primary/20",
|
|
2856
|
-
isShortEvent ? "px-2 flex items-center" : "px-3 py-2",
|
|
2857
|
-
count > 1 && "border-l-4"
|
|
2858
|
-
),
|
|
2859
|
-
style: {
|
|
2860
|
-
backgroundColor: event.color ? `${event.color}15` : void 0,
|
|
2861
|
-
borderColor: event.color ? `${event.color}30` : void 0,
|
|
2862
|
-
borderLeftColor: event.color || "var(--primary)",
|
|
2863
|
-
borderLeftWidth: count > 1 ? "4px" : "3px"
|
|
2864
|
-
},
|
|
2865
|
-
onClick: (e) => {
|
|
2866
|
-
e.stopPropagation();
|
|
2867
|
-
onEventClick?.(event);
|
|
2868
|
-
},
|
|
2869
|
-
title: count > 1 ? `${event.title} (${index + 1}/${count})` : void 0
|
|
2957
|
+
enabled: isShortEvent,
|
|
2958
|
+
event,
|
|
2959
|
+
timeRange
|
|
2870
2960
|
},
|
|
2871
|
-
/* @__PURE__ */
|
|
2872
|
-
"
|
|
2873
|
-
|
|
2874
|
-
|
|
2875
|
-
|
|
2961
|
+
/* @__PURE__ */ React18__namespace.default.createElement(
|
|
2962
|
+
"div",
|
|
2963
|
+
{
|
|
2964
|
+
className: cn(
|
|
2965
|
+
"h-full rounded-lg border-[0.5px] shadow-sm overflow-hidden transition-all hover:shadow-lg hover:z-20 group",
|
|
2966
|
+
"glass backdrop-blur-sm",
|
|
2967
|
+
readonly ? "cursor-default" : "cursor-grab active:cursor-grabbing",
|
|
2968
|
+
!event.color && "bg-primary/10 border-primary/20",
|
|
2969
|
+
isShortEvent ? "px-2 flex items-center" : "px-3 py-2",
|
|
2970
|
+
count > 1 && "border-l-4"
|
|
2971
|
+
),
|
|
2972
|
+
style: {
|
|
2973
|
+
backgroundColor: event.color ? `${event.color}15` : void 0,
|
|
2974
|
+
borderColor: event.color ? `${event.color}30` : void 0,
|
|
2975
|
+
borderLeftColor: event.color || "var(--primary)",
|
|
2976
|
+
borderLeftWidth: count > 1 ? "4px" : "3px"
|
|
2977
|
+
},
|
|
2978
|
+
onClick: (e) => {
|
|
2979
|
+
e.stopPropagation();
|
|
2980
|
+
onEventClick?.(event);
|
|
2981
|
+
},
|
|
2982
|
+
title: !isShortEvent && count > 1 ? `${event.title} (${index + 1}/${count})` : void 0
|
|
2983
|
+
},
|
|
2984
|
+
/* @__PURE__ */ React18__namespace.default.createElement("div", { className: "flex flex-col h-full overflow-hidden w-full" }, /* @__PURE__ */ React18__namespace.default.createElement("div", { className: cn(
|
|
2985
|
+
"font-semibold truncate leading-tight",
|
|
2986
|
+
isShortEvent ? "text-xs" : "text-sm",
|
|
2987
|
+
event.color ? "text-foreground" : "text-foreground/90"
|
|
2988
|
+
) }, event.title), !isShortEvent && /* @__PURE__ */ React18__namespace.default.createElement(React18__namespace.default.Fragment, null, /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "text-xs text-muted-foreground mt-0.5 font-medium" }, timeRange), event.description && height > 60 && /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "text-xs text-muted-foreground/80 mt-1 line-clamp-2" }, event.description)), count > 1 && !isShortEvent && /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "absolute top-1.5 right-1.5 bg-background/90 backdrop-blur-sm rounded-full w-5 h-5 flex items-center justify-center text-[10px] font-bold text-muted-foreground border border-border shadow-sm" }, count))
|
|
2989
|
+
)
|
|
2876
2990
|
)
|
|
2877
2991
|
)
|
|
2878
2992
|
);
|
|
2879
|
-
}), dateFns.isToday(currentDate) && /* @__PURE__ */
|
|
2993
|
+
}), dateFns.isToday(currentDate) && /* @__PURE__ */ React18__namespace.default.createElement(
|
|
2880
2994
|
"div",
|
|
2881
2995
|
{
|
|
2882
2996
|
className: "absolute left-0 right-0 z-20 pointer-events-none flex items-center",
|
|
@@ -2884,17 +2998,17 @@ var DayView = ({
|
|
|
2884
2998
|
top: reverseTime ? `${(1440 - (zonedNow.getHours() * 60 + zonedNow.getMinutes())) / 60 * hourHeight}px` : `${(zonedNow.getHours() * 60 + zonedNow.getMinutes()) / 60 * hourHeight}px`
|
|
2885
2999
|
}
|
|
2886
3000
|
},
|
|
2887
|
-
/* @__PURE__ */
|
|
2888
|
-
/* @__PURE__ */
|
|
3001
|
+
/* @__PURE__ */ React18__namespace.default.createElement("div", { className: "h-[2px] w-full bg-gradient-to-r from-primary via-primary to-primary/50" }),
|
|
3002
|
+
/* @__PURE__ */ React18__namespace.default.createElement("div", { className: "absolute -left-1.5 w-3 h-3 bg-primary rounded-full shadow-lg shadow-primary/40 ring-2 ring-background animate-pulse" })
|
|
2889
3003
|
)))));
|
|
2890
3004
|
};
|
|
2891
|
-
var AgendaEmptyState = ({ onCreateEvent, translations }) => /* @__PURE__ */
|
|
3005
|
+
var AgendaEmptyState = ({ onCreateEvent, translations }) => /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "flex flex-col items-center justify-center h-full min-h-[400px] py-12" }, /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "relative mb-8" }, /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "p-8 bg-gradient-to-br from-green-50 to-blue-50 dark:from-green-900/10 dark:to-blue-900/10 rounded-3xl border border-border/30" }, /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "flex items-center gap-4" }, /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "w-12 h-12 rounded-2xl bg-green-100 dark:bg-green-900/30 flex items-center justify-center" }, /* @__PURE__ */ React18__namespace.default.createElement("svg", { className: "w-6 h-6 text-green-600 dark:text-green-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2 }, /* @__PURE__ */ React18__namespace.default.createElement("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" }))), /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "text-left" }, /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "font-medium text-foreground" }, "All caught up!"), /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "text-sm text-muted-foreground" }, "No events scheduled"))))), /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "text-center max-w-sm" }, /* @__PURE__ */ React18__namespace.default.createElement("h3", { className: "text-lg font-semibold text-foreground mb-2" }, translations?.noUpcoming || "Your schedule is clear"), /* @__PURE__ */ React18__namespace.default.createElement("p", { className: "text-sm text-muted-foreground mb-6" }, "No upcoming events to show. Create a new event to start planning."), onCreateEvent && /* @__PURE__ */ React18__namespace.default.createElement(
|
|
2892
3006
|
"button",
|
|
2893
3007
|
{
|
|
2894
3008
|
onClick: onCreateEvent,
|
|
2895
3009
|
className: "inline-flex items-center gap-2 px-5 py-2.5 bg-primary text-primary-foreground rounded-xl font-medium text-sm shadow-lg shadow-primary/20 hover:shadow-xl hover:shadow-primary/30 hover:scale-105 active:scale-95 transition-all duration-200"
|
|
2896
3010
|
},
|
|
2897
|
-
/* @__PURE__ */
|
|
3011
|
+
/* @__PURE__ */ React18__namespace.default.createElement(lucideReact.Plus, { className: "w-4 h-4" }),
|
|
2898
3012
|
translations?.createEvent || "Create Event"
|
|
2899
3013
|
)));
|
|
2900
3014
|
var formatDuration = (start, end) => {
|
|
@@ -2920,7 +3034,7 @@ var AgendaView = ({
|
|
|
2920
3034
|
renderEmptyState
|
|
2921
3035
|
}) => {
|
|
2922
3036
|
const timeFmt = getTimeFormatFull(language);
|
|
2923
|
-
const groupedEvents =
|
|
3037
|
+
const groupedEvents = React18.useMemo(() => {
|
|
2924
3038
|
const startDate = dateFns.startOfDay(currentDate);
|
|
2925
3039
|
const groups = [];
|
|
2926
3040
|
const sortedEvents = [...events].sort((a, b) => a.start.getTime() - b.start.getTime());
|
|
@@ -2946,7 +3060,7 @@ var AgendaView = ({
|
|
|
2946
3060
|
hidden: { opacity: 0, x: -20 },
|
|
2947
3061
|
show: { opacity: 1, x: 0 }
|
|
2948
3062
|
};
|
|
2949
|
-
return /* @__PURE__ */
|
|
3063
|
+
return /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "flex flex-col h-full min-h-0 bg-background overflow-y-auto" }, groupedEvents.length === 0 ? renderEmptyState ? renderEmptyState({ view: "agenda", onCreateEvent }) : /* @__PURE__ */ React18__namespace.default.createElement(AgendaEmptyState, { onCreateEvent }) : /* @__PURE__ */ React18__namespace.default.createElement(
|
|
2950
3064
|
framerMotion.motion.div,
|
|
2951
3065
|
{
|
|
2952
3066
|
className: "max-w-3xl mx-auto w-full pb-10 px-4 md:px-6",
|
|
@@ -2954,21 +3068,21 @@ var AgendaView = ({
|
|
|
2954
3068
|
initial: "hidden",
|
|
2955
3069
|
animate: "show"
|
|
2956
3070
|
},
|
|
2957
|
-
groupedEvents.map((group, groupIndex) => /* @__PURE__ */
|
|
3071
|
+
groupedEvents.map((group, groupIndex) => /* @__PURE__ */ React18__namespace.default.createElement(
|
|
2958
3072
|
framerMotion.motion.div,
|
|
2959
3073
|
{
|
|
2960
3074
|
key: group.date.toISOString(),
|
|
2961
3075
|
className: "relative",
|
|
2962
3076
|
variants: item
|
|
2963
3077
|
},
|
|
2964
|
-
/* @__PURE__ */
|
|
3078
|
+
/* @__PURE__ */ React18__namespace.default.createElement("div", { className: "sticky top-0 bg-background/95 backdrop-blur-md py-4 z-10 border-b border-border/50" }, /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "flex items-center gap-4" }, /* @__PURE__ */ React18__namespace.default.createElement("div", { className: cn(
|
|
2965
3079
|
"flex flex-col items-center justify-center w-16 h-16 rounded-2xl transition-all",
|
|
2966
3080
|
dateFns.isToday(group.date) ? "bg-primary text-primary-foreground shadow-lg shadow-primary/30" : "bg-muted/50 text-foreground"
|
|
2967
|
-
) }, /* @__PURE__ */
|
|
3081
|
+
) }, /* @__PURE__ */ React18__namespace.default.createElement("span", { className: "text-2xl font-bold leading-none" }, dateFns.format(group.date, "d")), /* @__PURE__ */ React18__namespace.default.createElement("span", { className: "text-xs font-medium uppercase tracking-wide opacity-80" }, dateFns.format(group.date, "MMM"))), /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "flex flex-col" }, /* @__PURE__ */ React18__namespace.default.createElement("span", { className: cn(
|
|
2968
3082
|
"text-lg font-semibold",
|
|
2969
3083
|
dateFns.isToday(group.date) && "text-primary"
|
|
2970
|
-
) }, getDateLabel(group.date, translations?.today ?? "Today", translations?.tomorrow ?? "Tomorrow")), /* @__PURE__ */
|
|
2971
|
-
/* @__PURE__ */
|
|
3084
|
+
) }, getDateLabel(group.date, translations?.today ?? "Today", translations?.tomorrow ?? "Tomorrow")), /* @__PURE__ */ React18__namespace.default.createElement("span", { className: "text-sm text-muted-foreground" }, group.events.length, " ", group.events.length !== 1 ? translations?.eventsCount ?? "events" : translations?.eventCount ?? "event")))),
|
|
3085
|
+
/* @__PURE__ */ React18__namespace.default.createElement("div", { className: "py-4 space-y-3" }, group.events.map((event, eventIndex) => /* @__PURE__ */ React18__namespace.default.createElement(
|
|
2972
3086
|
framerMotion.motion.div,
|
|
2973
3087
|
{
|
|
2974
3088
|
key: event.id,
|
|
@@ -2982,22 +3096,22 @@ var AgendaView = ({
|
|
|
2982
3096
|
whileHover: { scale: 1.01, y: -2 },
|
|
2983
3097
|
transition: { duration: 0.2 }
|
|
2984
3098
|
},
|
|
2985
|
-
/* @__PURE__ */
|
|
3099
|
+
/* @__PURE__ */ React18__namespace.default.createElement(
|
|
2986
3100
|
"div",
|
|
2987
3101
|
{
|
|
2988
3102
|
className: "absolute left-0 top-3 bottom-3 w-1 rounded-full",
|
|
2989
3103
|
style: { backgroundColor: event.color || "var(--primary)" }
|
|
2990
3104
|
}
|
|
2991
3105
|
),
|
|
2992
|
-
/* @__PURE__ */
|
|
2993
|
-
/* @__PURE__ */
|
|
3106
|
+
/* @__PURE__ */ React18__namespace.default.createElement("div", { className: "flex flex-col items-center min-w-[70px] pl-2" }, event.allDay ? /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "flex flex-col items-center" }, /* @__PURE__ */ React18__namespace.default.createElement("span", { className: "text-xs font-semibold text-muted-foreground bg-muted/80 px-2.5 py-1 rounded-full" }, translations?.allDay ?? "All Day")) : /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "flex flex-col items-center" }, /* @__PURE__ */ React18__namespace.default.createElement("span", { className: "text-base font-semibold text-foreground" }, dateFns.format(event.start, timeFmt)), /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "w-px h-3 bg-border my-1" }), /* @__PURE__ */ React18__namespace.default.createElement("span", { className: "text-xs text-muted-foreground/70 font-medium" }, formatDuration(event.start, event.end)))),
|
|
3107
|
+
/* @__PURE__ */ React18__namespace.default.createElement("div", { className: "flex-1 min-w-0 space-y-2" }, /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "flex items-start justify-between gap-2" }, /* @__PURE__ */ React18__namespace.default.createElement("h4", { className: "text-base font-semibold text-foreground group-hover:text-primary transition-colors line-clamp-1" }, event.title), /* @__PURE__ */ React18__namespace.default.createElement(
|
|
2994
3108
|
"div",
|
|
2995
3109
|
{
|
|
2996
3110
|
className: "w-3 h-3 rounded-full shrink-0 mt-1.5",
|
|
2997
3111
|
style: { backgroundColor: event.color || "var(--primary)" }
|
|
2998
3112
|
}
|
|
2999
|
-
)), event.description && /* @__PURE__ */
|
|
3000
|
-
/* @__PURE__ */
|
|
3113
|
+
)), event.description && /* @__PURE__ */ React18__namespace.default.createElement("p", { className: "text-sm text-muted-foreground line-clamp-2 leading-relaxed" }, event.description), /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "flex flex-wrap items-center gap-3 pt-1" }, !event.allDay && /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "flex items-center gap-1.5 text-xs text-muted-foreground" }, /* @__PURE__ */ React18__namespace.default.createElement(lucideReact.Clock, { className: "w-3.5 h-3.5" }), /* @__PURE__ */ React18__namespace.default.createElement("span", null, dateFns.format(event.start, timeFmt), " - ", dateFns.format(event.end, timeFmt))), event.guests && event.guests.length > 0 && /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "flex items-center gap-1.5 text-xs text-muted-foreground" }, /* @__PURE__ */ React18__namespace.default.createElement(lucideReact.Users, { className: "w-3.5 h-3.5" }), /* @__PURE__ */ React18__namespace.default.createElement("span", null, event.guests.length, " ", event.guests.length !== 1 ? translations?.guestsCount ?? "guests" : translations?.guestCount ?? "guest")), event.attachments && event.attachments.length > 0 && /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "flex items-center gap-1.5 text-xs text-muted-foreground" }, /* @__PURE__ */ React18__namespace.default.createElement(lucideReact.Paperclip, { className: "w-3.5 h-3.5" }), /* @__PURE__ */ React18__namespace.default.createElement("span", null, event.attachments.length)), event.reminders && event.reminders.length > 0 && /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "flex items-center gap-1.5 text-xs text-muted-foreground" }, /* @__PURE__ */ React18__namespace.default.createElement(lucideReact.Bell, { className: "w-3.5 h-3.5" }), /* @__PURE__ */ React18__namespace.default.createElement("span", null, event.reminders.length)))),
|
|
3114
|
+
/* @__PURE__ */ React18__namespace.default.createElement("div", { className: "absolute right-4 top-1/2 -translate-y-1/2 opacity-0 group-hover:opacity-100 transition-opacity" }, /* @__PURE__ */ React18__namespace.default.createElement("svg", { className: "w-5 h-5 text-muted-foreground", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2" }, /* @__PURE__ */ React18__namespace.default.createElement("path", { d: "M9 18l6-6-6-6" })))
|
|
3001
3115
|
)))
|
|
3002
3116
|
))
|
|
3003
3117
|
));
|
|
@@ -3011,7 +3125,7 @@ var ResourceView = ({
|
|
|
3011
3125
|
locale,
|
|
3012
3126
|
language = "tr"
|
|
3013
3127
|
}) => {
|
|
3014
|
-
const containerRef =
|
|
3128
|
+
const containerRef = React18.useRef(null);
|
|
3015
3129
|
const hours = Array.from({ length: 24 }, (_, i) => i);
|
|
3016
3130
|
const hourWidth = 100;
|
|
3017
3131
|
const timeFormat = getTimeFormat(language);
|
|
@@ -3029,7 +3143,7 @@ var ResourceView = ({
|
|
|
3029
3143
|
// Min width for visibility
|
|
3030
3144
|
};
|
|
3031
3145
|
};
|
|
3032
|
-
return /* @__PURE__ */
|
|
3146
|
+
return /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "flex flex-col h-full min-h-0 bg-background overflow-hidden" }, /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "flex border-b border-border bg-muted/20" }, /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "w-48 shrink-0 border-r border-border p-4 font-semibold text-sm bg-background sticky left-0 z-20" }, "Resources"), /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "flex overflow-hidden" }, /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "flex relative", style: { width: hours.length * hourWidth } }, hours.map((hour) => /* @__PURE__ */ React18__namespace.default.createElement(
|
|
3033
3147
|
"div",
|
|
3034
3148
|
{
|
|
3035
3149
|
key: hour,
|
|
@@ -3037,11 +3151,11 @@ var ResourceView = ({
|
|
|
3037
3151
|
style: { width: hourWidth }
|
|
3038
3152
|
},
|
|
3039
3153
|
dateFns.format((/* @__PURE__ */ new Date()).setHours(hour, 0, 0, 0), timeFormat, { locale })
|
|
3040
|
-
))))), /* @__PURE__ */
|
|
3154
|
+
))))), /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "flex-1 min-h-0 overflow-auto relative", ref: containerRef }, /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "min-w-fit" }, resources.map((resource) => {
|
|
3041
3155
|
const resourceEvents = events.filter(
|
|
3042
3156
|
(e) => e.resourceId === resource.id && dateFns.isSameDay(new Date(e.start), currentDate)
|
|
3043
3157
|
);
|
|
3044
|
-
return /* @__PURE__ */
|
|
3158
|
+
return /* @__PURE__ */ React18__namespace.default.createElement("div", { key: resource.id, className: "flex border-b border-border min-h-[100px]" }, /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "w-48 shrink-0 border-r border-border p-4 bg-background sticky left-0 z-10 flex items-center gap-3" }, resource.avatar ? /* @__PURE__ */ React18__namespace.default.createElement("img", { src: resource.avatar, alt: resource.label, className: "w-8 h-8 rounded-full object-cover" }) : /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "w-8 h-8 rounded-full bg-primary/10 flex items-center justify-center text-xs font-bold text-primary" }, resource.label.substring(0, 2).toUpperCase()), /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "flex flex-col" }, /* @__PURE__ */ React18__namespace.default.createElement("span", { className: "text-sm font-medium" }, resource.label), /* @__PURE__ */ React18__namespace.default.createElement("span", { className: "text-xs text-muted-foreground" }, "ID: ", resource.id))), /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "relative flex", style: { width: hours.length * hourWidth } }, hours.map((hour) => /* @__PURE__ */ React18__namespace.default.createElement(
|
|
3045
3159
|
"div",
|
|
3046
3160
|
{
|
|
3047
3161
|
key: hour,
|
|
@@ -3052,7 +3166,7 @@ var ResourceView = ({
|
|
|
3052
3166
|
const slotDate = new Date(currentDate);
|
|
3053
3167
|
slotDate.setHours(hour, minute, 0, 0);
|
|
3054
3168
|
const slotId = `${resource.id}-${slotDate.toISOString()}`;
|
|
3055
|
-
return /* @__PURE__ */
|
|
3169
|
+
return /* @__PURE__ */ React18__namespace.default.createElement(
|
|
3056
3170
|
DroppableCell,
|
|
3057
3171
|
{
|
|
3058
3172
|
key: minute,
|
|
@@ -3066,7 +3180,7 @@ var ResourceView = ({
|
|
|
3066
3180
|
}
|
|
3067
3181
|
);
|
|
3068
3182
|
})
|
|
3069
|
-
)), resourceEvents.map((event) => /* @__PURE__ */
|
|
3183
|
+
)), resourceEvents.map((event) => /* @__PURE__ */ React18__namespace.default.createElement(
|
|
3070
3184
|
DraggableEvent,
|
|
3071
3185
|
{
|
|
3072
3186
|
key: event.id,
|
|
@@ -3083,7 +3197,7 @@ var ResourceView = ({
|
|
|
3083
3197
|
color: "#fff"
|
|
3084
3198
|
}
|
|
3085
3199
|
},
|
|
3086
|
-
/* @__PURE__ */
|
|
3200
|
+
/* @__PURE__ */ React18__namespace.default.createElement("div", { className: "truncate" }, event.title)
|
|
3087
3201
|
))));
|
|
3088
3202
|
}))));
|
|
3089
3203
|
};
|
|
@@ -3095,8 +3209,8 @@ var Modal = ({
|
|
|
3095
3209
|
className,
|
|
3096
3210
|
hideHeader = false
|
|
3097
3211
|
}) => {
|
|
3098
|
-
const overlayRef =
|
|
3099
|
-
|
|
3212
|
+
const overlayRef = React18.useRef(null);
|
|
3213
|
+
React18.useEffect(() => {
|
|
3100
3214
|
const handleEscape = (e) => {
|
|
3101
3215
|
if (e.key === "Escape") {
|
|
3102
3216
|
onClose();
|
|
@@ -3110,14 +3224,14 @@ var Modal = ({
|
|
|
3110
3224
|
};
|
|
3111
3225
|
}, [isOpen, onClose]);
|
|
3112
3226
|
if (!isOpen) return null;
|
|
3113
|
-
return /* @__PURE__ */
|
|
3227
|
+
return /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "absolute inset-0 z-50 flex items-center justify-center p-4 bg-black/40 backdrop-blur-md animate-in fade-in duration-300" }, /* @__PURE__ */ React18__namespace.default.createElement(
|
|
3114
3228
|
"div",
|
|
3115
3229
|
{
|
|
3116
3230
|
ref: overlayRef,
|
|
3117
3231
|
className: "absolute inset-0",
|
|
3118
3232
|
onClick: onClose
|
|
3119
3233
|
}
|
|
3120
|
-
), /* @__PURE__ */
|
|
3234
|
+
), /* @__PURE__ */ React18__namespace.default.createElement(
|
|
3121
3235
|
"div",
|
|
3122
3236
|
{
|
|
3123
3237
|
className: cn(
|
|
@@ -3125,7 +3239,7 @@ var Modal = ({
|
|
|
3125
3239
|
className
|
|
3126
3240
|
)
|
|
3127
3241
|
},
|
|
3128
|
-
!hideHeader && /* @__PURE__ */
|
|
3242
|
+
!hideHeader && /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "flex items-center justify-between px-6 py-4 border-b border-border/50 shrink-0 bg-gradient-to-r from-muted/20 to-background" }, /* @__PURE__ */ React18__namespace.default.createElement("h3", { className: "text-lg font-semibold text-foreground" }, title), /* @__PURE__ */ React18__namespace.default.createElement(
|
|
3129
3243
|
Button,
|
|
3130
3244
|
{
|
|
3131
3245
|
variant: "ghost",
|
|
@@ -3133,10 +3247,10 @@ var Modal = ({
|
|
|
3133
3247
|
onClick: onClose,
|
|
3134
3248
|
className: "h-9 w-9 p-0 rounded-xl hover:bg-accent/80 transition-all duration-200"
|
|
3135
3249
|
},
|
|
3136
|
-
/* @__PURE__ */
|
|
3137
|
-
/* @__PURE__ */
|
|
3250
|
+
/* @__PURE__ */ React18__namespace.default.createElement(lucideReact.X, { className: "h-4 w-4" }),
|
|
3251
|
+
/* @__PURE__ */ React18__namespace.default.createElement("span", { className: "sr-only" }, "Close")
|
|
3138
3252
|
)),
|
|
3139
|
-
/* @__PURE__ */
|
|
3253
|
+
/* @__PURE__ */ React18__namespace.default.createElement("div", { className: cn("overflow-y-auto flex-1", !hideHeader && "p-6") }, children)
|
|
3140
3254
|
));
|
|
3141
3255
|
};
|
|
3142
3256
|
var COLOR_PALETTE = [
|
|
@@ -3186,9 +3300,9 @@ var EventModal = ({
|
|
|
3186
3300
|
language = "tr"
|
|
3187
3301
|
}) => {
|
|
3188
3302
|
const timeFmt = getTimeFormatFull(language);
|
|
3189
|
-
const [mode, setMode] =
|
|
3190
|
-
const [activeTab, setActiveTab] =
|
|
3191
|
-
const [formData, setFormData] =
|
|
3303
|
+
const [mode, setMode] = React18.useState("create");
|
|
3304
|
+
const [activeTab, setActiveTab] = React18.useState("details");
|
|
3305
|
+
const [formData, setFormData] = React18.useState({
|
|
3192
3306
|
title: "",
|
|
3193
3307
|
description: "",
|
|
3194
3308
|
location: "",
|
|
@@ -3202,10 +3316,10 @@ var EventModal = ({
|
|
|
3202
3316
|
attachments: [],
|
|
3203
3317
|
reminders: [{ id: "1", type: "notification", time: 30, label: "30 minutes before" }]
|
|
3204
3318
|
});
|
|
3205
|
-
const [isCalendarDropdownOpen, setIsCalendarDropdownOpen] =
|
|
3206
|
-
const [isColorPickerOpen, setIsColorPickerOpen] =
|
|
3207
|
-
const [isReminderDropdownOpen, setIsReminderDropdownOpen] =
|
|
3208
|
-
const [isGuestsDropdownOpen, setIsGuestsDropdownOpen] =
|
|
3319
|
+
const [isCalendarDropdownOpen, setIsCalendarDropdownOpen] = React18.useState(false);
|
|
3320
|
+
const [isColorPickerOpen, setIsColorPickerOpen] = React18.useState(false);
|
|
3321
|
+
const [isReminderDropdownOpen, setIsReminderDropdownOpen] = React18.useState(false);
|
|
3322
|
+
const [isGuestsDropdownOpen, setIsGuestsDropdownOpen] = React18.useState(false);
|
|
3209
3323
|
const fakeGuests = [
|
|
3210
3324
|
"alice@example.com",
|
|
3211
3325
|
"bob@example.com",
|
|
@@ -3213,9 +3327,9 @@ var EventModal = ({
|
|
|
3213
3327
|
"diana@example.com",
|
|
3214
3328
|
"evan@example.com"
|
|
3215
3329
|
];
|
|
3216
|
-
|
|
3217
|
-
const [selectedGuests, setSelectedGuests] =
|
|
3218
|
-
|
|
3330
|
+
React18.useRef(null);
|
|
3331
|
+
const [selectedGuests, setSelectedGuests] = React18.useState([]);
|
|
3332
|
+
React18.useEffect(() => {
|
|
3219
3333
|
if (isOpen) {
|
|
3220
3334
|
if (event) {
|
|
3221
3335
|
setMode("view");
|
|
@@ -3337,7 +3451,7 @@ var EventModal = ({
|
|
|
3337
3451
|
if (remainingMins === 0) return `${hours} hr`;
|
|
3338
3452
|
return `${hours} hr ${remainingMins} min`;
|
|
3339
3453
|
};
|
|
3340
|
-
const renderViewMode = () => /* @__PURE__ */
|
|
3454
|
+
const renderViewMode = () => /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "flex flex-col bg-background overflow-hidden w-full max-h-[90vh]" }, /* @__PURE__ */ React18__namespace.default.createElement(
|
|
3341
3455
|
"div",
|
|
3342
3456
|
{
|
|
3343
3457
|
className: "relative px-6 pt-6 pb-8",
|
|
@@ -3345,50 +3459,50 @@ var EventModal = ({
|
|
|
3345
3459
|
background: `linear-gradient(135deg, ${event?.color || "#3b82f6"}15 0%, transparent 100%)`
|
|
3346
3460
|
}
|
|
3347
3461
|
},
|
|
3348
|
-
/* @__PURE__ */
|
|
3462
|
+
/* @__PURE__ */ React18__namespace.default.createElement("div", { className: "flex items-center justify-between mb-6" }, /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "flex items-center gap-2" }, /* @__PURE__ */ React18__namespace.default.createElement(
|
|
3349
3463
|
"div",
|
|
3350
3464
|
{
|
|
3351
3465
|
className: "w-3 h-3 rounded-full",
|
|
3352
3466
|
style: { backgroundColor: event?.color || "#3b82f6" }
|
|
3353
3467
|
}
|
|
3354
|
-
), /* @__PURE__ */
|
|
3468
|
+
), /* @__PURE__ */ React18__namespace.default.createElement("span", { className: "text-xs font-medium text-muted-foreground uppercase tracking-wider" }, calendars?.find((c) => c.id === event?.calendarId)?.label || "Event")), /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "flex items-center gap-1" }, /* @__PURE__ */ React18__namespace.default.createElement(
|
|
3355
3469
|
"button",
|
|
3356
3470
|
{
|
|
3357
3471
|
onClick: () => setMode("edit"),
|
|
3358
3472
|
className: "p-2 hover:bg-background/80 rounded-lg transition-all text-muted-foreground hover:text-foreground",
|
|
3359
3473
|
title: "Edit"
|
|
3360
3474
|
},
|
|
3361
|
-
/* @__PURE__ */
|
|
3362
|
-
), /* @__PURE__ */
|
|
3475
|
+
/* @__PURE__ */ React18__namespace.default.createElement(lucideReact.Edit2, { className: "w-4 h-4" })
|
|
3476
|
+
), /* @__PURE__ */ React18__namespace.default.createElement(
|
|
3363
3477
|
"button",
|
|
3364
3478
|
{
|
|
3365
3479
|
onClick: handleDelete,
|
|
3366
3480
|
className: "p-2 hover:bg-destructive/10 rounded-lg transition-all text-muted-foreground hover:text-destructive",
|
|
3367
3481
|
title: "Delete"
|
|
3368
3482
|
},
|
|
3369
|
-
/* @__PURE__ */
|
|
3370
|
-
), /* @__PURE__ */
|
|
3483
|
+
/* @__PURE__ */ React18__namespace.default.createElement(lucideReact.Trash2, { className: "w-4 h-4" })
|
|
3484
|
+
), /* @__PURE__ */ React18__namespace.default.createElement(
|
|
3371
3485
|
"button",
|
|
3372
3486
|
{
|
|
3373
3487
|
onClick: onClose,
|
|
3374
3488
|
className: "p-2 hover:bg-background/80 rounded-lg transition-all text-muted-foreground hover:text-foreground",
|
|
3375
3489
|
title: "Close"
|
|
3376
3490
|
},
|
|
3377
|
-
/* @__PURE__ */
|
|
3491
|
+
/* @__PURE__ */ React18__namespace.default.createElement(lucideReact.X, { className: "w-4 h-4" })
|
|
3378
3492
|
))),
|
|
3379
|
-
/* @__PURE__ */
|
|
3380
|
-
/* @__PURE__ */
|
|
3381
|
-
), /* @__PURE__ */
|
|
3493
|
+
/* @__PURE__ */ React18__namespace.default.createElement("h1", { className: "text-2xl font-bold text-foreground mb-3 leading-tight" }, event?.title || translations.noTitle),
|
|
3494
|
+
/* @__PURE__ */ React18__namespace.default.createElement("div", { className: "flex items-center gap-3 text-sm" }, /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "flex items-center gap-2 px-3 py-1.5 bg-background/60 backdrop-blur-sm rounded-lg border border-border/30" }, /* @__PURE__ */ React18__namespace.default.createElement(lucideReact.Calendar, { className: "w-4 h-4 text-muted-foreground" }), /* @__PURE__ */ React18__namespace.default.createElement("span", { className: "font-medium" }, event?.start && dateFns.format(new Date(event.start), "EEE, MMM d"))), /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "flex items-center gap-2 px-3 py-1.5 bg-background/60 backdrop-blur-sm rounded-lg border border-border/30" }, /* @__PURE__ */ React18__namespace.default.createElement(lucideReact.Clock, { className: "w-4 h-4 text-muted-foreground" }), /* @__PURE__ */ React18__namespace.default.createElement("span", { className: "font-medium" }, event?.start && dateFns.format(new Date(event.start), timeFmt), " \u2013 ", event?.end && dateFns.format(new Date(event.end), timeFmt))))
|
|
3495
|
+
), /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "px-6 pb-6 space-y-4 overflow-y-auto flex-1" }, event?.location && /* @__PURE__ */ React18__namespace.default.createElement(
|
|
3382
3496
|
framerMotion.motion.div,
|
|
3383
3497
|
{
|
|
3384
3498
|
initial: { opacity: 0, y: 10 },
|
|
3385
3499
|
animate: { opacity: 1, y: 0 },
|
|
3386
3500
|
className: "flex items-start gap-3 p-4 rounded-2xl bg-muted/30 border border-border/30 group hover:bg-muted/50 transition-all cursor-pointer"
|
|
3387
3501
|
},
|
|
3388
|
-
/* @__PURE__ */
|
|
3389
|
-
/* @__PURE__ */
|
|
3390
|
-
/* @__PURE__ */
|
|
3391
|
-
), event?.guests && event.guests.length > 0 && /* @__PURE__ */
|
|
3502
|
+
/* @__PURE__ */ React18__namespace.default.createElement("div", { className: "p-2 bg-primary/10 rounded-xl" }, /* @__PURE__ */ React18__namespace.default.createElement(lucideReact.MapPin, { className: "w-5 h-5 text-primary" })),
|
|
3503
|
+
/* @__PURE__ */ React18__namespace.default.createElement("div", { className: "flex-1" }, /* @__PURE__ */ React18__namespace.default.createElement("p", { className: "text-sm font-medium text-foreground" }, event.location), /* @__PURE__ */ React18__namespace.default.createElement("p", { className: "text-xs text-muted-foreground mt-0.5" }, translations.clickToOpenInMaps)),
|
|
3504
|
+
/* @__PURE__ */ React18__namespace.default.createElement(lucideReact.ExternalLink, { className: "w-4 h-4 text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity" })
|
|
3505
|
+
), event?.guests && event.guests.length > 0 && /* @__PURE__ */ React18__namespace.default.createElement(
|
|
3392
3506
|
framerMotion.motion.div,
|
|
3393
3507
|
{
|
|
3394
3508
|
initial: { opacity: 0, y: 10 },
|
|
@@ -3396,14 +3510,14 @@ var EventModal = ({
|
|
|
3396
3510
|
transition: { delay: 0.05 },
|
|
3397
3511
|
className: "space-y-3"
|
|
3398
3512
|
},
|
|
3399
|
-
/* @__PURE__ */
|
|
3400
|
-
/* @__PURE__ */
|
|
3513
|
+
/* @__PURE__ */ React18__namespace.default.createElement("div", { className: "flex items-center justify-between" }, /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "flex items-center gap-2" }, /* @__PURE__ */ React18__namespace.default.createElement(lucideReact.Users, { className: "w-4 h-4 text-muted-foreground" }), /* @__PURE__ */ React18__namespace.default.createElement("span", { className: "text-sm font-medium text-foreground" }, event.guests.length, " ", event.guests.length > 1 ? translations.guestsCount : translations.guestCount))),
|
|
3514
|
+
/* @__PURE__ */ React18__namespace.default.createElement("div", { className: "flex flex-wrap gap-2" }, event.guests.map((email, index) => /* @__PURE__ */ React18__namespace.default.createElement(
|
|
3401
3515
|
"div",
|
|
3402
3516
|
{
|
|
3403
3517
|
key: index,
|
|
3404
3518
|
className: "flex items-center gap-2 px-3 py-2 rounded-xl bg-muted/30 border border-border/30 hover:bg-muted/50 transition-all cursor-pointer group"
|
|
3405
3519
|
},
|
|
3406
|
-
/* @__PURE__ */
|
|
3520
|
+
/* @__PURE__ */ React18__namespace.default.createElement(
|
|
3407
3521
|
"div",
|
|
3408
3522
|
{
|
|
3409
3523
|
className: "w-8 h-8 rounded-full flex items-center justify-center text-sm font-semibold text-white",
|
|
@@ -3411,9 +3525,9 @@ var EventModal = ({
|
|
|
3411
3525
|
},
|
|
3412
3526
|
email[0].toUpperCase()
|
|
3413
3527
|
),
|
|
3414
|
-
/* @__PURE__ */
|
|
3528
|
+
/* @__PURE__ */ React18__namespace.default.createElement("div", { className: "flex-1 min-w-0" }, /* @__PURE__ */ React18__namespace.default.createElement("p", { className: "text-sm font-medium text-foreground" }, email.split("@")[0]), /* @__PURE__ */ React18__namespace.default.createElement("p", { className: "text-xs text-muted-foreground truncate" }, email))
|
|
3415
3529
|
)))
|
|
3416
|
-
), event?.reminders && event.reminders.length > 0 && /* @__PURE__ */
|
|
3530
|
+
), event?.reminders && event.reminders.length > 0 && /* @__PURE__ */ React18__namespace.default.createElement(
|
|
3417
3531
|
framerMotion.motion.div,
|
|
3418
3532
|
{
|
|
3419
3533
|
initial: { opacity: 0, y: 10 },
|
|
@@ -3421,8 +3535,8 @@ var EventModal = ({
|
|
|
3421
3535
|
transition: { delay: 0.1 },
|
|
3422
3536
|
className: "flex items-center gap-3"
|
|
3423
3537
|
},
|
|
3424
|
-
/* @__PURE__ */
|
|
3425
|
-
/* @__PURE__ */
|
|
3538
|
+
/* @__PURE__ */ React18__namespace.default.createElement("div", { className: "p-2 bg-amber-500/10 rounded-xl" }, /* @__PURE__ */ React18__namespace.default.createElement(lucideReact.Bell, { className: "w-4 h-4 text-amber-500" })),
|
|
3539
|
+
/* @__PURE__ */ React18__namespace.default.createElement("div", { className: "flex flex-wrap gap-2" }, event.reminders.map((reminder) => /* @__PURE__ */ React18__namespace.default.createElement(
|
|
3426
3540
|
"span",
|
|
3427
3541
|
{
|
|
3428
3542
|
key: reminder.id,
|
|
@@ -3430,7 +3544,7 @@ var EventModal = ({
|
|
|
3430
3544
|
},
|
|
3431
3545
|
reminder.label || `${reminder.time} min before`
|
|
3432
3546
|
)))
|
|
3433
|
-
), event?.description && /* @__PURE__ */
|
|
3547
|
+
), event?.description && /* @__PURE__ */ React18__namespace.default.createElement(
|
|
3434
3548
|
framerMotion.motion.div,
|
|
3435
3549
|
{
|
|
3436
3550
|
initial: { opacity: 0, y: 10 },
|
|
@@ -3438,9 +3552,9 @@ var EventModal = ({
|
|
|
3438
3552
|
transition: { delay: 0.15 },
|
|
3439
3553
|
className: "space-y-2"
|
|
3440
3554
|
},
|
|
3441
|
-
/* @__PURE__ */
|
|
3442
|
-
/* @__PURE__ */
|
|
3443
|
-
), event?.attachments && event.attachments.length > 0 && /* @__PURE__ */
|
|
3555
|
+
/* @__PURE__ */ React18__namespace.default.createElement("div", { className: "flex items-center gap-2" }, /* @__PURE__ */ React18__namespace.default.createElement(lucideReact.AlignLeft, { className: "w-4 h-4 text-muted-foreground" }), /* @__PURE__ */ React18__namespace.default.createElement("span", { className: "text-sm font-medium text-foreground" }, translations.notes)),
|
|
3556
|
+
/* @__PURE__ */ React18__namespace.default.createElement("div", { className: "text-sm text-foreground/80 whitespace-pre-wrap leading-relaxed pl-6 p-3 rounded-xl bg-muted/20 border border-border/30" }, event.description)
|
|
3557
|
+
), event?.attachments && event.attachments.length > 0 && /* @__PURE__ */ React18__namespace.default.createElement(
|
|
3444
3558
|
framerMotion.motion.div,
|
|
3445
3559
|
{
|
|
3446
3560
|
initial: { opacity: 0, y: 10 },
|
|
@@ -3448,27 +3562,27 @@ var EventModal = ({
|
|
|
3448
3562
|
transition: { delay: 0.2 },
|
|
3449
3563
|
className: "space-y-2"
|
|
3450
3564
|
},
|
|
3451
|
-
/* @__PURE__ */
|
|
3452
|
-
/* @__PURE__ */
|
|
3565
|
+
/* @__PURE__ */ React18__namespace.default.createElement("div", { className: "flex items-center gap-2" }, /* @__PURE__ */ React18__namespace.default.createElement(lucideReact.Paperclip, { className: "w-4 h-4 text-muted-foreground" }), /* @__PURE__ */ React18__namespace.default.createElement("span", { className: "text-sm font-medium text-foreground" }, translations.attachments)),
|
|
3566
|
+
/* @__PURE__ */ React18__namespace.default.createElement("div", { className: "grid gap-2" }, event.attachments.map((att) => /* @__PURE__ */ React18__namespace.default.createElement(
|
|
3453
3567
|
"div",
|
|
3454
3568
|
{
|
|
3455
3569
|
key: att.id,
|
|
3456
3570
|
onClick: () => handleDownload(att),
|
|
3457
3571
|
className: "flex items-center gap-3 p-3 rounded-xl border border-border/30 bg-muted/20 hover:bg-muted/40 transition-all cursor-pointer group"
|
|
3458
3572
|
},
|
|
3459
|
-
/* @__PURE__ */
|
|
3460
|
-
/* @__PURE__ */
|
|
3461
|
-
/* @__PURE__ */
|
|
3573
|
+
/* @__PURE__ */ React18__namespace.default.createElement("div", { className: "p-2 bg-primary/10 rounded-lg" }, /* @__PURE__ */ React18__namespace.default.createElement(lucideReact.File, { className: "w-4 h-4 text-primary" })),
|
|
3574
|
+
/* @__PURE__ */ React18__namespace.default.createElement("div", { className: "flex-1 min-w-0" }, /* @__PURE__ */ React18__namespace.default.createElement("p", { className: "text-sm font-medium text-foreground truncate" }, att.name), /* @__PURE__ */ React18__namespace.default.createElement("p", { className: "text-xs text-muted-foreground" }, att.size)),
|
|
3575
|
+
/* @__PURE__ */ React18__namespace.default.createElement(lucideReact.Download, { className: "w-4 h-4 text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity" })
|
|
3462
3576
|
)))
|
|
3463
3577
|
)));
|
|
3464
|
-
const renderEditMode = () => /* @__PURE__ */
|
|
3578
|
+
const renderEditMode = () => /* @__PURE__ */ React18__namespace.default.createElement("form", { onSubmit: handleSubmit, className: "flex flex-col bg-background overflow-hidden w-full max-h-[85vh]" }, /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "flex items-center justify-between px-5 py-4 border-b border-border/50 shrink-0" }, /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "flex items-center gap-3" }, /* @__PURE__ */ React18__namespace.default.createElement(
|
|
3465
3579
|
"button",
|
|
3466
3580
|
{
|
|
3467
3581
|
type: "button",
|
|
3468
3582
|
onClick: () => setIsColorPickerOpen(!isColorPickerOpen),
|
|
3469
3583
|
className: "relative p-1"
|
|
3470
3584
|
},
|
|
3471
|
-
/* @__PURE__ */
|
|
3585
|
+
/* @__PURE__ */ React18__namespace.default.createElement(
|
|
3472
3586
|
"div",
|
|
3473
3587
|
{
|
|
3474
3588
|
className: "w-5 h-5 rounded-full cursor-pointer hover:scale-110 transition-transform",
|
|
@@ -3478,7 +3592,7 @@ var EventModal = ({
|
|
|
3478
3592
|
}
|
|
3479
3593
|
}
|
|
3480
3594
|
),
|
|
3481
|
-
isColorPickerOpen && /* @__PURE__ */
|
|
3595
|
+
isColorPickerOpen && /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "absolute top-full left-0 mt-2 p-2 bg-background border border-border rounded-xl shadow-xl z-50 flex flex-wrap gap-1.5 w-[180px]" }, COLOR_PALETTE.map((color) => /* @__PURE__ */ React18__namespace.default.createElement(
|
|
3482
3596
|
"button",
|
|
3483
3597
|
{
|
|
3484
3598
|
key: color,
|
|
@@ -3494,15 +3608,15 @@ var EventModal = ({
|
|
|
3494
3608
|
style: { backgroundColor: color, color }
|
|
3495
3609
|
}
|
|
3496
3610
|
)))
|
|
3497
|
-
), /* @__PURE__ */
|
|
3611
|
+
), /* @__PURE__ */ React18__namespace.default.createElement("h2", { className: "text-lg font-semibold text-foreground" }, mode === "edit" ? translations.editEvent : translations.newEvent)), /* @__PURE__ */ React18__namespace.default.createElement(
|
|
3498
3612
|
"button",
|
|
3499
3613
|
{
|
|
3500
3614
|
type: "button",
|
|
3501
3615
|
onClick: onClose,
|
|
3502
3616
|
className: "p-2 hover:bg-accent rounded-xl transition-all text-muted-foreground hover:text-foreground"
|
|
3503
3617
|
},
|
|
3504
|
-
/* @__PURE__ */
|
|
3505
|
-
)), /* @__PURE__ */
|
|
3618
|
+
/* @__PURE__ */ React18__namespace.default.createElement(lucideReact.X, { className: "w-4 h-4" })
|
|
3619
|
+
)), /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "flex-1 overflow-y-auto" }, /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "px-5 py-4 space-y-5" }, /* @__PURE__ */ React18__namespace.default.createElement("div", null, /* @__PURE__ */ React18__namespace.default.createElement(
|
|
3506
3620
|
"input",
|
|
3507
3621
|
{
|
|
3508
3622
|
type: "text",
|
|
@@ -3513,7 +3627,7 @@ var EventModal = ({
|
|
|
3513
3627
|
onChange: (e) => setFormData({ ...formData, title: e.target.value }),
|
|
3514
3628
|
placeholder: translations.addTitle
|
|
3515
3629
|
}
|
|
3516
|
-
)), /* @__PURE__ */
|
|
3630
|
+
)), /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "flex items-center gap-3 p-4 rounded-2xl bg-muted/20 border border-border/30" }, /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "p-2 bg-primary/10 rounded-xl shrink-0" }, /* @__PURE__ */ React18__namespace.default.createElement(lucideReact.Clock, { className: "w-5 h-5 text-primary" })), /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "flex-1 grid grid-cols-2 gap-3" }, /* @__PURE__ */ React18__namespace.default.createElement("div", null, /* @__PURE__ */ React18__namespace.default.createElement("label", { className: "text-[10px] font-semibold text-muted-foreground uppercase tracking-wider mb-1 block" }, translations.start), /* @__PURE__ */ React18__namespace.default.createElement(
|
|
3517
3631
|
"input",
|
|
3518
3632
|
{
|
|
3519
3633
|
type: "datetime-local",
|
|
@@ -3521,7 +3635,7 @@ var EventModal = ({
|
|
|
3521
3635
|
value: formatDateForInput(formData.start),
|
|
3522
3636
|
onChange: (e) => handleDateChange("start", e.target.value)
|
|
3523
3637
|
}
|
|
3524
|
-
)), /* @__PURE__ */
|
|
3638
|
+
)), /* @__PURE__ */ React18__namespace.default.createElement("div", null, /* @__PURE__ */ React18__namespace.default.createElement("label", { className: "text-[10px] font-semibold text-muted-foreground uppercase tracking-wider mb-1 block" }, translations.end), /* @__PURE__ */ React18__namespace.default.createElement(
|
|
3525
3639
|
"input",
|
|
3526
3640
|
{
|
|
3527
3641
|
type: "datetime-local",
|
|
@@ -3529,16 +3643,16 @@ var EventModal = ({
|
|
|
3529
3643
|
value: formatDateForInput(formData.end),
|
|
3530
3644
|
onChange: (e) => handleDateChange("end", e.target.value)
|
|
3531
3645
|
}
|
|
3532
|
-
)))), getDurationText() && /* @__PURE__ */
|
|
3646
|
+
)))), getDurationText() && /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "flex justify-center" }, /* @__PURE__ */ React18__namespace.default.createElement("span", { className: "text-xs font-medium px-3 py-1 rounded-full bg-primary/10 text-primary" }, getDurationText())), /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "space-y-2" }, /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "flex items-center justify-between" }, /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "flex items-center gap-2" }, /* @__PURE__ */ React18__namespace.default.createElement(lucideReact.Bell, { className: "w-4 h-4 text-muted-foreground" }), /* @__PURE__ */ React18__namespace.default.createElement("span", { className: "text-sm font-medium text-foreground" }, translations.reminders)), /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "relative" }, /* @__PURE__ */ React18__namespace.default.createElement(
|
|
3533
3647
|
"button",
|
|
3534
3648
|
{
|
|
3535
3649
|
type: "button",
|
|
3536
3650
|
onClick: () => setIsReminderDropdownOpen(!isReminderDropdownOpen),
|
|
3537
3651
|
className: "flex items-center gap-1 text-xs font-medium text-primary hover:text-primary/80 transition-colors"
|
|
3538
3652
|
},
|
|
3539
|
-
/* @__PURE__ */
|
|
3653
|
+
/* @__PURE__ */ React18__namespace.default.createElement(lucideReact.Plus, { className: "w-3.5 h-3.5" }),
|
|
3540
3654
|
translations.addReminder
|
|
3541
|
-
), isReminderDropdownOpen && /* @__PURE__ */
|
|
3655
|
+
), isReminderDropdownOpen && /* @__PURE__ */ React18__namespace.default.createElement(React18__namespace.default.Fragment, null, /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "fixed inset-0 z-40", onClick: () => setIsReminderDropdownOpen(false) }), /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "absolute right-0 top-full mt-1 w-48 bg-background border border-border rounded-xl shadow-xl z-50 py-1 max-h-60 overflow-y-auto" }, getReminderOptions(translations).map((option) => /* @__PURE__ */ React18__namespace.default.createElement(
|
|
3542
3656
|
"button",
|
|
3543
3657
|
{
|
|
3544
3658
|
key: option.value,
|
|
@@ -3547,58 +3661,58 @@ var EventModal = ({
|
|
|
3547
3661
|
className: "w-full px-3 py-2 text-left text-sm hover:bg-accent transition-colors"
|
|
3548
3662
|
},
|
|
3549
3663
|
option.label
|
|
3550
|
-
)))))), formData.reminders && formData.reminders.length > 0 && /* @__PURE__ */
|
|
3664
|
+
)))))), formData.reminders && formData.reminders.length > 0 && /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "flex flex-wrap gap-2" }, formData.reminders.map((reminder) => /* @__PURE__ */ React18__namespace.default.createElement(
|
|
3551
3665
|
"div",
|
|
3552
3666
|
{
|
|
3553
3667
|
key: reminder.id,
|
|
3554
3668
|
className: "flex items-center gap-2 px-3 py-1.5 rounded-full bg-amber-500/10 border border-amber-500/20"
|
|
3555
3669
|
},
|
|
3556
|
-
/* @__PURE__ */
|
|
3557
|
-
/* @__PURE__ */
|
|
3558
|
-
/* @__PURE__ */
|
|
3670
|
+
/* @__PURE__ */ React18__namespace.default.createElement(lucideReact.BellRing, { className: "w-3.5 h-3.5 text-amber-500" }),
|
|
3671
|
+
/* @__PURE__ */ React18__namespace.default.createElement("span", { className: "text-xs font-medium text-amber-600 dark:text-amber-400" }, reminder.label),
|
|
3672
|
+
/* @__PURE__ */ React18__namespace.default.createElement(
|
|
3559
3673
|
"button",
|
|
3560
3674
|
{
|
|
3561
3675
|
type: "button",
|
|
3562
3676
|
onClick: () => removeReminder(reminder.id),
|
|
3563
3677
|
className: "p-0.5 hover:bg-amber-500/20 rounded-full transition-colors"
|
|
3564
3678
|
},
|
|
3565
|
-
/* @__PURE__ */
|
|
3679
|
+
/* @__PURE__ */ React18__namespace.default.createElement(lucideReact.X, { className: "w-3 h-3 text-amber-500" })
|
|
3566
3680
|
)
|
|
3567
|
-
)))), /* @__PURE__ */
|
|
3681
|
+
)))), /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "space-y-2" }, /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "flex items-center gap-2" }, /* @__PURE__ */ React18__namespace.default.createElement(lucideReact.Users, { className: "w-4 h-4 text-muted-foreground" }), /* @__PURE__ */ React18__namespace.default.createElement("span", { className: "text-sm font-medium text-foreground" }, translations.guests)), /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "relative" }, /* @__PURE__ */ React18__namespace.default.createElement(
|
|
3568
3682
|
"button",
|
|
3569
3683
|
{
|
|
3570
3684
|
type: "button",
|
|
3571
3685
|
onClick: () => setIsGuestsDropdownOpen(!isGuestsDropdownOpen),
|
|
3572
3686
|
className: "w-full flex items-center justify-between px-4 py-3 bg-muted/20 border border-border/30 rounded-xl text-sm text-left hover:bg-muted/30 transition-all"
|
|
3573
3687
|
},
|
|
3574
|
-
/* @__PURE__ */
|
|
3575
|
-
/* @__PURE__ */
|
|
3576
|
-
), isGuestsDropdownOpen && /* @__PURE__ */
|
|
3688
|
+
/* @__PURE__ */ React18__namespace.default.createElement("span", { className: selectedGuests.length > 0 ? "text-foreground font-medium" : "text-muted-foreground" }, selectedGuests.length > 0 ? `${selectedGuests.length} ${selectedGuests.length > 1 ? translations.guestsAdded : translations.guestAdded}` : translations.addGuests),
|
|
3689
|
+
/* @__PURE__ */ React18__namespace.default.createElement(lucideReact.ChevronDown, { className: cn("w-4 h-4 text-muted-foreground transition-transform", isGuestsDropdownOpen && "rotate-180") })
|
|
3690
|
+
), isGuestsDropdownOpen && /* @__PURE__ */ React18__namespace.default.createElement(React18__namespace.default.Fragment, null, /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "fixed inset-0 z-40", onClick: () => setIsGuestsDropdownOpen(false) }), /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "absolute z-50 w-full mt-2 bg-background border border-border rounded-xl shadow-xl max-h-48 overflow-y-auto" }, fakeGuests.map((email) => /* @__PURE__ */ React18__namespace.default.createElement(
|
|
3577
3691
|
"div",
|
|
3578
3692
|
{
|
|
3579
3693
|
key: email,
|
|
3580
3694
|
className: "px-4 py-3 hover:bg-accent cursor-pointer flex items-center gap-3 transition-colors",
|
|
3581
3695
|
onClick: () => toggleGuest(email)
|
|
3582
3696
|
},
|
|
3583
|
-
/* @__PURE__ */
|
|
3697
|
+
/* @__PURE__ */ React18__namespace.default.createElement("div", { className: cn(
|
|
3584
3698
|
"w-5 h-5 rounded-md border-2 flex items-center justify-center transition-all",
|
|
3585
3699
|
selectedGuests.includes(email) ? "bg-primary border-primary" : "border-border"
|
|
3586
|
-
) }, selectedGuests.includes(email) && /* @__PURE__ */
|
|
3587
|
-
/* @__PURE__ */
|
|
3700
|
+
) }, selectedGuests.includes(email) && /* @__PURE__ */ React18__namespace.default.createElement(lucideReact.Check, { className: "w-3 h-3 text-primary-foreground" })),
|
|
3701
|
+
/* @__PURE__ */ React18__namespace.default.createElement("div", { className: "flex items-center gap-2" }, /* @__PURE__ */ React18__namespace.default.createElement(
|
|
3588
3702
|
"div",
|
|
3589
3703
|
{
|
|
3590
3704
|
className: "w-7 h-7 rounded-full flex items-center justify-center text-xs font-semibold text-white",
|
|
3591
3705
|
style: { backgroundColor: `hsl(${fakeGuests.indexOf(email) * 60}, 70%, 50%)` }
|
|
3592
3706
|
},
|
|
3593
3707
|
email[0].toUpperCase()
|
|
3594
|
-
), /* @__PURE__ */
|
|
3595
|
-
))))), selectedGuests.length > 0 && /* @__PURE__ */
|
|
3708
|
+
), /* @__PURE__ */ React18__namespace.default.createElement("span", { className: "text-sm" }, email))
|
|
3709
|
+
))))), selectedGuests.length > 0 && /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "flex flex-wrap gap-2 mt-2" }, selectedGuests.map((email) => /* @__PURE__ */ React18__namespace.default.createElement(
|
|
3596
3710
|
"div",
|
|
3597
3711
|
{
|
|
3598
3712
|
key: email,
|
|
3599
3713
|
className: "flex items-center gap-2 pl-1 pr-2 py-1 bg-muted/30 border border-border/30 rounded-full"
|
|
3600
3714
|
},
|
|
3601
|
-
/* @__PURE__ */
|
|
3715
|
+
/* @__PURE__ */ React18__namespace.default.createElement(
|
|
3602
3716
|
"div",
|
|
3603
3717
|
{
|
|
3604
3718
|
className: "w-6 h-6 rounded-full flex items-center justify-center text-xs font-semibold text-white",
|
|
@@ -3606,17 +3720,17 @@ var EventModal = ({
|
|
|
3606
3720
|
},
|
|
3607
3721
|
email[0].toUpperCase()
|
|
3608
3722
|
),
|
|
3609
|
-
/* @__PURE__ */
|
|
3610
|
-
/* @__PURE__ */
|
|
3723
|
+
/* @__PURE__ */ React18__namespace.default.createElement("span", { className: "text-xs font-medium text-foreground" }, email.split("@")[0]),
|
|
3724
|
+
/* @__PURE__ */ React18__namespace.default.createElement(
|
|
3611
3725
|
"button",
|
|
3612
3726
|
{
|
|
3613
3727
|
type: "button",
|
|
3614
3728
|
onClick: () => toggleGuest(email),
|
|
3615
3729
|
className: "p-0.5 hover:bg-destructive/10 rounded-full transition-colors"
|
|
3616
3730
|
},
|
|
3617
|
-
/* @__PURE__ */
|
|
3731
|
+
/* @__PURE__ */ React18__namespace.default.createElement(lucideReact.X, { className: "w-3 h-3 text-muted-foreground" })
|
|
3618
3732
|
)
|
|
3619
|
-
)))), /* @__PURE__ */
|
|
3733
|
+
)))), /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "flex items-center gap-3 p-3 rounded-xl bg-muted/20 border border-border/30" }, /* @__PURE__ */ React18__namespace.default.createElement(lucideReact.MapPin, { className: "w-5 h-5 text-muted-foreground shrink-0" }), /* @__PURE__ */ React18__namespace.default.createElement(
|
|
3620
3734
|
"input",
|
|
3621
3735
|
{
|
|
3622
3736
|
type: "text",
|
|
@@ -3625,7 +3739,7 @@ var EventModal = ({
|
|
|
3625
3739
|
value: formData.location || "",
|
|
3626
3740
|
onChange: (e) => setFormData({ ...formData, location: e.target.value })
|
|
3627
3741
|
}
|
|
3628
|
-
)), /* @__PURE__ */
|
|
3742
|
+
)), /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "space-y-2" }, /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "flex items-center gap-2" }, /* @__PURE__ */ React18__namespace.default.createElement(lucideReact.AlignLeft, { className: "w-4 h-4 text-muted-foreground" }), /* @__PURE__ */ React18__namespace.default.createElement("span", { className: "text-sm font-medium text-foreground" }, translations.notes)), /* @__PURE__ */ React18__namespace.default.createElement(
|
|
3629
3743
|
"textarea",
|
|
3630
3744
|
{
|
|
3631
3745
|
className: "w-full bg-muted/20 border border-border/30 rounded-xl px-4 py-3 text-sm min-h-[100px] resize-none text-foreground placeholder-muted-foreground focus:border-primary focus:ring-2 focus:ring-primary/20 transition-all",
|
|
@@ -3633,7 +3747,7 @@ var EventModal = ({
|
|
|
3633
3747
|
value: formData.description || "",
|
|
3634
3748
|
onChange: (e) => setFormData({ ...formData, description: e.target.value })
|
|
3635
3749
|
}
|
|
3636
|
-
)), /* @__PURE__ */
|
|
3750
|
+
)), /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "flex items-center gap-3 p-3 rounded-xl bg-muted/20 border border-border/30" }, /* @__PURE__ */ React18__namespace.default.createElement(lucideReact.Repeat, { className: "w-5 h-5 text-muted-foreground shrink-0" }), /* @__PURE__ */ React18__namespace.default.createElement(
|
|
3637
3751
|
"select",
|
|
3638
3752
|
{
|
|
3639
3753
|
className: "flex-1 bg-transparent text-sm text-foreground focus:outline-none cursor-pointer",
|
|
@@ -3652,28 +3766,28 @@ var EventModal = ({
|
|
|
3652
3766
|
}
|
|
3653
3767
|
}
|
|
3654
3768
|
},
|
|
3655
|
-
/* @__PURE__ */
|
|
3656
|
-
/* @__PURE__ */
|
|
3657
|
-
/* @__PURE__ */
|
|
3658
|
-
/* @__PURE__ */
|
|
3659
|
-
/* @__PURE__ */
|
|
3660
|
-
)), /* @__PURE__ */
|
|
3769
|
+
/* @__PURE__ */ React18__namespace.default.createElement("option", { value: "" }, translations.doesNotRepeat),
|
|
3770
|
+
/* @__PURE__ */ React18__namespace.default.createElement("option", { value: "DAILY" }, translations.daily),
|
|
3771
|
+
/* @__PURE__ */ React18__namespace.default.createElement("option", { value: "WEEKLY" }, translations.weekly),
|
|
3772
|
+
/* @__PURE__ */ React18__namespace.default.createElement("option", { value: "MONTHLY" }, translations.monthly),
|
|
3773
|
+
/* @__PURE__ */ React18__namespace.default.createElement("option", { value: "YEARLY" }, translations.yearly)
|
|
3774
|
+
)), /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "flex items-center justify-between p-3 rounded-xl bg-muted/20 border border-border/30" }, /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "flex items-center gap-2" }, /* @__PURE__ */ React18__namespace.default.createElement(lucideReact.Tag, { className: "w-5 h-5 text-muted-foreground" }), /* @__PURE__ */ React18__namespace.default.createElement("span", { className: "text-sm text-foreground" }, translations.calendar)), /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "relative" }, /* @__PURE__ */ React18__namespace.default.createElement(
|
|
3661
3775
|
"button",
|
|
3662
3776
|
{
|
|
3663
3777
|
type: "button",
|
|
3664
3778
|
onClick: () => setIsCalendarDropdownOpen(!isCalendarDropdownOpen),
|
|
3665
3779
|
className: "flex items-center gap-2 px-3 py-1.5 bg-background border border-border/50 rounded-lg text-sm hover:bg-accent/50 transition-all"
|
|
3666
3780
|
},
|
|
3667
|
-
/* @__PURE__ */
|
|
3781
|
+
/* @__PURE__ */ React18__namespace.default.createElement(
|
|
3668
3782
|
"div",
|
|
3669
3783
|
{
|
|
3670
3784
|
className: "w-3 h-3 rounded-full",
|
|
3671
3785
|
style: { backgroundColor: calendars?.find((c) => c.id === formData.calendarId)?.color || "#3b82f6" }
|
|
3672
3786
|
}
|
|
3673
3787
|
),
|
|
3674
|
-
/* @__PURE__ */
|
|
3675
|
-
/* @__PURE__ */
|
|
3676
|
-
), isCalendarDropdownOpen && /* @__PURE__ */
|
|
3788
|
+
/* @__PURE__ */ React18__namespace.default.createElement("span", { className: "font-medium" }, calendars?.find((c) => c.id === formData.calendarId)?.label || "Select"),
|
|
3789
|
+
/* @__PURE__ */ React18__namespace.default.createElement(lucideReact.ChevronDown, { className: "w-3.5 h-3.5 text-muted-foreground" })
|
|
3790
|
+
), isCalendarDropdownOpen && /* @__PURE__ */ React18__namespace.default.createElement(React18__namespace.default.Fragment, null, /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "fixed inset-0 z-40", onClick: () => setIsCalendarDropdownOpen(false) }), /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "absolute right-0 bottom-full mb-2 w-48 bg-background border border-border rounded-xl shadow-xl z-50 py-1" }, calendars?.map((cal) => /* @__PURE__ */ React18__namespace.default.createElement(
|
|
3677
3791
|
"button",
|
|
3678
3792
|
{
|
|
3679
3793
|
key: cal.id,
|
|
@@ -3688,19 +3802,19 @@ var EventModal = ({
|
|
|
3688
3802
|
setIsCalendarDropdownOpen(false);
|
|
3689
3803
|
}
|
|
3690
3804
|
},
|
|
3691
|
-
/* @__PURE__ */
|
|
3692
|
-
/* @__PURE__ */
|
|
3693
|
-
formData.calendarId === cal.id && /* @__PURE__ */
|
|
3694
|
-
)))))))), /* @__PURE__ */
|
|
3805
|
+
/* @__PURE__ */ React18__namespace.default.createElement("div", { className: "w-3 h-3 rounded-full", style: { backgroundColor: cal.color } }),
|
|
3806
|
+
/* @__PURE__ */ React18__namespace.default.createElement("span", { className: "flex-1 text-sm" }, cal.label),
|
|
3807
|
+
formData.calendarId === cal.id && /* @__PURE__ */ React18__namespace.default.createElement(lucideReact.Check, { className: "w-4 h-4 text-primary" })
|
|
3808
|
+
)))))))), /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "px-5 py-4 border-t border-border/50 flex items-center justify-between bg-muted/10 shrink-0" }, mode === "edit" && /* @__PURE__ */ React18__namespace.default.createElement(
|
|
3695
3809
|
"button",
|
|
3696
3810
|
{
|
|
3697
3811
|
type: "button",
|
|
3698
3812
|
onClick: handleDelete,
|
|
3699
3813
|
className: "flex items-center gap-2 px-4 py-2 text-destructive hover:bg-destructive/10 rounded-xl transition-all text-sm font-medium"
|
|
3700
3814
|
},
|
|
3701
|
-
/* @__PURE__ */
|
|
3815
|
+
/* @__PURE__ */ React18__namespace.default.createElement(lucideReact.Trash2, { className: "w-4 h-4" }),
|
|
3702
3816
|
translations.delete
|
|
3703
|
-
), mode === "create" && /* @__PURE__ */
|
|
3817
|
+
), mode === "create" && /* @__PURE__ */ React18__namespace.default.createElement("div", null), /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "flex items-center gap-2" }, /* @__PURE__ */ React18__namespace.default.createElement(
|
|
3704
3818
|
"button",
|
|
3705
3819
|
{
|
|
3706
3820
|
type: "button",
|
|
@@ -3708,7 +3822,7 @@ var EventModal = ({
|
|
|
3708
3822
|
className: "px-4 py-2.5 text-muted-foreground hover:text-foreground font-medium text-sm rounded-xl transition-all hover:bg-accent"
|
|
3709
3823
|
},
|
|
3710
3824
|
translations.cancel
|
|
3711
|
-
), /* @__PURE__ */
|
|
3825
|
+
), /* @__PURE__ */ React18__namespace.default.createElement(
|
|
3712
3826
|
"button",
|
|
3713
3827
|
{
|
|
3714
3828
|
type: "submit",
|
|
@@ -3716,7 +3830,7 @@ var EventModal = ({
|
|
|
3716
3830
|
},
|
|
3717
3831
|
mode === "edit" ? translations.saveChanges : translations.createEvent
|
|
3718
3832
|
))));
|
|
3719
|
-
return /* @__PURE__ */
|
|
3833
|
+
return /* @__PURE__ */ React18__namespace.default.createElement(Modal, { isOpen, onClose, hideHeader: true, className: "p-0 overflow-hidden max-w-lg rounded-2xl shadow-2xl" }, /* @__PURE__ */ React18__namespace.default.createElement(framerMotion.AnimatePresence, { mode: "wait" }, mode === "view" && event ? /* @__PURE__ */ React18__namespace.default.createElement(
|
|
3720
3834
|
framerMotion.motion.div,
|
|
3721
3835
|
{
|
|
3722
3836
|
key: "view",
|
|
@@ -3726,7 +3840,7 @@ var EventModal = ({
|
|
|
3726
3840
|
transition: { duration: 0.15 }
|
|
3727
3841
|
},
|
|
3728
3842
|
renderViewMode()
|
|
3729
|
-
) : /* @__PURE__ */
|
|
3843
|
+
) : /* @__PURE__ */ React18__namespace.default.createElement(
|
|
3730
3844
|
framerMotion.motion.div,
|
|
3731
3845
|
{
|
|
3732
3846
|
key: "edit",
|
|
@@ -3738,9 +3852,9 @@ var EventModal = ({
|
|
|
3738
3852
|
renderEditMode()
|
|
3739
3853
|
)));
|
|
3740
3854
|
};
|
|
3741
|
-
var Skeleton = ({ className, style }) => /* @__PURE__ */
|
|
3742
|
-
var MonthViewSkeleton = () => /* @__PURE__ */
|
|
3743
|
-
var WeekViewSkeleton = () => /* @__PURE__ */
|
|
3855
|
+
var Skeleton = ({ className, style }) => /* @__PURE__ */ React18__namespace.default.createElement("div", { className: cn("animate-pulse bg-muted/40 rounded", className), style });
|
|
3856
|
+
var MonthViewSkeleton = () => /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "h-full bg-background border border-border/50 rounded-2xl overflow-hidden" }, /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "grid grid-cols-7 border-b border-border/50 bg-muted/10" }, Array.from({ length: 7 }).map((_, i) => /* @__PURE__ */ React18__namespace.default.createElement("div", { key: i, className: "py-3 px-2 text-center border-r border-border/30 last:border-r-0" }, /* @__PURE__ */ React18__namespace.default.createElement(Skeleton, { className: "h-4 w-8 mx-auto" })))), /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "grid grid-cols-7 flex-1" }, Array.from({ length: 35 }).map((_, i) => /* @__PURE__ */ React18__namespace.default.createElement("div", { key: i, className: "min-h-[120px] border-r border-b border-border/30 p-2" }, /* @__PURE__ */ React18__namespace.default.createElement(Skeleton, { className: "h-4 w-6 mb-2" }), /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "space-y-1" }, Math.random() > 0.5 && /* @__PURE__ */ React18__namespace.default.createElement(Skeleton, { className: "h-5 w-full rounded-md" }), Math.random() > 0.7 && /* @__PURE__ */ React18__namespace.default.createElement(Skeleton, { className: "h-5 w-3/4 rounded-md" }))))));
|
|
3857
|
+
var WeekViewSkeleton = () => /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "h-full bg-background border border-border/50 rounded-2xl overflow-hidden" }, /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "flex border-b border-border/50 bg-muted/10" }, /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "w-16 p-3 border-r border-border/30" }, /* @__PURE__ */ React18__namespace.default.createElement(Skeleton, { className: "h-8 w-10 mx-auto" })), /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "flex-1 grid grid-cols-7" }, Array.from({ length: 7 }).map((_, i) => /* @__PURE__ */ React18__namespace.default.createElement("div", { key: i, className: "py-3 px-2 text-center border-r border-border/30 last:border-r-0" }, /* @__PURE__ */ React18__namespace.default.createElement(Skeleton, { className: "h-3 w-8 mx-auto mb-1" }), /* @__PURE__ */ React18__namespace.default.createElement(Skeleton, { className: "h-8 w-8 mx-auto rounded-xl" }))))), /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "flex flex-1", style: { height: "600px" } }, /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "w-16 border-r border-border/30" }, Array.from({ length: 10 }).map((_, i) => /* @__PURE__ */ React18__namespace.default.createElement("div", { key: i, className: "h-[60px] relative" }, /* @__PURE__ */ React18__namespace.default.createElement(Skeleton, { className: "h-4 w-10 absolute right-2 -translate-y-1/2" })))), /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "flex-1 grid grid-cols-7 relative" }, Array.from({ length: 7 }).map((_, colIdx) => /* @__PURE__ */ React18__namespace.default.createElement("div", { key: colIdx, className: "relative border-r border-border/30 last:border-r-0" }, Array.from({ length: 10 }).map((_2, rowIdx) => /* @__PURE__ */ React18__namespace.default.createElement("div", { key: rowIdx, className: "h-[60px] border-b border-dashed border-border/20" })), Math.random() > 0.3 && /* @__PURE__ */ React18__namespace.default.createElement(
|
|
3744
3858
|
Skeleton,
|
|
3745
3859
|
{
|
|
3746
3860
|
className: "absolute rounded-md",
|
|
@@ -3752,20 +3866,20 @@ var WeekViewSkeleton = () => /* @__PURE__ */ React17__namespace.default.createEl
|
|
|
3752
3866
|
}
|
|
3753
3867
|
}
|
|
3754
3868
|
))))));
|
|
3755
|
-
var DayViewSkeleton = () => /* @__PURE__ */
|
|
3869
|
+
var DayViewSkeleton = () => /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "h-full bg-background border border-border/50 rounded-2xl overflow-hidden" }, /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "px-6 py-4 border-b border-border/50 bg-muted/10 text-center" }, /* @__PURE__ */ React18__namespace.default.createElement(Skeleton, { className: "h-7 w-64 mx-auto" })), /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "flex flex-1", style: { height: "600px" } }, /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "w-20 border-r border-border/30 bg-muted/5" }, Array.from({ length: 10 }).map((_, i) => /* @__PURE__ */ React18__namespace.default.createElement("div", { key: i, className: "h-[80px] relative" }, /* @__PURE__ */ React18__namespace.default.createElement(Skeleton, { className: "h-4 w-12 absolute left-1/2 -translate-x-1/2 -translate-y-1/2" })))), /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "flex-1 relative" }, Array.from({ length: 10 }).map((_, i) => /* @__PURE__ */ React18__namespace.default.createElement("div", { key: i, className: "h-[80px] border-b border-dashed border-border/20" })), /* @__PURE__ */ React18__namespace.default.createElement(
|
|
3756
3870
|
Skeleton,
|
|
3757
3871
|
{
|
|
3758
3872
|
className: "absolute rounded-lg left-4 right-4",
|
|
3759
3873
|
style: { top: "160px", height: "120px" }
|
|
3760
3874
|
}
|
|
3761
|
-
), /* @__PURE__ */
|
|
3875
|
+
), /* @__PURE__ */ React18__namespace.default.createElement(
|
|
3762
3876
|
Skeleton,
|
|
3763
3877
|
{
|
|
3764
3878
|
className: "absolute rounded-lg left-4 right-4",
|
|
3765
3879
|
style: { top: "400px", height: "80px" }
|
|
3766
3880
|
}
|
|
3767
3881
|
))));
|
|
3768
|
-
var AgendaViewSkeleton = () => /* @__PURE__ */
|
|
3882
|
+
var AgendaViewSkeleton = () => /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "h-full bg-background border border-border/50 rounded-2xl overflow-hidden p-6" }, /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "space-y-6" }, Array.from({ length: 4 }).map((_, dayIdx) => /* @__PURE__ */ React18__namespace.default.createElement("div", { key: dayIdx }, /* @__PURE__ */ React18__namespace.default.createElement(Skeleton, { className: "h-5 w-40 mb-4" }), /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "space-y-3" }, Array.from({ length: 2 + Math.floor(Math.random() * 3) }).map((_2, eventIdx) => /* @__PURE__ */ React18__namespace.default.createElement("div", { key: eventIdx, className: "flex items-center gap-4 p-3 rounded-xl bg-muted/10" }, /* @__PURE__ */ React18__namespace.default.createElement(Skeleton, { className: "h-10 w-10 rounded-lg" }), /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "flex-1 space-y-2" }, /* @__PURE__ */ React18__namespace.default.createElement(Skeleton, { className: "h-4 w-3/4" }), /* @__PURE__ */ React18__namespace.default.createElement(Skeleton, { className: "h-3 w-1/2" })))))))));
|
|
3769
3883
|
var EventContextMenu = ({
|
|
3770
3884
|
event,
|
|
3771
3885
|
position,
|
|
@@ -3776,8 +3890,8 @@ var EventContextMenu = ({
|
|
|
3776
3890
|
customActions = [],
|
|
3777
3891
|
translations
|
|
3778
3892
|
}) => {
|
|
3779
|
-
const menuRef =
|
|
3780
|
-
|
|
3893
|
+
const menuRef = React18.useRef(null);
|
|
3894
|
+
React18.useEffect(() => {
|
|
3781
3895
|
const handleKeyDown = (e) => {
|
|
3782
3896
|
if (e.key === "Escape") {
|
|
3783
3897
|
onClose();
|
|
@@ -3788,7 +3902,7 @@ var EventContextMenu = ({
|
|
|
3788
3902
|
return () => document.removeEventListener("keydown", handleKeyDown);
|
|
3789
3903
|
}
|
|
3790
3904
|
}, [position, onClose]);
|
|
3791
|
-
|
|
3905
|
+
React18.useEffect(() => {
|
|
3792
3906
|
const handleClickOutside = (e) => {
|
|
3793
3907
|
if (menuRef.current && !menuRef.current.contains(e.target)) {
|
|
3794
3908
|
onClose();
|
|
@@ -3806,7 +3920,7 @@ var EventContextMenu = ({
|
|
|
3806
3920
|
...onEdit ? [{
|
|
3807
3921
|
id: "edit",
|
|
3808
3922
|
label: translations?.edit || "Edit",
|
|
3809
|
-
icon: /* @__PURE__ */
|
|
3923
|
+
icon: /* @__PURE__ */ React18__namespace.default.createElement(lucideReact.Edit3, { className: "w-4 h-4" }),
|
|
3810
3924
|
onClick: () => {
|
|
3811
3925
|
onEdit(event);
|
|
3812
3926
|
onClose();
|
|
@@ -3815,7 +3929,7 @@ var EventContextMenu = ({
|
|
|
3815
3929
|
...onDuplicate ? [{
|
|
3816
3930
|
id: "duplicate",
|
|
3817
3931
|
label: translations?.duplicate || "Duplicate",
|
|
3818
|
-
icon: /* @__PURE__ */
|
|
3932
|
+
icon: /* @__PURE__ */ React18__namespace.default.createElement(lucideReact.Copy, { className: "w-4 h-4" }),
|
|
3819
3933
|
onClick: () => {
|
|
3820
3934
|
onDuplicate(event);
|
|
3821
3935
|
onClose();
|
|
@@ -3825,7 +3939,7 @@ var EventContextMenu = ({
|
|
|
3825
3939
|
...onDelete ? [{
|
|
3826
3940
|
id: "delete",
|
|
3827
3941
|
label: translations?.delete || "Delete",
|
|
3828
|
-
icon: /* @__PURE__ */
|
|
3942
|
+
icon: /* @__PURE__ */ React18__namespace.default.createElement(lucideReact.Trash2, { className: "w-4 h-4" }),
|
|
3829
3943
|
onClick: () => {
|
|
3830
3944
|
onDelete(event.id);
|
|
3831
3945
|
onClose();
|
|
@@ -3837,7 +3951,7 @@ var EventContextMenu = ({
|
|
|
3837
3951
|
x: Math.min(position.x, window.innerWidth - 200),
|
|
3838
3952
|
y: Math.min(position.y, window.innerHeight - (actions.length * 44 + 80))
|
|
3839
3953
|
};
|
|
3840
|
-
return /* @__PURE__ */
|
|
3954
|
+
return /* @__PURE__ */ React18__namespace.default.createElement(framerMotion.AnimatePresence, null, /* @__PURE__ */ React18__namespace.default.createElement(
|
|
3841
3955
|
framerMotion.motion.div,
|
|
3842
3956
|
{
|
|
3843
3957
|
ref: menuRef,
|
|
@@ -3851,14 +3965,14 @@ var EventContextMenu = ({
|
|
|
3851
3965
|
top: adjustedPosition.y
|
|
3852
3966
|
}
|
|
3853
3967
|
},
|
|
3854
|
-
/* @__PURE__ */
|
|
3968
|
+
/* @__PURE__ */ React18__namespace.default.createElement("div", { className: "px-3 py-2 border-b-[0.5px] border-border bg-muted/30" }, /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "flex items-center gap-2" }, /* @__PURE__ */ React18__namespace.default.createElement(
|
|
3855
3969
|
"div",
|
|
3856
3970
|
{
|
|
3857
3971
|
className: "w-2.5 h-2.5 rounded-full shrink-0",
|
|
3858
3972
|
style: { backgroundColor: event.color || "var(--primary)" }
|
|
3859
3973
|
}
|
|
3860
|
-
), /* @__PURE__ */
|
|
3861
|
-
/* @__PURE__ */
|
|
3974
|
+
), /* @__PURE__ */ React18__namespace.default.createElement("span", { className: "text-sm font-medium truncate text-foreground" }, event.title))),
|
|
3975
|
+
/* @__PURE__ */ React18__namespace.default.createElement("div", { className: "py-1" }, actions.map((action, index) => /* @__PURE__ */ React18__namespace.default.createElement(React18__namespace.default.Fragment, { key: action.id }, index > 0 && action.variant === "danger" && /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "h-px bg-border my-1" }), /* @__PURE__ */ React18__namespace.default.createElement(
|
|
3862
3976
|
"button",
|
|
3863
3977
|
{
|
|
3864
3978
|
onClick: action.onClick,
|
|
@@ -3870,13 +3984,13 @@ var EventContextMenu = ({
|
|
|
3870
3984
|
)
|
|
3871
3985
|
},
|
|
3872
3986
|
action.icon,
|
|
3873
|
-
/* @__PURE__ */
|
|
3987
|
+
/* @__PURE__ */ React18__namespace.default.createElement("span", null, action.label)
|
|
3874
3988
|
))))
|
|
3875
3989
|
));
|
|
3876
3990
|
};
|
|
3877
3991
|
var useEventContextMenu = () => {
|
|
3878
|
-
const [contextMenu, setContextMenu] =
|
|
3879
|
-
const openContextMenu =
|
|
3992
|
+
const [contextMenu, setContextMenu] = React18.useState({ event: null, position: null });
|
|
3993
|
+
const openContextMenu = React18.useCallback((event, e) => {
|
|
3880
3994
|
e.preventDefault();
|
|
3881
3995
|
e.stopPropagation();
|
|
3882
3996
|
setContextMenu({
|
|
@@ -3884,7 +3998,7 @@ var useEventContextMenu = () => {
|
|
|
3884
3998
|
position: { x: e.clientX, y: e.clientY }
|
|
3885
3999
|
});
|
|
3886
4000
|
}, []);
|
|
3887
|
-
const closeContextMenu =
|
|
4001
|
+
const closeContextMenu = React18.useCallback(() => {
|
|
3888
4002
|
setContextMenu({ event: null, position: null });
|
|
3889
4003
|
}, []);
|
|
3890
4004
|
return {
|
|
@@ -3987,20 +4101,20 @@ var useCalendarLogic = ({
|
|
|
3987
4101
|
readOnly,
|
|
3988
4102
|
timezone
|
|
3989
4103
|
}) => {
|
|
3990
|
-
const [internalView, setInternalView] =
|
|
3991
|
-
const [internalDate, setInternalDate] =
|
|
3992
|
-
const [isSidebarOpen, setIsSidebarOpen] =
|
|
3993
|
-
|
|
4104
|
+
const [internalView, setInternalView] = React18.useState("week");
|
|
4105
|
+
const [internalDate, setInternalDate] = React18.useState(/* @__PURE__ */ new Date());
|
|
4106
|
+
const [isSidebarOpen, setIsSidebarOpen] = React18.useState(false);
|
|
4107
|
+
React18.useEffect(() => {
|
|
3994
4108
|
if (window.innerWidth >= 768) {
|
|
3995
4109
|
setIsSidebarOpen(true);
|
|
3996
4110
|
}
|
|
3997
4111
|
}, []);
|
|
3998
|
-
const [isModalOpen, setIsModalOpen] =
|
|
3999
|
-
const [selectedEvent, setSelectedEvent] =
|
|
4000
|
-
const [modalInitialDate, setModalInitialDate] =
|
|
4112
|
+
const [isModalOpen, setIsModalOpen] = React18.useState(false);
|
|
4113
|
+
const [selectedEvent, setSelectedEvent] = React18.useState(null);
|
|
4114
|
+
const [modalInitialDate, setModalInitialDate] = React18.useState(void 0);
|
|
4001
4115
|
const view = controlledView ?? internalView;
|
|
4002
4116
|
const currentDate = controlledDate ?? internalDate;
|
|
4003
|
-
const expandedEvents =
|
|
4117
|
+
const expandedEvents = React18.useMemo(() => {
|
|
4004
4118
|
const allEvents = [];
|
|
4005
4119
|
const rangeStart = dateFns.subDays(currentDate, 365);
|
|
4006
4120
|
const rangeEnd = dateFns.addDays(currentDate, 365);
|
|
@@ -4235,9 +4349,9 @@ var useSwipeGesture = (options) => {
|
|
|
4235
4349
|
allowedTime = 500,
|
|
4236
4350
|
enabled = true
|
|
4237
4351
|
} = options;
|
|
4238
|
-
const touchInfoRef =
|
|
4239
|
-
const elementRef =
|
|
4240
|
-
const handleTouchStart =
|
|
4352
|
+
const touchInfoRef = React18.useRef(null);
|
|
4353
|
+
const elementRef = React18.useRef(null);
|
|
4354
|
+
const handleTouchStart = React18.useCallback((e) => {
|
|
4241
4355
|
if (!enabled) return;
|
|
4242
4356
|
const touch = e.touches[0];
|
|
4243
4357
|
touchInfoRef.current = {
|
|
@@ -4246,7 +4360,7 @@ var useSwipeGesture = (options) => {
|
|
|
4246
4360
|
startTime: Date.now()
|
|
4247
4361
|
};
|
|
4248
4362
|
}, [enabled]);
|
|
4249
|
-
const handleTouchEnd =
|
|
4363
|
+
const handleTouchEnd = React18.useCallback((e) => {
|
|
4250
4364
|
if (!enabled || !touchInfoRef.current) return;
|
|
4251
4365
|
const touch = e.changedTouches[0];
|
|
4252
4366
|
const { startX, startY, startTime } = touchInfoRef.current;
|
|
@@ -4270,7 +4384,7 @@ var useSwipeGesture = (options) => {
|
|
|
4270
4384
|
}
|
|
4271
4385
|
touchInfoRef.current = null;
|
|
4272
4386
|
}, [enabled, threshold, restraint, allowedTime, onSwipeLeft, onSwipeRight, onSwipeUp, onSwipeDown]);
|
|
4273
|
-
|
|
4387
|
+
React18.useEffect(() => {
|
|
4274
4388
|
const element = elementRef.current;
|
|
4275
4389
|
if (!element) return;
|
|
4276
4390
|
element.addEventListener("touchstart", handleTouchStart, { passive: true });
|
|
@@ -4326,6 +4440,7 @@ var Scheduler = ({
|
|
|
4326
4440
|
hideViewSwitcher,
|
|
4327
4441
|
hideLanguageSwitcher,
|
|
4328
4442
|
hideFab = false,
|
|
4443
|
+
compactShortEvents = true,
|
|
4329
4444
|
initialScrollHour = 8,
|
|
4330
4445
|
reverseTime: reverseTimeProp = false,
|
|
4331
4446
|
language = "tr",
|
|
@@ -4335,10 +4450,10 @@ var Scheduler = ({
|
|
|
4335
4450
|
sidebarMenus,
|
|
4336
4451
|
customViews
|
|
4337
4452
|
}) => {
|
|
4338
|
-
const [activeCustomMenu, setActiveCustomMenu] =
|
|
4339
|
-
const [activeCustomViewId, setActiveCustomViewId] =
|
|
4453
|
+
const [activeCustomMenu, setActiveCustomMenu] = React18.useState(null);
|
|
4454
|
+
const [activeCustomViewId, setActiveCustomViewId] = React18.useState(null);
|
|
4340
4455
|
const REVERSE_TIME_KEY = "calendarkit:reverseTime";
|
|
4341
|
-
const [reverseTime, setReverseTime] =
|
|
4456
|
+
const [reverseTime, setReverseTime] = React18.useState(() => {
|
|
4342
4457
|
try {
|
|
4343
4458
|
const stored = localStorage.getItem(REVERSE_TIME_KEY);
|
|
4344
4459
|
return stored !== null ? stored === "true" : reverseTimeProp;
|
|
@@ -4346,21 +4461,21 @@ var Scheduler = ({
|
|
|
4346
4461
|
return reverseTimeProp;
|
|
4347
4462
|
}
|
|
4348
4463
|
});
|
|
4349
|
-
|
|
4464
|
+
React18.useEffect(() => {
|
|
4350
4465
|
try {
|
|
4351
4466
|
localStorage.setItem(REVERSE_TIME_KEY, String(reverseTime));
|
|
4352
4467
|
} catch {
|
|
4353
4468
|
}
|
|
4354
4469
|
}, [reverseTime]);
|
|
4355
|
-
const [activeDragEvent, setActiveDragEvent] =
|
|
4356
|
-
const schedulerRef =
|
|
4357
|
-
const [fabCssVars, setFabCssVars] =
|
|
4358
|
-
const [isMounted, setIsMounted] =
|
|
4359
|
-
const [isMobile, setIsMobile] =
|
|
4360
|
-
|
|
4470
|
+
const [activeDragEvent, setActiveDragEvent] = React18.useState(null);
|
|
4471
|
+
const schedulerRef = React18.useRef(null);
|
|
4472
|
+
const [fabCssVars, setFabCssVars] = React18.useState({});
|
|
4473
|
+
const [isMounted, setIsMounted] = React18.useState(false);
|
|
4474
|
+
const [isMobile, setIsMobile] = React18.useState(false);
|
|
4475
|
+
React18.useEffect(() => {
|
|
4361
4476
|
setIsMounted(true);
|
|
4362
4477
|
}, []);
|
|
4363
|
-
|
|
4478
|
+
React18.useEffect(() => {
|
|
4364
4479
|
if (!isMounted) return;
|
|
4365
4480
|
const mq = window.matchMedia("(max-width: 767px)");
|
|
4366
4481
|
const update = () => setIsMobile(mq.matches);
|
|
@@ -4368,7 +4483,7 @@ var Scheduler = ({
|
|
|
4368
4483
|
mq.addEventListener("change", update);
|
|
4369
4484
|
return () => mq.removeEventListener("change", update);
|
|
4370
4485
|
}, [isMounted]);
|
|
4371
|
-
const syncFabTheme =
|
|
4486
|
+
const syncFabTheme = React18.useCallback(() => {
|
|
4372
4487
|
const root = schedulerRef.current;
|
|
4373
4488
|
if (!root) return;
|
|
4374
4489
|
const cs = getComputedStyle(root);
|
|
@@ -4380,7 +4495,7 @@ var Scheduler = ({
|
|
|
4380
4495
|
});
|
|
4381
4496
|
setFabCssVars(next);
|
|
4382
4497
|
}, []);
|
|
4383
|
-
|
|
4498
|
+
React18.useEffect(() => {
|
|
4384
4499
|
if (!isMounted) return;
|
|
4385
4500
|
syncFabTheme();
|
|
4386
4501
|
}, [isMounted, theme, isDarkMode, syncFabTheme]);
|
|
@@ -4449,7 +4564,7 @@ var Scheduler = ({
|
|
|
4449
4564
|
});
|
|
4450
4565
|
}
|
|
4451
4566
|
};
|
|
4452
|
-
const id =
|
|
4567
|
+
const id = React18.useId();
|
|
4453
4568
|
const swipeRef = useViewSwipe(handlePrev, handleNext, true);
|
|
4454
4569
|
const t = getTranslations(language, translations ?? {});
|
|
4455
4570
|
const handleDragStart = (event) => {
|
|
@@ -4482,7 +4597,7 @@ var Scheduler = ({
|
|
|
4482
4597
|
}
|
|
4483
4598
|
return "150px";
|
|
4484
4599
|
};
|
|
4485
|
-
const filteredEvents =
|
|
4600
|
+
const filteredEvents = React18.useMemo(() => {
|
|
4486
4601
|
if (!calendars) return expandedEvents;
|
|
4487
4602
|
const activeCalendarIds = calendars.filter((c) => c.active !== false).map((c) => c.id);
|
|
4488
4603
|
return expandedEvents.filter((e) => {
|
|
@@ -4490,7 +4605,7 @@ var Scheduler = ({
|
|
|
4490
4605
|
return activeCalendarIds.includes(e.calendarId);
|
|
4491
4606
|
});
|
|
4492
4607
|
}, [expandedEvents, calendars]);
|
|
4493
|
-
const viewEventCount =
|
|
4608
|
+
const viewEventCount = React18.useMemo(() => {
|
|
4494
4609
|
let rangeStart;
|
|
4495
4610
|
let rangeEnd;
|
|
4496
4611
|
switch (view) {
|
|
@@ -4518,7 +4633,7 @@ var Scheduler = ({
|
|
|
4518
4633
|
(e) => e.start >= rangeStart && e.start <= rangeEnd
|
|
4519
4634
|
).length;
|
|
4520
4635
|
}, [filteredEvents, view, currentDate]);
|
|
4521
|
-
return /* @__PURE__ */
|
|
4636
|
+
return /* @__PURE__ */ React18__namespace.default.createElement(React18__namespace.default.Fragment, null, /* @__PURE__ */ React18__namespace.default.createElement(
|
|
4522
4637
|
core.DndContext,
|
|
4523
4638
|
{
|
|
4524
4639
|
id,
|
|
@@ -4527,7 +4642,7 @@ var Scheduler = ({
|
|
|
4527
4642
|
onDragEnd: onDragEndWrapper,
|
|
4528
4643
|
modifiers: modifiers$1
|
|
4529
4644
|
},
|
|
4530
|
-
/* @__PURE__ */
|
|
4645
|
+
/* @__PURE__ */ React18__namespace.default.createElement(
|
|
4531
4646
|
"div",
|
|
4532
4647
|
{
|
|
4533
4648
|
ref: schedulerRef,
|
|
@@ -4549,7 +4664,7 @@ var Scheduler = ({
|
|
|
4549
4664
|
isDarkMode,
|
|
4550
4665
|
onThemeToggle
|
|
4551
4666
|
})
|
|
4552
|
-
) : /* @__PURE__ */
|
|
4667
|
+
) : /* @__PURE__ */ React18__namespace.default.createElement(
|
|
4553
4668
|
CalendarHeader,
|
|
4554
4669
|
{
|
|
4555
4670
|
currentDate,
|
|
@@ -4577,7 +4692,7 @@ var Scheduler = ({
|
|
|
4577
4692
|
hideLanguageSwitcher
|
|
4578
4693
|
}
|
|
4579
4694
|
),
|
|
4580
|
-
/* @__PURE__ */
|
|
4695
|
+
/* @__PURE__ */ React18__namespace.default.createElement("div", { className: "flex flex-1 overflow-hidden" }, /* @__PURE__ */ React18__namespace.default.createElement(
|
|
4581
4696
|
framerMotion.motion.div,
|
|
4582
4697
|
{
|
|
4583
4698
|
className: "hidden md:block overflow-hidden shrink-0",
|
|
@@ -4591,7 +4706,7 @@ var Scheduler = ({
|
|
|
4591
4706
|
ease: [0.4, 0, 0.2, 1]
|
|
4592
4707
|
}
|
|
4593
4708
|
},
|
|
4594
|
-
/* @__PURE__ */
|
|
4709
|
+
/* @__PURE__ */ React18__namespace.default.createElement(
|
|
4595
4710
|
Sidebar,
|
|
4596
4711
|
{
|
|
4597
4712
|
currentDate,
|
|
@@ -4623,7 +4738,7 @@ var Scheduler = ({
|
|
|
4623
4738
|
}
|
|
4624
4739
|
}
|
|
4625
4740
|
)
|
|
4626
|
-
), /* @__PURE__ */
|
|
4741
|
+
), /* @__PURE__ */ React18__namespace.default.createElement(framerMotion.AnimatePresence, null, isSidebarOpen && /* @__PURE__ */ React18__namespace.default.createElement(
|
|
4627
4742
|
framerMotion.motion.div,
|
|
4628
4743
|
{
|
|
4629
4744
|
key: "mobile-sidebar-overlay",
|
|
@@ -4633,7 +4748,7 @@ var Scheduler = ({
|
|
|
4633
4748
|
exit: { opacity: 0 },
|
|
4634
4749
|
transition: { duration: 0.2 }
|
|
4635
4750
|
},
|
|
4636
|
-
/* @__PURE__ */
|
|
4751
|
+
/* @__PURE__ */ React18__namespace.default.createElement(
|
|
4637
4752
|
framerMotion.motion.div,
|
|
4638
4753
|
{
|
|
4639
4754
|
className: "w-[280px] h-full bg-background shadow-2xl overflow-hidden",
|
|
@@ -4642,7 +4757,7 @@ var Scheduler = ({
|
|
|
4642
4757
|
exit: { x: -280 },
|
|
4643
4758
|
transition: { duration: 0.25, ease: [0.4, 0, 0.2, 1] }
|
|
4644
4759
|
},
|
|
4645
|
-
/* @__PURE__ */
|
|
4760
|
+
/* @__PURE__ */ React18__namespace.default.createElement(
|
|
4646
4761
|
Sidebar,
|
|
4647
4762
|
{
|
|
4648
4763
|
currentDate,
|
|
@@ -4680,16 +4795,16 @@ var Scheduler = ({
|
|
|
4680
4795
|
}
|
|
4681
4796
|
)
|
|
4682
4797
|
),
|
|
4683
|
-
/* @__PURE__ */
|
|
4798
|
+
/* @__PURE__ */ React18__namespace.default.createElement(
|
|
4684
4799
|
framerMotion.motion.div,
|
|
4685
4800
|
{
|
|
4686
4801
|
className: "flex-1 bg-black/50 backdrop-blur-sm",
|
|
4687
4802
|
onClick: () => setIsSidebarOpen(false)
|
|
4688
4803
|
}
|
|
4689
4804
|
)
|
|
4690
|
-
)), /* @__PURE__ */
|
|
4805
|
+
)), /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "flex-1 flex flex-col overflow-hidden relative min-h-0" }, activeCustomMenu !== null && sidebarMenus && /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "flex-1 overflow-y-auto p-4 md:p-6" }, sidebarMenus.find((m) => m.id === activeCustomMenu)?.component), activeCustomViewId !== null && activeCustomMenu === null && customViews && /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "flex-1 overflow-y-auto p-4 md:p-6" }, customViews.find((v) => v.id === activeCustomViewId)?.component), activeCustomMenu === null && activeCustomViewId === null && (isLoading ? /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "flex-1 overflow-auto p-0 md:p-4 min-h-0" }, /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "h-full min-w-full" }, view === "month" && /* @__PURE__ */ React18__namespace.default.createElement(MonthViewSkeleton, null), view === "week" && /* @__PURE__ */ React18__namespace.default.createElement(WeekViewSkeleton, null), view === "day" && /* @__PURE__ */ React18__namespace.default.createElement(DayViewSkeleton, null), view === "agenda" && /* @__PURE__ */ React18__namespace.default.createElement(AgendaViewSkeleton, null), view === "resource" && /* @__PURE__ */ React18__namespace.default.createElement(WeekViewSkeleton, null))) : (
|
|
4691
4806
|
/* overflow-hidden here: each view owns its own scroll container */
|
|
4692
|
-
/* @__PURE__ */
|
|
4807
|
+
/* @__PURE__ */ React18__namespace.default.createElement("div", { ref: swipeRef, className: "flex-1 overflow-hidden p-0 md:p-4 touch-pan-y min-h-0" }, /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "flex flex-col h-full min-w-full min-h-0" }, /* @__PURE__ */ React18__namespace.default.createElement(framerMotion.AnimatePresence, { mode: "wait", initial: false }, /* @__PURE__ */ React18__namespace.default.createElement(
|
|
4693
4808
|
framerMotion.motion.div,
|
|
4694
4809
|
{
|
|
4695
4810
|
key: `${view}-${currentDate.toISOString()}-${timezone || "local"}`,
|
|
@@ -4713,7 +4828,7 @@ var Scheduler = ({
|
|
|
4713
4828
|
className: "flex-1 min-h-0 flex flex-col",
|
|
4714
4829
|
style: { height: "100%" }
|
|
4715
4830
|
},
|
|
4716
|
-
view === "month" && /* @__PURE__ */
|
|
4831
|
+
view === "month" && /* @__PURE__ */ React18__namespace.default.createElement(
|
|
4717
4832
|
MonthView,
|
|
4718
4833
|
{
|
|
4719
4834
|
currentDate,
|
|
@@ -4724,7 +4839,7 @@ var Scheduler = ({
|
|
|
4724
4839
|
locale
|
|
4725
4840
|
}
|
|
4726
4841
|
),
|
|
4727
|
-
view === "week" && /* @__PURE__ */
|
|
4842
|
+
view === "week" && /* @__PURE__ */ React18__namespace.default.createElement(
|
|
4728
4843
|
WeekView,
|
|
4729
4844
|
{
|
|
4730
4845
|
currentDate,
|
|
@@ -4737,10 +4852,11 @@ var Scheduler = ({
|
|
|
4737
4852
|
readonly: readOnly,
|
|
4738
4853
|
language,
|
|
4739
4854
|
initialScrollHour,
|
|
4740
|
-
reverseTime
|
|
4855
|
+
reverseTime,
|
|
4856
|
+
compactShortEvents
|
|
4741
4857
|
}
|
|
4742
4858
|
),
|
|
4743
|
-
view === "day" && /* @__PURE__ */
|
|
4859
|
+
view === "day" && /* @__PURE__ */ React18__namespace.default.createElement(
|
|
4744
4860
|
DayView,
|
|
4745
4861
|
{
|
|
4746
4862
|
currentDate,
|
|
@@ -4753,10 +4869,11 @@ var Scheduler = ({
|
|
|
4753
4869
|
readonly: readOnly,
|
|
4754
4870
|
language,
|
|
4755
4871
|
initialScrollHour,
|
|
4756
|
-
reverseTime
|
|
4872
|
+
reverseTime,
|
|
4873
|
+
compactShortEvents
|
|
4757
4874
|
}
|
|
4758
4875
|
),
|
|
4759
|
-
view === "agenda" && /* @__PURE__ */
|
|
4876
|
+
view === "agenda" && /* @__PURE__ */ React18__namespace.default.createElement(
|
|
4760
4877
|
AgendaView,
|
|
4761
4878
|
{
|
|
4762
4879
|
currentDate,
|
|
@@ -4768,7 +4885,7 @@ var Scheduler = ({
|
|
|
4768
4885
|
renderEmptyState
|
|
4769
4886
|
}
|
|
4770
4887
|
),
|
|
4771
|
-
view === "resource" && resources && /* @__PURE__ */
|
|
4888
|
+
view === "resource" && resources && /* @__PURE__ */ React18__namespace.default.createElement(
|
|
4772
4889
|
ResourceView,
|
|
4773
4890
|
{
|
|
4774
4891
|
currentDate,
|
|
@@ -4792,7 +4909,7 @@ var Scheduler = ({
|
|
|
4792
4909
|
initialDate: modalInitialDate,
|
|
4793
4910
|
onSave: handleModalSave,
|
|
4794
4911
|
onDelete: handleModalDelete
|
|
4795
|
-
}) : /* @__PURE__ */
|
|
4912
|
+
}) : /* @__PURE__ */ React18__namespace.default.createElement(
|
|
4796
4913
|
EventModal,
|
|
4797
4914
|
{
|
|
4798
4915
|
isOpen: isModalOpen,
|
|
@@ -4807,7 +4924,7 @@ var Scheduler = ({
|
|
|
4807
4924
|
language
|
|
4808
4925
|
}
|
|
4809
4926
|
),
|
|
4810
|
-
/* @__PURE__ */
|
|
4927
|
+
/* @__PURE__ */ React18__namespace.default.createElement(
|
|
4811
4928
|
EventContextMenu,
|
|
4812
4929
|
{
|
|
4813
4930
|
event: contextMenuEvent,
|
|
@@ -4840,7 +4957,7 @@ var Scheduler = ({
|
|
|
4840
4957
|
}
|
|
4841
4958
|
}
|
|
4842
4959
|
),
|
|
4843
|
-
/* @__PURE__ */
|
|
4960
|
+
/* @__PURE__ */ React18__namespace.default.createElement(core.DragOverlay, { dropAnimation: null }, activeDragEvent ? /* @__PURE__ */ React18__namespace.default.createElement(
|
|
4844
4961
|
"div",
|
|
4845
4962
|
{
|
|
4846
4963
|
className: cn(
|
|
@@ -4858,17 +4975,17 @@ var Scheduler = ({
|
|
|
4858
4975
|
transform: "rotate(-2deg) scale(1.02)"
|
|
4859
4976
|
}
|
|
4860
4977
|
},
|
|
4861
|
-
/* @__PURE__ */
|
|
4978
|
+
/* @__PURE__ */ React18__namespace.default.createElement("div", { className: "p-2.5 h-full flex flex-col" }, /* @__PURE__ */ React18__namespace.default.createElement(
|
|
4862
4979
|
"div",
|
|
4863
4980
|
{
|
|
4864
4981
|
className: "absolute left-0 top-0 bottom-0 w-1 rounded-l-lg",
|
|
4865
4982
|
style: { backgroundColor: activeDragEvent.color || "var(--primary)" }
|
|
4866
4983
|
}
|
|
4867
|
-
), /* @__PURE__ */
|
|
4984
|
+
), /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "pl-2" }, /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "font-semibold truncate text-sm" }, activeDragEvent.title), (view === "week" || view === "day") && getDragHeight() && getDragHeight() > 40 && /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "text-xs opacity-80 mt-0.5 flex items-center gap-1" }, /* @__PURE__ */ React18__namespace.default.createElement("svg", { className: "w-3 h-3", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2" }, /* @__PURE__ */ React18__namespace.default.createElement("circle", { cx: "12", cy: "12", r: "10" }), /* @__PURE__ */ React18__namespace.default.createElement("path", { d: "M12 6v6l4 2" })), dateFns.format(activeDragEvent.start, getTimeFormatFull(language)), " - ", dateFns.format(activeDragEvent.end, getTimeFormatFull(language)))), /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "absolute bottom-1.5 right-1.5 opacity-60" }, /* @__PURE__ */ React18__namespace.default.createElement("svg", { className: "w-4 h-4", viewBox: "0 0 24 24", fill: "currentColor" }, /* @__PURE__ */ React18__namespace.default.createElement("circle", { cx: "9", cy: "5", r: "1.5" }), /* @__PURE__ */ React18__namespace.default.createElement("circle", { cx: "15", cy: "5", r: "1.5" }), /* @__PURE__ */ React18__namespace.default.createElement("circle", { cx: "9", cy: "12", r: "1.5" }), /* @__PURE__ */ React18__namespace.default.createElement("circle", { cx: "15", cy: "12", r: "1.5" }), /* @__PURE__ */ React18__namespace.default.createElement("circle", { cx: "9", cy: "19", r: "1.5" }), /* @__PURE__ */ React18__namespace.default.createElement("circle", { cx: "15", cy: "19", r: "1.5" }))))
|
|
4868
4985
|
) : null)
|
|
4869
4986
|
)
|
|
4870
4987
|
), isMounted && isMobile && !readOnly && !hideFab && reactDom.createPortal(
|
|
4871
|
-
/* @__PURE__ */
|
|
4988
|
+
/* @__PURE__ */ React18__namespace.default.createElement(
|
|
4872
4989
|
"div",
|
|
4873
4990
|
{
|
|
4874
4991
|
style: {
|
|
@@ -4880,7 +4997,7 @@ var Scheduler = ({
|
|
|
4880
4997
|
...fabCssVars
|
|
4881
4998
|
}
|
|
4882
4999
|
},
|
|
4883
|
-
/* @__PURE__ */
|
|
5000
|
+
/* @__PURE__ */ React18__namespace.default.createElement(
|
|
4884
5001
|
"button",
|
|
4885
5002
|
{
|
|
4886
5003
|
type: "button",
|
|
@@ -4901,7 +5018,7 @@ var Scheduler = ({
|
|
|
4901
5018
|
boxShadow: "0 10px 25px -5px rgba(0, 0, 0, 0.25)"
|
|
4902
5019
|
}
|
|
4903
5020
|
},
|
|
4904
|
-
/* @__PURE__ */
|
|
5021
|
+
/* @__PURE__ */ React18__namespace.default.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ React18__namespace.default.createElement("path", { d: "M5 12h14" }), /* @__PURE__ */ React18__namespace.default.createElement("path", { d: "M12 5v14" }))
|
|
4905
5022
|
)
|
|
4906
5023
|
),
|
|
4907
5024
|
document.body
|