react-os-shell 4.8.0 → 4.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{Browser-5ML7UNZG.js → Browser-7AQ7Y4Z7.js} +6 -6
- package/dist/{Browser-5ML7UNZG.js.map → Browser-7AQ7Y4Z7.js.map} +1 -1
- package/dist/{Calculator-APBKAUZ5.js → Calculator-B7KJQ2NF.js} +5 -5
- package/dist/{Calculator-APBKAUZ5.js.map → Calculator-B7KJQ2NF.js.map} +1 -1
- package/dist/ConfirmDialog-U5H3MP3M.js +4 -0
- package/dist/{ConfirmDialog-LO5WHLMD.js.map → ConfirmDialog-U5H3MP3M.js.map} +1 -1
- package/dist/{CurrencyConverter-YOWLTKY7.js → CurrencyConverter-AILEZUIU.js} +5 -5
- package/dist/{CurrencyConverter-YOWLTKY7.js.map → CurrencyConverter-AILEZUIU.js.map} +1 -1
- package/dist/{Documents-TGBZ4E2R.js → Documents-IX6JISOV.js} +6 -6
- package/dist/{Documents-TGBZ4E2R.js.map → Documents-IX6JISOV.js.map} +1 -1
- package/dist/{Files-LR5EBBSX.js → Files-O7WK4TQG.js} +8 -8
- package/dist/{Files-LR5EBBSX.js.map → Files-O7WK4TQG.js.map} +1 -1
- package/dist/{Notepad-HMTNO6IE.js → Notepad-LO7FRU34.js} +6 -6
- package/dist/{Notepad-HMTNO6IE.js.map → Notepad-LO7FRU34.js.map} +1 -1
- package/dist/{PomodoroTimer-NA3LPTTY.js → PomodoroTimer-DSVXJ7D4.js} +6 -6
- package/dist/{PomodoroTimer-NA3LPTTY.js.map → PomodoroTimer-DSVXJ7D4.js.map} +1 -1
- package/dist/{Preview-LXCNGCIK.js → Preview-QCAN5EU3.js} +6 -6
- package/dist/{Preview-LXCNGCIK.js.map → Preview-QCAN5EU3.js.map} +1 -1
- package/dist/{Sidebar-E553SOXC.js → Sidebar-ITLRERXE.js} +6 -5
- package/dist/Sidebar-ITLRERXE.js.map +1 -0
- package/dist/{Spreadsheet-VWUOANMV.js → Spreadsheet-SUP2H2B4.js} +6 -6
- package/dist/{Spreadsheet-VWUOANMV.js.map → Spreadsheet-SUP2H2B4.js.map} +1 -1
- package/dist/{Stock-OUVV3A7U.js → Stock-UT2JMEVS.js} +5 -5
- package/dist/{Stock-OUVV3A7U.js.map → Stock-UT2JMEVS.js.map} +1 -1
- package/dist/{Weather-INO44ZWL.js → Weather-37TNIYWI.js} +5 -5
- package/dist/{Weather-INO44ZWL.js.map → Weather-37TNIYWI.js.map} +1 -1
- package/dist/{WorldClock-K5IOWZ62.js → WorldClock-EESGFXPN.js} +5 -5
- package/dist/{WorldClock-K5IOWZ62.js.map → WorldClock-EESGFXPN.js.map} +1 -1
- package/dist/apps/index.js +18 -18
- package/dist/{chunk-ITZB7RDX.js → chunk-BOTXJSDK.js} +3 -3
- package/dist/{chunk-ITZB7RDX.js.map → chunk-BOTXJSDK.js.map} +1 -1
- package/dist/{chunk-CKY62ZRU.js → chunk-G6AUDFI4.js} +4 -4
- package/dist/{chunk-CKY62ZRU.js.map → chunk-G6AUDFI4.js.map} +1 -1
- package/dist/{chunk-QAKURGOG.js → chunk-H5NDQZ4A.js} +3 -3
- package/dist/{chunk-QAKURGOG.js.map → chunk-H5NDQZ4A.js.map} +1 -1
- package/dist/{chunk-LBY7KH2W.js → chunk-HC6N2OXO.js} +3 -3
- package/dist/{chunk-LBY7KH2W.js.map → chunk-HC6N2OXO.js.map} +1 -1
- package/dist/{chunk-3NZSR3ZG.js → chunk-KILLK5UH.js} +3 -3
- package/dist/{chunk-3NZSR3ZG.js.map → chunk-KILLK5UH.js.map} +1 -1
- package/dist/chunk-NQTQPOT4.js +7 -0
- package/dist/{chunk-FLHS7RBG.js.map → chunk-NQTQPOT4.js.map} +1 -1
- package/dist/{chunk-DKDD5KXG.js → chunk-RVT2A2MO.js} +2 -2
- package/dist/chunk-RVT2A2MO.js.map +1 -0
- package/dist/{chunk-XRUVR7M7.js → chunk-TIKW3XWE.js} +5 -5
- package/dist/{chunk-XRUVR7M7.js.map → chunk-TIKW3XWE.js.map} +1 -1
- package/dist/{chunk-2Y6XUY65.js → chunk-UH3H3KAN.js} +3 -3
- package/dist/{chunk-2Y6XUY65.js.map → chunk-UH3H3KAN.js.map} +1 -1
- package/dist/index.d.ts +6 -0
- package/dist/index.js +179 -136
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/ConfirmDialog-LO5WHLMD.js +0 -4
- package/dist/Sidebar-E553SOXC.js.map +0 -1
- package/dist/chunk-DKDD5KXG.js.map +0 -1
- package/dist/chunk-FLHS7RBG.js +0 -7
package/dist/index.js
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
import { PREVIEW_OPENED_EVENT, openPreviewFile } from './chunk-DINNWYVB.js';
|
|
2
2
|
export { Breadcrumbs } from './chunk-DINNWYVB.js';
|
|
3
|
-
import { subscribePomo, getPomoSnapshot } from './chunk-
|
|
4
|
-
export { setShellTodoProvider } from './chunk-
|
|
3
|
+
import { subscribePomo, getPomoSnapshot } from './chunk-UH3H3KAN.js';
|
|
4
|
+
export { setShellTodoProvider } from './chunk-UH3H3KAN.js';
|
|
5
5
|
import { SidebarLayout } from './chunk-YG45DAUT.js';
|
|
6
6
|
export { SidebarLayout } from './chunk-YG45DAUT.js';
|
|
7
7
|
export { ImageAnnotator_default as ImageAnnotator } from './chunk-QU5L5ZYM.js';
|
|
8
8
|
import { toast_default } from './chunk-VENYVK3L.js';
|
|
9
9
|
export { toast_default as toast } from './chunk-VENYVK3L.js';
|
|
10
|
-
import { publishDesktopFolders, requestFilesTrashView, FolderGlyph, requestFilesDesktopFolderView, FileIconTile } from './chunk-
|
|
10
|
+
import { publishDesktopFolders, requestFilesTrashView, FolderGlyph, requestFilesDesktopFolderView, FileIconTile } from './chunk-H5NDQZ4A.js';
|
|
11
11
|
import { setPdfPreview } from './chunk-BV6SQ46N.js';
|
|
12
12
|
import { playNotification, playStartup, soundsEnabled, getSoundConfig, SOUND_PACK_KEYS, SOUND_PACKS, SOUND_TYPES, SOUND_TYPE_LABELS, setSoundForType, previewSound, setAllSounds, playLogout } from './chunk-D7PYW2QS.js';
|
|
13
|
-
import { useAuth } from './chunk-
|
|
14
|
-
export { setShellAuthBridge } from './chunk-
|
|
13
|
+
import { useAuth } from './chunk-KILLK5UH.js';
|
|
14
|
+
export { setShellAuthBridge } from './chunk-KILLK5UH.js';
|
|
15
15
|
import { EditableGrid } from './chunk-GP4Y3VCB.js';
|
|
16
16
|
export { EditableGrid } from './chunk-GP4Y3VCB.js';
|
|
17
17
|
import './chunk-4SQU5YV6.js';
|
|
18
|
-
import { APP_VERSION, VERSION } from './chunk-
|
|
19
|
-
export { VERSION } from './chunk-
|
|
20
|
-
import { registerModalEscapeInterceptor, useIsMobile, cancelWindowFront, requestWindowFront, useWindowManager, PopupMenu, PopupMenuLabel, PopupMenuDivider, PopupMenuItem, WINDOW_REGISTRY, isPageEntry, Modal, setPerfCollecting, drainPerfEvents, useShellPrefs, markMenuOpen, SIDEBAR_STRIP_W, forgetMaximizedWindowBoxes, ModalActions, useModalActive, client_default, LoadingSpinner, isShellApiClientConfigured, useUndo, CancelButton, setWindowPosition } from './chunk-
|
|
21
|
-
export { CancelButton, ConfirmProvider, CopyButton, DocFavStar, Modal, ModalActions, PopupMenu, PopupMenuDivider, PopupMenuItem, PopupMenuLabel, ShellPrefsProvider, UndoProvider, WindowCrashedFallback, WindowErrorBoundary, WindowManagerProvider, WindowTitle, beginWindowGesture, commitExposeHighlight, confirm, confirmDestructive, exitExposeMode, getActiveWindowRoute, getExposeHighlight, getWindowPosition, isEntityEntry, isPageEntry, markMenuOpen, prompt, registerModalEscapeInterceptor, requestWindowFront, setExposeHighlight, setShellApiClient, setShellWindowRegistry, setWindowDefaultPosition, setWindowPosition, subscribeExposeHighlight, toggleExposeMode, useIsActiveWindow, useLocalStoragePrefs, useModalActive, useShellPrefs, useUndo, useUndoable, useUndoableState, useWidgetSettings, useWindowManager, useWindowMenuItem, useWindowTitle } from './chunk-
|
|
22
|
-
import { glassStyle, startMenuCategories, navSections, isSection, GLASS_INPUT_BG, navIcons, isReachable, sectionIcons, useShellAuth, visibleChildren } from './chunk-
|
|
23
|
-
export { GLASS_DIVIDER, GLASS_INPUT_BG, ShellAuthProvider, glassStyle, setShellNavIcons, useShellAuth } from './chunk-
|
|
18
|
+
import { APP_VERSION, VERSION } from './chunk-NQTQPOT4.js';
|
|
19
|
+
export { VERSION } from './chunk-NQTQPOT4.js';
|
|
20
|
+
import { registerModalEscapeInterceptor, useIsMobile, cancelWindowFront, requestWindowFront, useWindowManager, PopupMenu, PopupMenuLabel, PopupMenuDivider, PopupMenuItem, WINDOW_REGISTRY, isPageEntry, Modal, setPerfCollecting, drainPerfEvents, useShellPrefs, markMenuOpen, SIDEBAR_STRIP_W, forgetMaximizedWindowBoxes, ModalActions, useModalActive, client_default, LoadingSpinner, isShellApiClientConfigured, useUndo, CancelButton, setWindowPosition } from './chunk-G6AUDFI4.js';
|
|
21
|
+
export { CancelButton, ConfirmProvider, CopyButton, DocFavStar, Modal, ModalActions, PopupMenu, PopupMenuDivider, PopupMenuItem, PopupMenuLabel, ShellPrefsProvider, UndoProvider, WindowCrashedFallback, WindowErrorBoundary, WindowManagerProvider, WindowTitle, beginWindowGesture, commitExposeHighlight, confirm, confirmDestructive, exitExposeMode, getActiveWindowRoute, getExposeHighlight, getWindowPosition, isEntityEntry, isPageEntry, markMenuOpen, prompt, registerModalEscapeInterceptor, requestWindowFront, setExposeHighlight, setShellApiClient, setShellWindowRegistry, setWindowDefaultPosition, setWindowPosition, subscribeExposeHighlight, toggleExposeMode, useIsActiveWindow, useLocalStoragePrefs, useModalActive, useShellPrefs, useUndo, useUndoable, useUndoableState, useWidgetSettings, useWindowManager, useWindowMenuItem, useWindowTitle } from './chunk-G6AUDFI4.js';
|
|
22
|
+
import { glassStyle, startMenuCategories, navSections, isSection, GLASS_INPUT_BG, navIcons, isReachable, sectionIcons, useShellAuth, visibleChildren } from './chunk-RVT2A2MO.js';
|
|
23
|
+
export { GLASS_DIVIDER, GLASS_INPUT_BG, ShellAuthProvider, glassStyle, setShellNavIcons, useShellAuth } from './chunk-RVT2A2MO.js';
|
|
24
24
|
import { createContext, lazy, forwardRef, useCallback, useState, useRef, useId, useEffect, useLayoutEffect, useSyncExternalStore, useMemo, useContext, isValidElement, cloneElement, Suspense, Fragment as Fragment$1, Children } from 'react';
|
|
25
25
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
26
26
|
import { Dialog, DialogBackdrop, DialogPanel } from '@headlessui/react';
|
|
@@ -3809,18 +3809,21 @@ function StartMenu({
|
|
|
3809
3809
|
const items = getVisibleItems(section);
|
|
3810
3810
|
if (items.length === 0) return null;
|
|
3811
3811
|
const isHovered = hoveredSection === section.label;
|
|
3812
|
-
return /* @__PURE__ */
|
|
3812
|
+
return /* @__PURE__ */ jsxs(
|
|
3813
3813
|
"div",
|
|
3814
3814
|
{
|
|
3815
3815
|
onMouseEnter: (e) => handleSectionHover(section.label, e),
|
|
3816
3816
|
onMouseLeave: () => {
|
|
3817
3817
|
hoverTimeout.current = setTimeout(() => setHoveredSection(null), 200);
|
|
3818
3818
|
},
|
|
3819
|
-
children:
|
|
3820
|
-
|
|
3821
|
-
|
|
3822
|
-
|
|
3823
|
-
|
|
3819
|
+
children: [
|
|
3820
|
+
/* @__PURE__ */ jsxs("button", { className: `${itemCls} transition-colors ${isHovered ? "bg-blue-50 text-blue-700" : "text-gray-700 hover:bg-blue-50 hover:text-blue-700"}`, children: [
|
|
3821
|
+
secIcon(section.label),
|
|
3822
|
+
/* @__PURE__ */ jsx("span", { className: isErp ? "font-medium" : "", children: section.label }),
|
|
3823
|
+
/* @__PURE__ */ jsx("svg", { className: "h-3.5 w-3.5 ml-auto text-gray-500", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8.25 4.5l7.5 7.5-7.5 7.5" }) })
|
|
3824
|
+
] }),
|
|
3825
|
+
section.dividerAfter && /* @__PURE__ */ jsx("div", { className: "border-t border-white/20 my-1.5 mx-2" })
|
|
3826
|
+
]
|
|
3824
3827
|
},
|
|
3825
3828
|
section.label
|
|
3826
3829
|
);
|
|
@@ -4141,7 +4144,7 @@ function MobileAppLanding({
|
|
|
4141
4144
|
}
|
|
4142
4145
|
);
|
|
4143
4146
|
}
|
|
4144
|
-
var Sidebar = lazy(() => import('./Sidebar-
|
|
4147
|
+
var Sidebar = lazy(() => import('./Sidebar-ITLRERXE.js'));
|
|
4145
4148
|
function useFavorites(wallpapers) {
|
|
4146
4149
|
const { prefs, save } = useShellPrefs();
|
|
4147
4150
|
const favorites = prefs.favorite_pages || [];
|
|
@@ -7607,6 +7610,18 @@ var MONTH_NAMES = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep"
|
|
|
7607
7610
|
var YEARS_PER_PAGE = 12;
|
|
7608
7611
|
var yearPageStart = (y) => Math.floor(y / YEARS_PER_PAGE) * YEARS_PER_PAGE;
|
|
7609
7612
|
var pad = (n) => String(n).padStart(2, "0");
|
|
7613
|
+
var EDGE_MARGIN = 8;
|
|
7614
|
+
function clipBounds(el) {
|
|
7615
|
+
for (let node = el.parentElement; node; node = node.parentElement) {
|
|
7616
|
+
const style = getComputedStyle(node);
|
|
7617
|
+
const overflowX = style.overflowX || style.overflow;
|
|
7618
|
+
if (overflowX && overflowX !== "visible") {
|
|
7619
|
+
const rect = node.getBoundingClientRect();
|
|
7620
|
+
if (rect.width > 0) return { left: rect.left, right: rect.right };
|
|
7621
|
+
}
|
|
7622
|
+
}
|
|
7623
|
+
return { left: 0, right: window.innerWidth };
|
|
7624
|
+
}
|
|
7610
7625
|
function toISODate2(d) {
|
|
7611
7626
|
return `${d.getFullYear()}-${pad(d.getMonth() + 1)}-${pad(d.getDate())}`;
|
|
7612
7627
|
}
|
|
@@ -7631,6 +7646,8 @@ function DateRangePicker({
|
|
|
7631
7646
|
const [tempTo, setTempTo] = useState(to);
|
|
7632
7647
|
const [activePreset, setActivePreset] = useState(null);
|
|
7633
7648
|
const ref = useRef(null);
|
|
7649
|
+
const panelRef = useRef(null);
|
|
7650
|
+
const [align, setAlign] = useState("left");
|
|
7634
7651
|
const now = /* @__PURE__ */ new Date();
|
|
7635
7652
|
const [month, setMonth] = useState(from ? parseDate(from).getMonth() : now.getMonth());
|
|
7636
7653
|
const [year, setYear] = useState(from ? parseDate(from).getFullYear() : now.getFullYear());
|
|
@@ -7640,6 +7657,22 @@ function DateRangePicker({
|
|
|
7640
7657
|
useClickOutside(ref, useCallback(() => {
|
|
7641
7658
|
if (open) setOpen(false);
|
|
7642
7659
|
}, [open]));
|
|
7660
|
+
useLayoutEffect(() => {
|
|
7661
|
+
if (!open) return;
|
|
7662
|
+
const place = () => {
|
|
7663
|
+
const anchor = ref.current, panel = panelRef.current;
|
|
7664
|
+
if (!anchor || !panel) return;
|
|
7665
|
+
const trigger = anchor.getBoundingClientRect();
|
|
7666
|
+
const width = panel.getBoundingClientRect().width;
|
|
7667
|
+
const bounds = clipBounds(anchor);
|
|
7668
|
+
const fitsLeftAligned = trigger.left + width <= bounds.right - EDGE_MARGIN;
|
|
7669
|
+
const fitsRightAligned = trigger.right - width >= bounds.left + EDGE_MARGIN;
|
|
7670
|
+
setAlign(fitsLeftAligned || !fitsRightAligned ? "left" : "right");
|
|
7671
|
+
};
|
|
7672
|
+
place();
|
|
7673
|
+
window.addEventListener("resize", place);
|
|
7674
|
+
return () => window.removeEventListener("resize", place);
|
|
7675
|
+
}, [open]);
|
|
7643
7676
|
const handleOpen = () => {
|
|
7644
7677
|
setTempFrom(from);
|
|
7645
7678
|
setTempTo(to);
|
|
@@ -7793,135 +7826,145 @@ function DateRangePicker({
|
|
|
7793
7826
|
]
|
|
7794
7827
|
}
|
|
7795
7828
|
),
|
|
7796
|
-
open && /* @__PURE__ */ jsxs(
|
|
7797
|
-
|
|
7798
|
-
|
|
7799
|
-
|
|
7800
|
-
|
|
7801
|
-
|
|
7802
|
-
|
|
7803
|
-
|
|
7804
|
-
|
|
7805
|
-
/* @__PURE__ */
|
|
7806
|
-
|
|
7807
|
-
|
|
7808
|
-
|
|
7809
|
-
/* @__PURE__ */ jsxs("div", { className: "w-64", children: [
|
|
7810
|
-
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between mb-2 px-1", children: [
|
|
7811
|
-
/* @__PURE__ */ jsx("button", { type: "button", onClick: () => handleStep(-1), "aria-label": "Previous", className: "p-1 rounded-full hover:bg-gray-100 text-gray-600", children: /* @__PURE__ */ jsx("svg", { className: "w-4 h-4", fill: "none", stroke: "currentColor", strokeWidth: "2", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 19l-7-7 7-7" }) }) }),
|
|
7812
|
-
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1 text-sm font-semibold text-gray-800", children: [
|
|
7813
|
-
view === "days" && /* @__PURE__ */ jsx(
|
|
7814
|
-
"button",
|
|
7815
|
-
{
|
|
7816
|
-
type: "button",
|
|
7817
|
-
onClick: () => setView("months"),
|
|
7818
|
-
className: "px-1.5 py-0.5 rounded-md hover:bg-gray-100 transition-colors",
|
|
7819
|
-
children: monthName
|
|
7820
|
-
}
|
|
7821
|
-
),
|
|
7822
|
-
view === "years" ? /* @__PURE__ */ jsxs("span", { className: "px-1.5 py-0.5", children: [
|
|
7823
|
-
yearPage,
|
|
7824
|
-
" \u2013 ",
|
|
7825
|
-
yearPage + YEARS_PER_PAGE - 1
|
|
7826
|
-
] }) : /* @__PURE__ */ jsx(
|
|
7827
|
-
"button",
|
|
7828
|
-
{
|
|
7829
|
-
type: "button",
|
|
7830
|
-
onClick: openYears,
|
|
7831
|
-
className: "px-1.5 py-0.5 rounded-md hover:bg-gray-100 transition-colors",
|
|
7832
|
-
children: year
|
|
7833
|
-
}
|
|
7834
|
-
)
|
|
7829
|
+
open && /* @__PURE__ */ jsxs(
|
|
7830
|
+
"div",
|
|
7831
|
+
{
|
|
7832
|
+
ref: panelRef,
|
|
7833
|
+
role: "dialog",
|
|
7834
|
+
"aria-label": "Date range",
|
|
7835
|
+
className: "absolute z-50 mt-1 rounded-2xl p-4",
|
|
7836
|
+
style: { ...align === "right" ? { right: 0 } : { left: 0 }, ...glassStyle() },
|
|
7837
|
+
children: [
|
|
7838
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3 mb-3", children: [
|
|
7839
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
7840
|
+
/* @__PURE__ */ jsx("span", { className: "text-xs font-medium text-gray-500", children: "From" }),
|
|
7841
|
+
/* @__PURE__ */ jsx("span", { className: `text-sm px-2 py-1 rounded border min-w-[90px] ${tempFrom ? "border-blue-300 bg-blue-50 text-blue-700" : "border-gray-200 bg-gray-50 text-gray-400"}`, children: tempFrom ? displayDate(tempFrom) : "Start" })
|
|
7835
7842
|
] }),
|
|
7836
|
-
/* @__PURE__ */ jsx("
|
|
7843
|
+
/* @__PURE__ */ jsx("span", { className: "text-gray-300", children: "\u2014" }),
|
|
7844
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
7845
|
+
/* @__PURE__ */ jsx("span", { className: "text-xs font-medium text-gray-500", children: "To" }),
|
|
7846
|
+
/* @__PURE__ */ jsx("span", { className: `text-sm px-2 py-1 rounded border min-w-[90px] ${tempTo ? "border-blue-300 bg-blue-50 text-blue-700" : "border-gray-200 bg-gray-50 text-gray-400"}`, children: tempTo ? displayDate(tempTo) : "End" })
|
|
7847
|
+
] })
|
|
7837
7848
|
] }),
|
|
7838
|
-
/* @__PURE__ */ jsxs("div", { className: "
|
|
7839
|
-
|
|
7840
|
-
/* @__PURE__ */
|
|
7841
|
-
|
|
7842
|
-
|
|
7843
|
-
|
|
7844
|
-
|
|
7845
|
-
|
|
7846
|
-
|
|
7847
|
-
|
|
7848
|
-
|
|
7849
|
-
|
|
7850
|
-
|
|
7851
|
-
|
|
7852
|
-
|
|
7853
|
-
|
|
7854
|
-
|
|
7855
|
-
|
|
7856
|
-
|
|
7849
|
+
/* @__PURE__ */ jsxs("div", { className: "flex gap-4", children: [
|
|
7850
|
+
/* @__PURE__ */ jsxs("div", { className: "w-64", children: [
|
|
7851
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between mb-2 px-1", children: [
|
|
7852
|
+
/* @__PURE__ */ jsx("button", { type: "button", onClick: () => handleStep(-1), "aria-label": "Previous", className: "p-1 rounded-full hover:bg-gray-100 text-gray-600", children: /* @__PURE__ */ jsx("svg", { className: "w-4 h-4", fill: "none", stroke: "currentColor", strokeWidth: "2", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 19l-7-7 7-7" }) }) }),
|
|
7853
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1 text-sm font-semibold text-gray-800", children: [
|
|
7854
|
+
view === "days" && /* @__PURE__ */ jsx(
|
|
7855
|
+
"button",
|
|
7856
|
+
{
|
|
7857
|
+
type: "button",
|
|
7858
|
+
onClick: () => setView("months"),
|
|
7859
|
+
className: "px-1.5 py-0.5 rounded-md hover:bg-gray-100 transition-colors",
|
|
7860
|
+
children: monthName
|
|
7861
|
+
}
|
|
7862
|
+
),
|
|
7863
|
+
view === "years" ? /* @__PURE__ */ jsxs("span", { className: "px-1.5 py-0.5", children: [
|
|
7864
|
+
yearPage,
|
|
7865
|
+
" \u2013 ",
|
|
7866
|
+
yearPage + YEARS_PER_PAGE - 1
|
|
7867
|
+
] }) : /* @__PURE__ */ jsx(
|
|
7868
|
+
"button",
|
|
7869
|
+
{
|
|
7870
|
+
type: "button",
|
|
7871
|
+
onClick: openYears,
|
|
7872
|
+
className: "px-1.5 py-0.5 rounded-md hover:bg-gray-100 transition-colors",
|
|
7873
|
+
children: year
|
|
7874
|
+
}
|
|
7875
|
+
)
|
|
7876
|
+
] }),
|
|
7877
|
+
/* @__PURE__ */ jsx("button", { type: "button", onClick: () => handleStep(1), "aria-label": "Next", className: "p-1 rounded-full hover:bg-gray-100 text-gray-600", children: /* @__PURE__ */ jsx("svg", { className: "w-4 h-4", fill: "none", stroke: "currentColor", strokeWidth: "2", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 5l7 7-7 7" }) }) })
|
|
7878
|
+
] }),
|
|
7879
|
+
/* @__PURE__ */ jsxs("div", { className: "min-h-[13.75rem]", children: [
|
|
7880
|
+
view === "days" && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
7881
|
+
/* @__PURE__ */ jsx("div", { className: "grid grid-cols-7 text-center text-xs font-medium text-gray-500 mb-1", children: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"].map((d) => /* @__PURE__ */ jsx("div", { className: "py-1", children: d }, d)) }),
|
|
7882
|
+
/* @__PURE__ */ jsx("div", { className: "grid grid-cols-7 text-center text-sm", children: cells.map((c, i) => {
|
|
7883
|
+
const isStart = c.date === tempFrom;
|
|
7884
|
+
const isEnd = c.date === tempTo;
|
|
7885
|
+
const isSelected = isStart || isEnd;
|
|
7886
|
+
const inRange = isInRange(c.date);
|
|
7887
|
+
return /* @__PURE__ */ jsx(
|
|
7888
|
+
"button",
|
|
7889
|
+
{
|
|
7890
|
+
type: "button",
|
|
7891
|
+
onClick: () => handleCalendarSelect(c.date),
|
|
7892
|
+
className: `py-1.5 rounded-md transition-colors ${!c.current ? "text-gray-300" : isSelected ? "bg-blue-600 text-white font-semibold" : inRange ? "bg-blue-100 text-blue-800" : "text-gray-700 hover:bg-gray-100"}`,
|
|
7893
|
+
children: c.day
|
|
7894
|
+
},
|
|
7895
|
+
i
|
|
7896
|
+
);
|
|
7897
|
+
}) })
|
|
7898
|
+
] }),
|
|
7899
|
+
view === "months" && /* @__PURE__ */ jsx("div", { className: "grid grid-cols-3 gap-1 text-center text-sm", children: MONTH_NAMES.map((name, m) => {
|
|
7900
|
+
const isCurrent = m === month;
|
|
7901
|
+
const isThisMonth = m === now.getMonth() && year === now.getFullYear();
|
|
7902
|
+
return /* @__PURE__ */ jsx(
|
|
7903
|
+
"button",
|
|
7904
|
+
{
|
|
7905
|
+
type: "button",
|
|
7906
|
+
onClick: () => selectMonth(m),
|
|
7907
|
+
className: `py-4 rounded-md transition-colors ${isCurrent ? "bg-blue-600 text-white font-semibold" : isThisMonth ? "text-blue-600 font-medium hover:bg-gray-100" : "text-gray-700 hover:bg-gray-100"}`,
|
|
7908
|
+
children: name
|
|
7909
|
+
},
|
|
7910
|
+
name
|
|
7911
|
+
);
|
|
7912
|
+
}) }),
|
|
7913
|
+
view === "years" && /* @__PURE__ */ jsx("div", { className: "grid grid-cols-3 gap-1 text-center text-sm", children: Array.from({ length: YEARS_PER_PAGE }, (_, i) => yearPage + i).map((y) => {
|
|
7914
|
+
const isCurrent = y === year;
|
|
7915
|
+
const isThisYear = y === now.getFullYear();
|
|
7916
|
+
return /* @__PURE__ */ jsx(
|
|
7917
|
+
"button",
|
|
7918
|
+
{
|
|
7919
|
+
type: "button",
|
|
7920
|
+
onClick: () => selectYear(y),
|
|
7921
|
+
className: `py-4 rounded-md transition-colors ${isCurrent ? "bg-blue-600 text-white font-semibold" : isThisYear ? "text-blue-600 font-medium hover:bg-gray-100" : "text-gray-700 hover:bg-gray-100"}`,
|
|
7922
|
+
children: y
|
|
7923
|
+
},
|
|
7924
|
+
y
|
|
7925
|
+
);
|
|
7926
|
+
}) })
|
|
7927
|
+
] })
|
|
7857
7928
|
] }),
|
|
7858
|
-
|
|
7859
|
-
|
|
7860
|
-
const isThisMonth = m === now.getMonth() && year === now.getFullYear();
|
|
7861
|
-
return /* @__PURE__ */ jsx(
|
|
7929
|
+
/* @__PURE__ */ jsxs("div", { className: "border-l border-gray-200 pl-4 flex flex-col gap-1 min-w-[130px]", children: [
|
|
7930
|
+
PRESET_LABELS.map((label) => /* @__PURE__ */ jsx(
|
|
7862
7931
|
"button",
|
|
7863
7932
|
{
|
|
7864
7933
|
type: "button",
|
|
7865
|
-
onClick: () =>
|
|
7866
|
-
className: `py-
|
|
7867
|
-
children:
|
|
7934
|
+
onClick: () => handlePreset(label),
|
|
7935
|
+
className: `text-left px-3 py-1.5 text-sm rounded-md transition-colors ${activePreset === label ? "bg-blue-50 text-blue-700 font-medium" : "text-gray-700 hover:bg-gray-50"}`,
|
|
7936
|
+
children: label
|
|
7868
7937
|
},
|
|
7869
|
-
|
|
7870
|
-
)
|
|
7871
|
-
|
|
7872
|
-
view === "years" && /* @__PURE__ */ jsx("div", { className: "grid grid-cols-3 gap-1 text-center text-sm", children: Array.from({ length: YEARS_PER_PAGE }, (_, i) => yearPage + i).map((y) => {
|
|
7873
|
-
const isCurrent = y === year;
|
|
7874
|
-
const isThisYear = y === now.getFullYear();
|
|
7875
|
-
return /* @__PURE__ */ jsx(
|
|
7938
|
+
label
|
|
7939
|
+
)),
|
|
7940
|
+
/* @__PURE__ */ jsx(
|
|
7876
7941
|
"button",
|
|
7877
7942
|
{
|
|
7878
7943
|
type: "button",
|
|
7879
|
-
onClick: () =>
|
|
7880
|
-
className: `py-
|
|
7881
|
-
children:
|
|
7882
|
-
}
|
|
7883
|
-
|
|
7884
|
-
|
|
7885
|
-
|
|
7944
|
+
onClick: () => setActivePreset("Custom"),
|
|
7945
|
+
className: `text-left px-3 py-1.5 text-sm rounded-md transition-colors ${activePreset === "Custom" ? "bg-blue-50 text-blue-700 font-medium" : "text-gray-700 hover:bg-gray-50"}`,
|
|
7946
|
+
children: "Custom"
|
|
7947
|
+
}
|
|
7948
|
+
)
|
|
7949
|
+
] })
|
|
7950
|
+
] }),
|
|
7951
|
+
/* @__PURE__ */ jsxs("div", { className: "flex justify-end gap-2 mt-4 pt-3 border-t border-gray-200", children: [
|
|
7952
|
+
clearable && /* @__PURE__ */ jsx("button", { type: "button", onClick: handleClear, className: "px-3 py-1.5 text-sm text-gray-500 hover:text-gray-700", children: "Clear" }),
|
|
7953
|
+
/* @__PURE__ */ jsx("button", { type: "button", onClick: () => setOpen(false), className: "px-3 py-1.5 text-sm text-gray-600 border border-gray-300 rounded-md hover:bg-gray-50", children: "Cancel" }),
|
|
7954
|
+
/* @__PURE__ */ jsx(
|
|
7955
|
+
"button",
|
|
7956
|
+
{
|
|
7957
|
+
type: "button",
|
|
7958
|
+
onClick: handleApply,
|
|
7959
|
+
disabled: !tempFrom || !tempTo,
|
|
7960
|
+
className: "px-4 py-1.5 text-sm font-medium text-white bg-blue-600 rounded-md hover:bg-blue-700 disabled:opacity-50",
|
|
7961
|
+
children: "Apply"
|
|
7962
|
+
}
|
|
7963
|
+
)
|
|
7886
7964
|
] })
|
|
7887
|
-
]
|
|
7888
|
-
|
|
7889
|
-
|
|
7890
|
-
"button",
|
|
7891
|
-
{
|
|
7892
|
-
type: "button",
|
|
7893
|
-
onClick: () => handlePreset(label),
|
|
7894
|
-
className: `text-left px-3 py-1.5 text-sm rounded-md transition-colors ${activePreset === label ? "bg-blue-50 text-blue-700 font-medium" : "text-gray-700 hover:bg-gray-50"}`,
|
|
7895
|
-
children: label
|
|
7896
|
-
},
|
|
7897
|
-
label
|
|
7898
|
-
)),
|
|
7899
|
-
/* @__PURE__ */ jsx(
|
|
7900
|
-
"button",
|
|
7901
|
-
{
|
|
7902
|
-
type: "button",
|
|
7903
|
-
onClick: () => setActivePreset("Custom"),
|
|
7904
|
-
className: `text-left px-3 py-1.5 text-sm rounded-md transition-colors ${activePreset === "Custom" ? "bg-blue-50 text-blue-700 font-medium" : "text-gray-700 hover:bg-gray-50"}`,
|
|
7905
|
-
children: "Custom"
|
|
7906
|
-
}
|
|
7907
|
-
)
|
|
7908
|
-
] })
|
|
7909
|
-
] }),
|
|
7910
|
-
/* @__PURE__ */ jsxs("div", { className: "flex justify-end gap-2 mt-4 pt-3 border-t border-gray-200", children: [
|
|
7911
|
-
clearable && /* @__PURE__ */ jsx("button", { type: "button", onClick: handleClear, className: "px-3 py-1.5 text-sm text-gray-500 hover:text-gray-700", children: "Clear" }),
|
|
7912
|
-
/* @__PURE__ */ jsx("button", { type: "button", onClick: () => setOpen(false), className: "px-3 py-1.5 text-sm text-gray-600 border border-gray-300 rounded-md hover:bg-gray-50", children: "Cancel" }),
|
|
7913
|
-
/* @__PURE__ */ jsx(
|
|
7914
|
-
"button",
|
|
7915
|
-
{
|
|
7916
|
-
type: "button",
|
|
7917
|
-
onClick: handleApply,
|
|
7918
|
-
disabled: !tempFrom || !tempTo,
|
|
7919
|
-
className: "px-4 py-1.5 text-sm font-medium text-white bg-blue-600 rounded-md hover:bg-blue-700 disabled:opacity-50",
|
|
7920
|
-
children: "Apply"
|
|
7921
|
-
}
|
|
7922
|
-
)
|
|
7923
|
-
] })
|
|
7924
|
-
] })
|
|
7965
|
+
]
|
|
7966
|
+
}
|
|
7967
|
+
)
|
|
7925
7968
|
] });
|
|
7926
7969
|
}
|
|
7927
7970
|
function Card({ children, header, footer, padded = true, className = "" }) {
|