@dxos/react-ui-calendar 0.8.4-main.d05539e30a → 0.8.4-main.d9fc60f731

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.
@@ -1,15 +1,17 @@
1
1
  // src/components/Calendar/Calendar.tsx
2
2
  import { createContext } from "@radix-ui/react-context";
3
- import { addDays, differenceInWeeks, format, startOfDay, startOfWeek } from "date-fns";
3
+ import { addDays, format, startOfDay, startOfWeek } from "date-fns";
4
4
  import React, { forwardRef, useCallback, useEffect, useImperativeHandle, useMemo, useRef, useState } from "react";
5
5
  import { useResizeDetector } from "react-resize-detector";
6
6
  import { List } from "react-virtualized";
7
7
  import { Event } from "@dxos/async";
8
8
  import { IconButton, useTranslation } from "@dxos/react-ui";
9
- import { composable, composableProps, mx } from "@dxos/ui-theme";
9
+ import { composable, composableProps } from "@dxos/react-ui";
10
+ import { mx } from "@dxos/ui-theme";
10
11
  import { translationKey } from "#translations";
11
12
 
12
13
  // src/components/Calendar/util.ts
14
+ import { differenceInCalendarDays } from "date-fns";
13
15
  var getDate = (start2, weekNumber, dayOfWeek, weekStartsOn) => {
14
16
  const result = new Date(start2);
15
17
  const startDayOfWeek = start2.getDay();
@@ -17,6 +19,13 @@ var getDate = (start2, weekNumber, dayOfWeek, weekStartsOn) => {
17
19
  result.setDate(start2.getDate() - adjustedStartDay + weekNumber * 7 + dayOfWeek);
18
20
  return result;
19
21
  };
22
+ var getRowIndex = (start2, date, weekStartsOn) => {
23
+ const startDayOfWeek = start2.getDay();
24
+ const adjustedStartDay = (startDayOfWeek === 0 ? 7 : startDayOfWeek) - weekStartsOn;
25
+ const row0Start = new Date(start2);
26
+ row0Start.setDate(start2.getDate() - adjustedStartDay);
27
+ return Math.floor(differenceInCalendarDays(date, row0Start) / 7);
28
+ };
20
29
  var isSameDay = (date1, date2) => {
21
30
  return !!date2 && date1.getFullYear() === date2.getFullYear() && date1.getMonth() === date2.getMonth() && date1.getDate() === date2.getDate();
22
31
  };
@@ -24,13 +33,46 @@ var isSameDay = (date1, date2) => {
24
33
  // src/components/Calendar/Calendar.tsx
25
34
  var maxRows = 50 * 100;
26
35
  var start = /* @__PURE__ */ new Date("1970-01-01");
27
- var size = 48;
36
+ var size = 40;
28
37
  var defaultWidth = 7 * size;
38
+ var EDGE_SCROLL_ZONE = 32;
39
+ var EDGE_SCROLL_MAX_SPEED = 12;
40
+ var makeRange = (a, b) => {
41
+ const dayA = startOfDay(a);
42
+ const dayB = startOfDay(b);
43
+ return dayA <= dayB ? {
44
+ from: dayA,
45
+ to: dayB
46
+ } : {
47
+ from: dayB,
48
+ to: dayA
49
+ };
50
+ };
51
+ var isInRange = (date, range) => {
52
+ if (!range) {
53
+ return false;
54
+ }
55
+ const day = startOfDay(date).getTime();
56
+ return day >= range.from.getTime() && day <= range.to.getTime();
57
+ };
58
+ var cellDate = (el) => {
59
+ let current = el;
60
+ while (current && current !== document.body) {
61
+ const iso = current.getAttribute?.("data-date");
62
+ if (iso) {
63
+ return new Date(iso);
64
+ }
65
+ current = current.parentElement;
66
+ }
67
+ return void 0;
68
+ };
29
69
  var [CalendarContextProvider, useCalendarContext] = createContext("Calendar");
30
70
  var CalendarRoot = /* @__PURE__ */ forwardRef(({ children, weekStartsOn = 1 }, forwardedRef) => {
31
71
  const event = useMemo(() => new Event(), []);
32
72
  const [selected, setSelected] = useState();
33
73
  const [index, setIndex] = useState();
74
+ const [range, setRange] = useState();
75
+ const [pendingRange, setPendingRange] = useState();
34
76
  useImperativeHandle(forwardedRef, () => ({
35
77
  scrollTo: (date) => {
36
78
  event.emit({
@@ -47,7 +89,11 @@ var CalendarRoot = /* @__PURE__ */ forwardRef(({ children, weekStartsOn = 1 }, f
47
89
  index,
48
90
  setIndex,
49
91
  selected,
50
- setSelected
92
+ setSelected,
93
+ range,
94
+ setRange,
95
+ pendingRange,
96
+ setPendingRange
51
97
  }, children);
52
98
  });
53
99
  var CALENDAR_TOOLBAR_NAME = "CalendarHeader";
@@ -98,11 +144,12 @@ var CalendarToolbar = composable(({ classNames, ...props }, forwardedRef) => {
98
144
  });
99
145
  CalendarToolbar.displayName = CALENDAR_TOOLBAR_NAME;
100
146
  var CALENDAR_GRID_NAME = "CalendarGrid";
101
- var CalendarGrid = composable(({ classNames, rows, dates = [], onSelect, ...props }, forwardedRef) => {
102
- const { weekStartsOn, event, setIndex, selected, setSelected } = useCalendarContext(CALENDAR_GRID_NAME);
147
+ var CalendarGrid = composable(({ classNames, rows, dates = [], initialDate, onSelect, onSelectRange, ...props }, forwardedRef) => {
148
+ const { weekStartsOn, event, setIndex, selected, setSelected, range, setRange, pendingRange, setPendingRange } = useCalendarContext(CALENDAR_GRID_NAME);
103
149
  const { ref: containerRef, width = 0, height = 0 } = useResizeDetector();
104
150
  const maxHeight = rows ? rows * size : void 0;
105
151
  const listRef = useRef(null);
152
+ const gridRef = useRef(null);
106
153
  const today = useMemo(() => /* @__PURE__ */ new Date(), []);
107
154
  const dateSet = useMemo(() => new Set(dates.map((date) => startOfDay(date).toISOString())), [
108
155
  dates
@@ -112,18 +159,20 @@ var CalendarGrid = composable(({ classNames, rows, dates = [], onSelect, ...prop
112
159
  ]);
113
160
  const [initialized, setInitialized] = useState(false);
114
161
  useEffect(() => {
115
- const index = differenceInWeeks(today, start);
162
+ const index = getRowIndex(start, initialDate ?? today, weekStartsOn);
116
163
  listRef.current?.scrollToRow(index);
117
164
  }, [
118
165
  initialized,
119
166
  start,
120
- today
167
+ today,
168
+ initialDate,
169
+ weekStartsOn
121
170
  ]);
122
171
  useEffect(() => {
123
172
  return event.on((event2) => {
124
173
  switch (event2.type) {
125
174
  case "scroll": {
126
- const index = differenceInWeeks(event2.date, start);
175
+ const index = getRowIndex(start, event2.date, weekStartsOn);
127
176
  listRef.current?.scrollToRow(index);
128
177
  break;
129
178
  }
@@ -143,19 +192,269 @@ var CalendarGrid = composable(({ classNames, rows, dates = [], onSelect, ...prop
143
192
  return format(day, "EEE");
144
193
  });
145
194
  }, []);
146
- const handleDaySelect = useCallback((date) => {
147
- setSelected((current) => isSameDay(date, current) ? void 0 : date);
148
- onSelect?.({
149
- date
195
+ const anchorRef = useRef(void 0);
196
+ const focusRef = useRef(void 0);
197
+ const draggingRef = useRef(false);
198
+ const pointerXRef = useRef(0);
199
+ const pointerYRef = useRef(0);
200
+ const scrollTopRef = useRef(0);
201
+ const scrollRafRef = useRef(void 0);
202
+ const scrollIntoView = useCallback((date) => {
203
+ const targetRow = getRowIndex(start, date, weekStartsOn);
204
+ const visibleHeight = maxHeight ?? height;
205
+ if (!visibleHeight) {
206
+ return;
207
+ }
208
+ const firstFullyVisibleRow = Math.ceil(scrollTopRef.current / size);
209
+ const lastFullyVisibleRow = Math.floor((scrollTopRef.current + visibleHeight) / size) - 1;
210
+ if (targetRow < firstFullyVisibleRow) {
211
+ listRef.current?.scrollToPosition(targetRow * size);
212
+ } else if (targetRow > lastFullyVisibleRow) {
213
+ listRef.current?.scrollToPosition(Math.max(0, (targetRow + 1) * size - visibleHeight));
214
+ }
215
+ }, [
216
+ height,
217
+ maxHeight,
218
+ weekStartsOn
219
+ ]);
220
+ const updateRangeFromAnchor = useCallback((focus, fireRange = false) => {
221
+ const anchor = anchorRef.current;
222
+ if (!anchor) {
223
+ return;
224
+ }
225
+ focusRef.current = focus;
226
+ if (isSameDay(anchor, focus)) {
227
+ setRange(void 0);
228
+ setSelected(anchor);
229
+ } else {
230
+ setSelected(void 0);
231
+ const committed = makeRange(anchor, focus);
232
+ setRange(committed);
233
+ if (fireRange) {
234
+ onSelectRange?.({
235
+ range: committed
236
+ });
237
+ }
238
+ }
239
+ }, [
240
+ onSelectRange,
241
+ setRange,
242
+ setSelected
243
+ ]);
244
+ const prevSelectedRef = useRef(void 0);
245
+ const handleDayPointerDown = useCallback((date, ev) => {
246
+ ev.preventDefault();
247
+ prevSelectedRef.current = selected;
248
+ anchorRef.current = date;
249
+ focusRef.current = date;
250
+ draggingRef.current = true;
251
+ setRange(void 0);
252
+ setPendingRange(void 0);
253
+ setSelected(date);
254
+ gridRef.current?.focus({
255
+ preventScroll: true
150
256
  });
151
257
  }, [
152
- onSelect
258
+ selected,
259
+ setPendingRange,
260
+ setRange,
261
+ setSelected
262
+ ]);
263
+ const handleDayPointerEnter = useCallback((date) => {
264
+ if (!draggingRef.current) {
265
+ return;
266
+ }
267
+ const anchor = anchorRef.current;
268
+ if (!anchor) {
269
+ return;
270
+ }
271
+ focusRef.current = date;
272
+ setSelected(void 0);
273
+ setPendingRange(makeRange(anchor, date));
274
+ }, [
275
+ setPendingRange,
276
+ setSelected
153
277
  ]);
278
+ const handleDayPointerUp = useCallback((date) => {
279
+ const anchor = anchorRef.current;
280
+ const wasDragging = draggingRef.current;
281
+ draggingRef.current = false;
282
+ setPendingRange(void 0);
283
+ if (!wasDragging || !anchor) {
284
+ return;
285
+ }
286
+ focusRef.current = date;
287
+ if (isSameDay(anchor, date)) {
288
+ if (prevSelectedRef.current && isSameDay(prevSelectedRef.current, date)) {
289
+ setSelected(void 0);
290
+ anchorRef.current = void 0;
291
+ focusRef.current = void 0;
292
+ return;
293
+ }
294
+ setSelected(anchor);
295
+ onSelect?.({
296
+ date
297
+ });
298
+ return;
299
+ }
300
+ const committed = makeRange(anchor, date);
301
+ setRange(committed);
302
+ onSelectRange?.({
303
+ range: committed
304
+ });
305
+ }, [
306
+ onSelect,
307
+ onSelectRange,
308
+ setPendingRange,
309
+ setRange,
310
+ setSelected
311
+ ]);
312
+ useEffect(() => {
313
+ const cancel = () => {
314
+ if (draggingRef.current) {
315
+ draggingRef.current = false;
316
+ setPendingRange(void 0);
317
+ }
318
+ };
319
+ window.addEventListener("pointerup", cancel);
320
+ window.addEventListener("pointercancel", cancel);
321
+ return () => {
322
+ window.removeEventListener("pointerup", cancel);
323
+ window.removeEventListener("pointercancel", cancel);
324
+ };
325
+ }, [
326
+ setPendingRange
327
+ ]);
328
+ const tickEdgeScroll = useCallback(() => {
329
+ scrollRafRef.current = void 0;
330
+ if (!draggingRef.current) {
331
+ return;
332
+ }
333
+ const rect = containerRef.current?.getBoundingClientRect();
334
+ if (!rect) {
335
+ return;
336
+ }
337
+ const y = pointerYRef.current;
338
+ let delta = 0;
339
+ if (y < rect.top + EDGE_SCROLL_ZONE) {
340
+ delta = -EDGE_SCROLL_MAX_SPEED * Math.min(1, Math.max(0, (rect.top + EDGE_SCROLL_ZONE - y) / EDGE_SCROLL_ZONE));
341
+ } else if (y > rect.bottom - EDGE_SCROLL_ZONE) {
342
+ delta = EDGE_SCROLL_MAX_SPEED * Math.min(1, Math.max(0, (y - (rect.bottom - EDGE_SCROLL_ZONE)) / EDGE_SCROLL_ZONE));
343
+ }
344
+ if (delta !== 0) {
345
+ const newScroll = Math.max(0, scrollTopRef.current + delta);
346
+ listRef.current?.scrollToPosition(newScroll);
347
+ const date = cellDate(document.elementFromPoint(pointerXRef.current, y));
348
+ const anchor = anchorRef.current;
349
+ if (date && anchor) {
350
+ focusRef.current = date;
351
+ if (isSameDay(anchor, date)) {
352
+ setPendingRange(void 0);
353
+ setSelected(anchor);
354
+ } else {
355
+ setSelected(void 0);
356
+ setPendingRange(makeRange(anchor, date));
357
+ }
358
+ }
359
+ scrollRafRef.current = requestAnimationFrame(tickEdgeScroll);
360
+ }
361
+ }, [
362
+ containerRef,
363
+ setPendingRange,
364
+ setSelected
365
+ ]);
366
+ useEffect(() => {
367
+ const handleMove = (ev) => {
368
+ if (!draggingRef.current) {
369
+ return;
370
+ }
371
+ pointerXRef.current = ev.clientX;
372
+ pointerYRef.current = ev.clientY;
373
+ if (scrollRafRef.current === void 0) {
374
+ scrollRafRef.current = requestAnimationFrame(tickEdgeScroll);
375
+ }
376
+ };
377
+ window.addEventListener("pointermove", handleMove);
378
+ return () => {
379
+ window.removeEventListener("pointermove", handleMove);
380
+ if (scrollRafRef.current !== void 0) {
381
+ cancelAnimationFrame(scrollRafRef.current);
382
+ scrollRafRef.current = void 0;
383
+ }
384
+ };
385
+ }, [
386
+ tickEdgeScroll
387
+ ]);
388
+ const handleKeyDown = useCallback((ev) => {
389
+ let dx = 0;
390
+ switch (ev.key) {
391
+ case "ArrowLeft":
392
+ dx = -1;
393
+ break;
394
+ case "ArrowRight":
395
+ dx = 1;
396
+ break;
397
+ case "ArrowUp":
398
+ dx = -7;
399
+ break;
400
+ case "ArrowDown":
401
+ dx = 7;
402
+ break;
403
+ default:
404
+ return;
405
+ }
406
+ ev.preventDefault();
407
+ if (ev.shiftKey) {
408
+ let anchor = anchorRef.current;
409
+ let focus = focusRef.current;
410
+ if (!anchor) {
411
+ if (selected) {
412
+ anchor = startOfDay(selected);
413
+ focus = anchor;
414
+ } else if (range) {
415
+ anchor = range.from;
416
+ focus = range.to;
417
+ } else {
418
+ anchor = startOfDay(today);
419
+ focus = anchor;
420
+ }
421
+ anchorRef.current = anchor;
422
+ focusRef.current = focus;
423
+ }
424
+ const newFocus = addDays(focus ?? anchor, dx);
425
+ updateRangeFromAnchor(newFocus, true);
426
+ scrollIntoView(newFocus);
427
+ } else {
428
+ const current = selected ?? focusRef.current ?? anchorRef.current ?? today;
429
+ const next = addDays(startOfDay(current), dx);
430
+ anchorRef.current = next;
431
+ focusRef.current = next;
432
+ setRange(void 0);
433
+ setPendingRange(void 0);
434
+ setSelected(next);
435
+ onSelect?.({
436
+ date: next
437
+ });
438
+ scrollIntoView(next);
439
+ }
440
+ }, [
441
+ onSelect,
442
+ range,
443
+ scrollIntoView,
444
+ selected,
445
+ setPendingRange,
446
+ setRange,
447
+ setSelected,
448
+ today,
449
+ updateRangeFromAnchor
450
+ ]);
451
+ const activeRange = pendingRange ?? range;
154
452
  const handleScroll = useCallback((info) => {
453
+ scrollTopRef.current = info.scrollTop;
155
454
  setIndex(Math.round(info.scrollTop / size));
156
455
  }, []);
157
456
  const rowRenderer = useCallback(({ key, index, style }) => {
158
- const getBgColor = (date) => date.getMonth() % 2 === 0 && "bg-modal-surface";
457
+ const getBgColor = (date) => date.getMonth() % 2 === 0 ? "bg-group-surface" : "bg-group-alt-surface";
159
458
  return /* @__PURE__ */ React.createElement("div", {
160
459
  key,
161
460
  style,
@@ -169,13 +468,19 @@ var CalendarGrid = composable(({ classNames, rows, dates = [], onSelect, ...prop
169
468
  length: 7
170
469
  }).map((_, i) => {
171
470
  const date = getDate(start, index, i, weekStartsOn);
471
+ const inRange = isInRange(date, activeRange);
172
472
  const border = isSameDay(date, selected) ? "border-primary-500" : isSameDay(date, today) ? "border-amber-500" : hasDate(date) ? "border-neutral-700 border-dashed" : void 0;
173
473
  return /* @__PURE__ */ React.createElement("div", {
174
474
  key: i,
175
- className: mx("relative flex justify-center items-center cursor-pointer", getBgColor(date)),
176
- onClick: () => handleDaySelect(date)
177
- }, /* @__PURE__ */ React.createElement("span", {
178
- className: "text-description"
475
+ "data-date": startOfDay(date).toISOString(),
476
+ className: mx("relative flex justify-center items-center cursor-pointer select-none", getBgColor(date)),
477
+ onPointerDown: (ev) => handleDayPointerDown(date, ev),
478
+ onPointerEnter: () => handleDayPointerEnter(date),
479
+ onPointerUp: () => handleDayPointerUp(date)
480
+ }, inRange && /* @__PURE__ */ React.createElement("div", {
481
+ className: "absolute inset-0 bg-primary-500/20"
482
+ }), /* @__PURE__ */ React.createElement("span", {
483
+ className: "relative text-description text-sm"
179
484
  }, date.getDate()), !border && date.getDate() === 1 && /* @__PURE__ */ React.createElement("span", {
180
485
  className: "absolute top-0 text-xs text-description"
181
486
  }, format(date, "MMM")), border && /* @__PURE__ */ React.createElement("div", {
@@ -183,7 +488,10 @@ var CalendarGrid = composable(({ classNames, rows, dates = [], onSelect, ...prop
183
488
  }));
184
489
  })));
185
490
  }, [
186
- handleDaySelect,
491
+ activeRange,
492
+ handleDayPointerDown,
493
+ handleDayPointerEnter,
494
+ handleDayPointerUp,
187
495
  hasDate,
188
496
  selected,
189
497
  weekStartsOn
@@ -192,11 +500,20 @@ var CalendarGrid = composable(({ classNames, rows, dates = [], onSelect, ...prop
192
500
  ...composableProps(props, {
193
501
  role: "none",
194
502
  classNames: [
195
- "flex flex-col h-full w-full justify-center overflow-hidden",
503
+ "flex flex-col h-full w-full justify-center overflow-hidden outline-hidden",
196
504
  classNames
197
505
  ]
198
506
  }),
199
- ref: forwardedRef
507
+ ref: (node) => {
508
+ gridRef.current = node;
509
+ if (typeof forwardedRef === "function") {
510
+ forwardedRef(node);
511
+ } else if (forwardedRef) {
512
+ forwardedRef.current = node;
513
+ }
514
+ },
515
+ tabIndex: 0,
516
+ onKeyDown: handleKeyDown
200
517
  }, /* @__PURE__ */ React.createElement("div", {
201
518
  className: "grid w-full grid-cols-7",
202
519
  style: {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/Calendar/Calendar.tsx", "../../../src/components/Calendar/util.ts"],
4
- "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { createContext } from '@radix-ui/react-context';\nimport { type Day, addDays, differenceInWeeks, format, startOfDay, startOfWeek } from 'date-fns';\nimport React, {\n type Dispatch,\n type PropsWithChildren,\n type SetStateAction,\n forwardRef,\n useCallback,\n useEffect,\n useImperativeHandle,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport { useResizeDetector } from 'react-resize-detector';\nimport { List, type ListProps, type ListRowRenderer } from 'react-virtualized';\n\nimport { Event } from '@dxos/async';\nimport { IconButton, useTranslation } from '@dxos/react-ui';\nimport { composable, composableProps, mx } from '@dxos/ui-theme';\n\nimport { translationKey } from '#translations';\n\nimport { getDate, isSameDay } from './util';\n\nconst maxRows = 50 * 100;\nconst start = new Date('1970-01-01');\nconst size = 48;\nconst defaultWidth = 7 * size;\n\n//\n// Context\n//\n\ntype CalendarEvent = {\n type: 'scroll';\n date: Date;\n};\n\ntype CalendarContextValue = {\n weekStartsOn: Day;\n event: Event<CalendarEvent>;\n index: number | undefined;\n setIndex: Dispatch<SetStateAction<number | undefined>>;\n selected: Date | undefined;\n setSelected: Dispatch<SetStateAction<Date | undefined>>;\n};\n\nconst [CalendarContextProvider, useCalendarContext] = createContext<CalendarContextValue>('Calendar');\n\n//\n// Controller\n//\n\ntype CalendarController = {\n scrollTo: (date: Date) => void;\n};\n\n//\n// Root\n//\n\ntype CalendarRootProps = PropsWithChildren<Partial<Pick<CalendarContextValue, 'weekStartsOn'>>>;\n\nconst CalendarRoot = forwardRef<CalendarController, CalendarRootProps>(\n ({ children, weekStartsOn = 1 }, forwardedRef) => {\n const event = useMemo(() => new Event<CalendarEvent>(), []);\n const [selected, setSelected] = useState<Date | undefined>();\n const [index, setIndex] = useState<number | undefined>();\n\n useImperativeHandle(\n forwardedRef,\n () => ({\n scrollTo: (date: Date) => {\n event.emit({ type: 'scroll', date });\n },\n }),\n [event],\n );\n\n return (\n <CalendarContextProvider\n weekStartsOn={weekStartsOn}\n event={event}\n index={index}\n setIndex={setIndex}\n selected={selected}\n setSelected={setSelected}\n >\n {children}\n </CalendarContextProvider>\n );\n },\n);\n\n//\n// Header\n//\n\nconst CALENDAR_TOOLBAR_NAME = 'CalendarHeader';\n\ntype CalendarToolbarProps = {};\n\nconst CalendarToolbar = composable<HTMLDivElement, CalendarToolbarProps>(({ classNames, ...props }, forwardedRef) => {\n const { t } = useTranslation(translationKey);\n const { weekStartsOn, event, index, selected } = useCalendarContext(CALENDAR_TOOLBAR_NAME);\n const top = useMemo(() => getDate(start, index ?? 0, 6, weekStartsOn), [index, weekStartsOn]);\n const today = useMemo(() => new Date(), []);\n\n const handleToday = useCallback(() => {\n event.emit({ type: 'scroll', date: today });\n }, [event, start, today]);\n\n return (\n <div\n {...composableProps(props, {\n role: 'none',\n classNames: ['shrink-0 grid! grid-cols-3 items-center bg-toolbar-surface', classNames],\n })}\n ref={forwardedRef}\n style={{ width: defaultWidth }}\n >\n <div className='flex justify-start'>\n <IconButton\n variant='ghost'\n icon='ph--calendar--regular'\n iconOnly\n classNames='aspect-square'\n label={t('today.button')}\n onClick={handleToday}\n />\n </div>\n <div className='flex justify-center p-2 text-description'>{format(selected ?? top, 'MMMM')}</div>\n <div className='flex justify-end p-2 text-description'>{(selected ?? top).getFullYear()}</div>\n </div>\n );\n});\n\nCalendarToolbar.displayName = CALENDAR_TOOLBAR_NAME;\n\n//\n// Grid\n// TODO(burdon): Key nav.\n// TODO(burdon): Drag range.\n//\n\nconst CALENDAR_GRID_NAME = 'CalendarGrid';\n\ntype CalendarGridProps = {\n rows?: number;\n /** Dates to highlight on the grid. Each date that appears in this array receives a border indicator. */\n dates?: Date[];\n onSelect?: (event: { date: Date }) => void;\n};\n\nconst CalendarGrid = composable<HTMLDivElement, CalendarGridProps>(\n ({ classNames, rows, dates = [], onSelect, ...props }, forwardedRef) => {\n const { weekStartsOn, event, setIndex, selected, setSelected } = useCalendarContext(CALENDAR_GRID_NAME);\n const { ref: containerRef, width = 0, height = 0 } = useResizeDetector();\n const maxHeight = rows ? rows * size : undefined;\n const listRef = useRef<List>(null);\n const today = useMemo(() => new Date(), []);\n\n // Build a set of ISO date strings (YYYY-MM-DD) for O(1) per-cell lookup.\n const dateSet = useMemo(() => new Set(dates.map((date) => startOfDay(date).toISOString())), [dates]);\n\n const hasDate = useCallback((date: Date) => dateSet.has(startOfDay(date).toISOString()), [dateSet]);\n\n const [initialized, setInitialized] = useState(false);\n useEffect(() => {\n const index = differenceInWeeks(today, start);\n listRef.current?.scrollToRow(index);\n }, [initialized, start, today]);\n\n useEffect(() => {\n return event.on((event) => {\n switch (event.type) {\n case 'scroll': {\n const index = differenceInWeeks(event.date, start);\n listRef.current?.scrollToRow(index);\n break;\n }\n }\n });\n }, [event]);\n\n const days = useMemo(() => {\n const weekStart = startOfWeek(new Date(), { weekStartsOn });\n return Array.from({ length: 7 }, (_, i) => {\n const day = addDays(weekStart, i);\n return format(day, 'EEE'); // Short day name (Mon, Tue, etc.)\n });\n }, []);\n\n // TODO(burdon): Get info by range.\n\n const handleDaySelect = useCallback(\n (date: Date) => {\n setSelected((current) => (isSameDay(date, current) ? undefined : date));\n onSelect?.({ date });\n },\n [onSelect],\n );\n\n const handleScroll = useCallback<NonNullable<ListProps['onScroll']>>((info) => {\n setIndex(Math.round(info.scrollTop / size));\n }, []);\n\n const rowRenderer = useCallback<ListRowRenderer>(\n ({ key, index, style }) => {\n const getBgColor = (date: Date) => date.getMonth() % 2 === 0 && 'bg-modal-surface';\n return (\n <div key={key} style={style} className='grid'>\n <div className='grid grid-cols-7 bg-input-surface' style={{ gridTemplateColumns: `repeat(7, ${size}px)` }}>\n {Array.from({ length: 7 }).map((_, i) => {\n const date = getDate(start, index, i, weekStartsOn);\n const border = isSameDay(date, selected)\n ? 'border-primary-500'\n : isSameDay(date, today)\n ? 'border-amber-500'\n : hasDate(date)\n ? 'border-neutral-700 border-dashed'\n : undefined;\n\n return (\n <div\n key={i}\n className={mx('relative flex justify-center items-center cursor-pointer', getBgColor(date))}\n onClick={() => handleDaySelect(date)}\n >\n <span className='text-description'>{date.getDate()}</span>\n {!border && date.getDate() === 1 && (\n <span className='absolute top-0 text-xs text-description'>{format(date, 'MMM')}</span>\n )}\n {border && <div className={mx('absolute inset-1 border-2 rounded-full', border)} />}\n </div>\n );\n })}\n </div>\n </div>\n );\n },\n [handleDaySelect, hasDate, selected, weekStartsOn],\n );\n\n return (\n <div\n {...composableProps(props, {\n role: 'none',\n classNames: ['flex flex-col h-full w-full justify-center overflow-hidden', classNames],\n })}\n ref={forwardedRef}\n >\n {/* Day of week labels */}\n <div className='grid w-full grid-cols-7' style={{ width: defaultWidth }}>\n {days.map((date, i) => (\n <div key={i} className='flex justify-center p-2 text-sm font-thin'>\n {date}\n </div>\n ))}\n </div>\n\n {/* Grid */}\n <div className='flex flex-col h-full w-full justify-center overflow-hidden' ref={containerRef}>\n <List\n ref={listRef}\n role='none'\n className='scrollbar-none outline-hidden'\n width={width}\n height={maxHeight ?? height}\n rowCount={maxRows}\n rowHeight={size}\n rowRenderer={rowRenderer}\n scrollToAlignment='start'\n onScroll={handleScroll}\n onRowsRendered={() => setInitialized(true)}\n />\n </div>\n </div>\n );\n },\n);\n\nCalendarGrid.displayName = CALENDAR_GRID_NAME;\n\n//\n// Calendar\n//\n\nexport const Calendar = {\n Root: CalendarRoot,\n Toolbar: CalendarToolbar,\n Grid: CalendarGrid,\n};\n\nexport type { CalendarController, CalendarRootProps, CalendarToolbarProps, CalendarGridProps };\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { type Day } from 'date-fns';\n\nexport const getDate = (start: Date, weekNumber: number, dayOfWeek: number, weekStartsOn: Day): Date => {\n const result = new Date(start);\n const startDayOfWeek = start.getDay(); // 0 = Sunday, 1 = Monday, etc.\n const adjustedStartDay = (startDayOfWeek === 0 ? 7 : startDayOfWeek) - weekStartsOn; // Adjust for weekStartsOn.\n result.setDate(start.getDate() - adjustedStartDay + weekNumber * 7 + dayOfWeek);\n return result;\n};\n\nexport const isSameDay = (date1: Date, date2: Date | undefined): boolean => {\n return (\n !!date2 &&\n date1.getFullYear() === date2.getFullYear() &&\n date1.getMonth() === date2.getMonth() &&\n date1.getDate() === date2.getDate()\n );\n};\n"],
5
- "mappings": ";AAIA,SAASA,qBAAqB;AAC9B,SAAmBC,SAASC,mBAAmBC,QAAQC,YAAYC,mBAAmB;AACtF,OAAOC,SAILC,YACAC,aACAC,WACAC,qBACAC,SACAC,QACAC,gBACK;AACP,SAASC,yBAAyB;AAClC,SAASC,YAAkD;AAE3D,SAASC,aAAa;AACtB,SAASC,YAAYC,sBAAsB;AAC3C,SAASC,YAAYC,iBAAiBC,UAAU;AAEhD,SAASC,sBAAsB;;;ACnBxB,IAAMC,UAAU,CAACC,QAAaC,YAAoBC,WAAmBC,iBAAAA;AAC1E,QAAMC,SAAS,IAAIC,KAAKL,MAAAA;AACxB,QAAMM,iBAAiBN,OAAMO,OAAM;AACnC,QAAMC,oBAAoBF,mBAAmB,IAAI,IAAIA,kBAAkBH;AACvEC,SAAOK,QAAQT,OAAMD,QAAO,IAAKS,mBAAmBP,aAAa,IAAIC,SAAAA;AACrE,SAAOE;AACT;AAEO,IAAMM,YAAY,CAACC,OAAaC,UAAAA;AACrC,SACE,CAAC,CAACA,SACFD,M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,OAAAA;IAAI4D,KAAKX;IAAG3C,WAAU;KACpBtB,IAAAA,CAAAA,CAAAA,GAMP,sBAAA,cAACgB,OAAAA;IAAIM,WAAU;IAA6DH,KAAKkB;KAC/E,sBAAA,cAAC8C,MAAAA;IACChE,KAAKuB;IACLxB,MAAK;IACLI,WAAU;IACVD;IACAiB,QAAQE,aAAaF;IACrB8C,UAAU3G;IACV4G,WAAWzG;IACX+F;IACAW,mBAAkB;IAClBC,UAAUjB;IACVkB,gBAAgB,MAAMpC,eAAe,IAAA;;AAK/C,CAAA;AAGFnB,aAAaF,cAAcC;AAMpB,IAAMyD,WAAW;EACtBC,MAAMzG;EACN0G,SAASvF;EACTwF,MAAM3D;AACR;",
6
- "names": ["createContext", "addDays", "differenceInWeeks", "format", "startOfDay", "startOfWeek", "React", "forwardRef", "useCallback", "useEffect", "useImperativeHandle", "useMemo", "useRef", "useState", "useResizeDetector", "List", "Event", "IconButton", "useTranslation", "composable", "composableProps", "mx", "translationKey", "getDate", "start", "weekNumber", "dayOfWeek", "weekStartsOn", "result", "Date", "startDayOfWeek", "getDay", "adjustedStartDay", "setDate", "isSameDay", "date1", "date2", "getFullYear", "getMonth", "maxRows", "start", "Date", "size", "defaultWidth", "CalendarContextProvider", "useCalendarContext", "createContext", "CalendarRoot", "forwardRef", "children", "weekStartsOn", "forwardedRef", "event", "useMemo", "Event", "selected", "setSelected", "useState", "index", "setIndex", "useImperativeHandle", "scrollTo", "date", "emit", "type", "CALENDAR_TOOLBAR_NAME", "CalendarToolbar", "composable", "classNames", "props", "t", "useTranslation", "translationKey", "top", "getDate", "today", "handleToday", "useCallback", "div", "composableProps", "role", "ref", "style", "width", "className", "IconButton", "variant", "icon", "iconOnly", "label", "onClick", "format", "getFullYear", "displayName", "CALENDAR_GRID_NAME", "CalendarGrid", "rows", "dates", "onSelect", "containerRef", "height", "useResizeDetector", "maxHeight", "undefined", "listRef", "useRef", "dateSet", "Set", "map", "startOfDay", "toISOString", "hasDate", "has", "initialized", "setInitialized", "useEffect", "differenceInWeeks", "current", "scrollToRow", "on", "days", "weekStart", "startOfWeek", "Array", "from", "length", "_", "i", "day", "addDays", "handleDaySelect", "isSameDay", "handleScroll", "info", "Math", "round", "scrollTop", "rowRenderer", "key", "getBgColor", "getMonth", "gridTemplateColumns", "border", "mx", "span", "List", "rowCount", "rowHeight", "scrollToAlignment", "onScroll", "onRowsRendered", "Calendar", "Root", "Toolbar", "Grid"]
4
+ "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { createContext } from '@radix-ui/react-context';\nimport { type Day, addDays, format, startOfDay, startOfWeek } from 'date-fns';\nimport React, {\n type Dispatch,\n type KeyboardEvent as ReactKeyboardEvent,\n type PointerEvent as ReactPointerEvent,\n type PropsWithChildren,\n type SetStateAction,\n forwardRef,\n useCallback,\n useEffect,\n useImperativeHandle,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport { useResizeDetector } from 'react-resize-detector';\nimport { List, type ListProps, type ListRowRenderer } from 'react-virtualized';\n\nimport { Event } from '@dxos/async';\nimport { IconButton, useTranslation } from '@dxos/react-ui';\nimport { composable, composableProps } from '@dxos/react-ui';\nimport { mx } from '@dxos/ui-theme';\n\nimport { translationKey } from '#translations';\n\nimport { getDate, getRowIndex, isSameDay } from './util';\n\nconst maxRows = 50 * 100;\nconst start = new Date('1970-01-01');\nconst size = 40;\nconst defaultWidth = 7 * size;\n\n// Auto-scroll while dragging near a vertical edge.\nconst EDGE_SCROLL_ZONE = 32; // px\nconst EDGE_SCROLL_MAX_SPEED = 12; // px per frame\n\n//\n// Range\n//\n\n/**\n * Inclusive date range. `from <= to`. Both endpoints are anchored at the\n * start of their day; callers should not rely on time-of-day precision.\n */\nexport type Range = {\n from: Date;\n to: Date;\n};\n\n/** Normalize an ordered pair of dates into a Range (start-of-day, from <= to). */\nconst makeRange = (a: Date, b: Date): Range => {\n const dayA = startOfDay(a);\n const dayB = startOfDay(b);\n return dayA <= dayB ? { from: dayA, to: dayB } : { from: dayB, to: dayA };\n};\n\n/** Inclusive day-level membership check. */\nconst isInRange = (date: Date, range: Range | undefined): boolean => {\n if (!range) {\n return false;\n }\n const day = startOfDay(date).getTime();\n return day >= range.from.getTime() && day <= range.to.getTime();\n};\n\n/** Resolve a DOM element back to the Date its cell represents. */\nconst cellDate = (el: Element | null): Date | undefined => {\n let current: Element | null = el;\n while (current && current !== document.body) {\n const iso = current.getAttribute?.('data-date');\n if (iso) {\n return new Date(iso);\n }\n current = current.parentElement;\n }\n return undefined;\n};\n\n//\n// Context\n//\n\ntype CalendarEvent = {\n type: 'scroll';\n date: Date;\n};\n\ntype CalendarContextValue = {\n weekStartsOn: Day;\n event: Event<CalendarEvent>;\n index: number | undefined;\n setIndex: Dispatch<SetStateAction<number | undefined>>;\n selected: Date | undefined;\n setSelected: Dispatch<SetStateAction<Date | undefined>>;\n /** Committed date range, set by the most recent drag or shift+arrow selection. */\n range: Range | undefined;\n setRange: Dispatch<SetStateAction<Range | undefined>>;\n /** Live drag preview; non-undefined only while the user is dragging. */\n pendingRange: Range | undefined;\n setPendingRange: Dispatch<SetStateAction<Range | undefined>>;\n};\n\nconst [CalendarContextProvider, useCalendarContext] = createContext<CalendarContextValue>('Calendar');\n\n//\n// Controller\n//\n\ntype CalendarController = {\n scrollTo: (date: Date) => void;\n};\n\n//\n// Root\n//\n\ntype CalendarRootProps = PropsWithChildren<Partial<Pick<CalendarContextValue, 'weekStartsOn'>>>;\n\nconst CalendarRoot = forwardRef<CalendarController, CalendarRootProps>(\n ({ children, weekStartsOn = 1 }, forwardedRef) => {\n const event = useMemo(() => new Event<CalendarEvent>(), []);\n const [selected, setSelected] = useState<Date | undefined>();\n const [index, setIndex] = useState<number | undefined>();\n const [range, setRange] = useState<Range | undefined>();\n const [pendingRange, setPendingRange] = useState<Range | undefined>();\n\n useImperativeHandle(\n forwardedRef,\n () => ({\n scrollTo: (date: Date) => {\n event.emit({ type: 'scroll', date });\n },\n }),\n [event],\n );\n\n return (\n <CalendarContextProvider\n weekStartsOn={weekStartsOn}\n event={event}\n index={index}\n setIndex={setIndex}\n selected={selected}\n setSelected={setSelected}\n range={range}\n setRange={setRange}\n pendingRange={pendingRange}\n setPendingRange={setPendingRange}\n >\n {children}\n </CalendarContextProvider>\n );\n },\n);\n\n//\n// Header\n//\n\nconst CALENDAR_TOOLBAR_NAME = 'CalendarHeader';\n\ntype CalendarToolbarProps = {};\n\nconst CalendarToolbar = composable<HTMLDivElement, CalendarToolbarProps>(({ classNames, ...props }, forwardedRef) => {\n const { t } = useTranslation(translationKey);\n const { weekStartsOn, event, index, selected } = useCalendarContext(CALENDAR_TOOLBAR_NAME);\n const top = useMemo(() => getDate(start, index ?? 0, 6, weekStartsOn), [index, weekStartsOn]);\n const today = useMemo(() => new Date(), []);\n\n const handleToday = useCallback(() => {\n event.emit({ type: 'scroll', date: today });\n }, [event, start, today]);\n\n return (\n <div\n {...composableProps(props, {\n role: 'none',\n classNames: ['shrink-0 grid! grid-cols-3 items-center bg-toolbar-surface', classNames],\n })}\n ref={forwardedRef}\n style={{ width: defaultWidth }}\n >\n <div className='flex justify-start'>\n <IconButton\n variant='ghost'\n icon='ph--calendar--regular'\n iconOnly\n classNames='aspect-square'\n label={t('today.button')}\n onClick={handleToday}\n />\n </div>\n <div className='flex justify-center p-2 text-description'>{format(selected ?? top, 'MMMM')}</div>\n <div className='flex justify-end p-2 text-description'>{(selected ?? top).getFullYear()}</div>\n </div>\n );\n});\n\nCalendarToolbar.displayName = CALENDAR_TOOLBAR_NAME;\n\n//\n// Grid\n//\n\nconst CALENDAR_GRID_NAME = 'CalendarGrid';\n\ntype CalendarGridProps = {\n rows?: number;\n /** Dates to highlight on the grid. Each date that appears in this array receives a border indicator. */\n dates?: Date[];\n /**\n * Date the grid scrolls into view on mount, and whenever this value changes.\n * Defaults to today. Pass a stable (memoized) Date so the grid does not\n * re-scroll on every render.\n */\n initialDate?: Date;\n /** Fired when a user selects a single date (click or arrow key). */\n onSelect?: (event: { date: Date }) => void;\n /**\n * Fired when a user commits a multi-day range, either by a drag gesture or\n * by shift+arrow extension. The range is normalized: `from <= to`, both at\n * start-of-day. Not fired for single-day selections (use {@link onSelect}).\n */\n onSelectRange?: (event: { range: Range }) => void;\n};\n\nconst CalendarGrid = composable<HTMLDivElement, CalendarGridProps>(\n ({ classNames, rows, dates = [], initialDate, onSelect, onSelectRange, ...props }, forwardedRef) => {\n const { weekStartsOn, event, setIndex, selected, setSelected, range, setRange, pendingRange, setPendingRange } =\n useCalendarContext(CALENDAR_GRID_NAME);\n const { ref: containerRef, width = 0, height = 0 } = useResizeDetector();\n const maxHeight = rows ? rows * size : undefined;\n const listRef = useRef<List>(null);\n const gridRef = useRef<HTMLDivElement>(null);\n const today = useMemo(() => new Date(), []);\n\n // Build a set of ISO date strings (YYYY-MM-DD) for O(1) per-cell lookup.\n const dateSet = useMemo(() => new Set(dates.map((date) => startOfDay(date).toISOString())), [dates]);\n\n const hasDate = useCallback((date: Date) => dateSet.has(startOfDay(date).toISOString()), [dateSet]);\n\n const [initialized, setInitialized] = useState(false);\n useEffect(() => {\n const index = getRowIndex(start, initialDate ?? today, weekStartsOn);\n listRef.current?.scrollToRow(index);\n }, [initialized, start, today, initialDate, weekStartsOn]);\n\n useEffect(() => {\n return event.on((event) => {\n switch (event.type) {\n case 'scroll': {\n const index = getRowIndex(start, event.date, weekStartsOn);\n listRef.current?.scrollToRow(index);\n break;\n }\n }\n });\n }, [event]);\n\n const days = useMemo(() => {\n const weekStart = startOfWeek(new Date(), { weekStartsOn });\n return Array.from({ length: 7 }, (_, i) => {\n const day = addDays(weekStart, i);\n return format(day, 'EEE'); // Short day name (Mon, Tue, etc.)\n });\n }, []);\n\n //\n // Selection refs.\n //\n // `anchorRef` is the immovable end of a range gesture (pointerdown date or\n // initial day when shift+arrow starts). `focusRef` is the moving end\n // (pointer-under-cursor during drag, or the cursor after each shift+arrow).\n // Both refs are kept in sync across mouse drag and keyboard nav so that\n // the user can fluidly mix gestures (e.g., drag a range, then shift+arrow\n // to fine-tune).\n //\n const anchorRef = useRef<Date | undefined>(undefined);\n const focusRef = useRef<Date | undefined>(undefined);\n const draggingRef = useRef(false);\n\n // Pointer tracking for edge-scroll while dragging.\n const pointerXRef = useRef<number>(0);\n const pointerYRef = useRef<number>(0);\n const scrollTopRef = useRef(0);\n const scrollRafRef = useRef<number | undefined>(undefined);\n\n // Scroll the target date into view only if it's outside the visible window.\n // Horizontal moves (left/right within the same week) leave the row index\n // unchanged and are a no-op.\n const scrollIntoView = useCallback(\n (date: Date) => {\n const targetRow = getRowIndex(start, date, weekStartsOn);\n const visibleHeight = maxHeight ?? height;\n if (!visibleHeight) {\n return;\n }\n // Rows fully inside the viewport. Use ceil/floor (not floor of scrollTop) so a partially\n // visible row at either edge counts as \"not fully visible\" even when scrollTop is not a\n // multiple of the row height (which it isn't after a bottom-aligned scroll).\n const firstFullyVisibleRow = Math.ceil(scrollTopRef.current / size);\n const lastFullyVisibleRow = Math.floor((scrollTopRef.current + visibleHeight) / size) - 1;\n if (targetRow < firstFullyVisibleRow) {\n // Align the top edge of the target row with the top edge of the viewport.\n listRef.current?.scrollToPosition(targetRow * size);\n } else if (targetRow > lastFullyVisibleRow) {\n // Align the bottom edge of the target row with the bottom edge of the viewport (using the\n // full visible height, not a row-rounded height, so the row sits flush against the edge).\n listRef.current?.scrollToPosition(Math.max(0, (targetRow + 1) * size - visibleHeight));\n }\n },\n [height, maxHeight, weekStartsOn],\n );\n\n const updateRangeFromAnchor = useCallback(\n (focus: Date, fireRange = false) => {\n const anchor = anchorRef.current;\n if (!anchor) {\n return;\n }\n focusRef.current = focus;\n if (isSameDay(anchor, focus)) {\n setRange(undefined);\n setSelected(anchor);\n } else {\n setSelected(undefined);\n const committed = makeRange(anchor, focus);\n setRange(committed);\n if (fireRange) {\n onSelectRange?.({ range: committed });\n }\n }\n },\n [onSelectRange, setRange, setSelected],\n );\n\n //\n // Drag-to-select range.\n //\n // `prevSelectedRef` snapshots the single-day selection that was active\n // when the gesture began. A click on the *same* already-selected day\n // toggles the selection off on pointerup; a click on any other day (or\n // when no day was selected) just sets the new selection.\n //\n const prevSelectedRef = useRef<Date | undefined>(undefined);\n\n const handleDayPointerDown = useCallback(\n (date: Date, ev: ReactPointerEvent<HTMLDivElement>) => {\n ev.preventDefault();\n prevSelectedRef.current = selected;\n anchorRef.current = date;\n focusRef.current = date;\n draggingRef.current = true;\n // Immediate visual feedback: render the single-select ring on the anchor day.\n setRange(undefined);\n setPendingRange(undefined);\n setSelected(date);\n // Focus the grid so subsequent keyboard nav works.\n gridRef.current?.focus({ preventScroll: true });\n },\n [selected, setPendingRange, setRange, setSelected],\n );\n\n const handleDayPointerEnter = useCallback(\n (date: Date) => {\n if (!draggingRef.current) {\n return;\n }\n const anchor = anchorRef.current;\n if (!anchor) {\n return;\n }\n focusRef.current = date;\n // Always render a pending range while dragging — even a single-day range\n // (when the pointer is on the anchor cell or returns to it). Otherwise\n // the anchor cell would appear empty mid-drag.\n setSelected(undefined);\n setPendingRange(makeRange(anchor, date));\n },\n [setPendingRange, setSelected],\n );\n\n const handleDayPointerUp = useCallback(\n (date: Date) => {\n const anchor = anchorRef.current;\n const wasDragging = draggingRef.current;\n draggingRef.current = false;\n setPendingRange(undefined);\n if (!wasDragging || !anchor) {\n return;\n }\n focusRef.current = date;\n if (isSameDay(anchor, date)) {\n // Single click — toggle off if clicking the previously-selected day,\n // otherwise set as selected. (pointerenter may have cleared the ring\n // mid-drag to show a 1-day pending-range fill; restore here.)\n if (prevSelectedRef.current && isSameDay(prevSelectedRef.current, date)) {\n setSelected(undefined);\n anchorRef.current = undefined;\n focusRef.current = undefined;\n return;\n }\n setSelected(anchor);\n onSelect?.({ date });\n return;\n }\n // Drag commit — `selected` was already cleared by pointerenter.\n const committed = makeRange(anchor, date);\n setRange(committed);\n onSelectRange?.({ range: committed });\n },\n [onSelect, onSelectRange, setPendingRange, setRange, setSelected],\n );\n\n // Cancel drag if the pointer is released outside the grid.\n useEffect(() => {\n const cancel = () => {\n if (draggingRef.current) {\n draggingRef.current = false;\n setPendingRange(undefined);\n }\n };\n window.addEventListener('pointerup', cancel);\n window.addEventListener('pointercancel', cancel);\n return () => {\n window.removeEventListener('pointerup', cancel);\n window.removeEventListener('pointercancel', cancel);\n };\n }, [setPendingRange]);\n\n //\n // Edge auto-scroll while dragging near top/bottom of the grid viewport.\n //\n const tickEdgeScroll = useCallback(() => {\n scrollRafRef.current = undefined;\n if (!draggingRef.current) {\n return;\n }\n const rect = containerRef.current?.getBoundingClientRect();\n if (!rect) {\n return;\n }\n const y = pointerYRef.current;\n let delta = 0;\n if (y < rect.top + EDGE_SCROLL_ZONE) {\n delta = -EDGE_SCROLL_MAX_SPEED * Math.min(1, Math.max(0, (rect.top + EDGE_SCROLL_ZONE - y) / EDGE_SCROLL_ZONE));\n } else if (y > rect.bottom - EDGE_SCROLL_ZONE) {\n delta =\n EDGE_SCROLL_MAX_SPEED * Math.min(1, Math.max(0, (y - (rect.bottom - EDGE_SCROLL_ZONE)) / EDGE_SCROLL_ZONE));\n }\n if (delta !== 0) {\n const newScroll = Math.max(0, scrollTopRef.current + delta);\n listRef.current?.scrollToPosition(newScroll);\n // After scroll, the cell under the (stationary) pointer changes.\n // Look up the new cell and update the pending range accordingly.\n const date = cellDate(document.elementFromPoint(pointerXRef.current, y));\n const anchor = anchorRef.current;\n if (date && anchor) {\n focusRef.current = date;\n if (isSameDay(anchor, date)) {\n setPendingRange(undefined);\n setSelected(anchor);\n } else {\n setSelected(undefined);\n setPendingRange(makeRange(anchor, date));\n }\n }\n scrollRafRef.current = requestAnimationFrame(tickEdgeScroll);\n }\n }, [containerRef, setPendingRange, setSelected]);\n\n useEffect(() => {\n const handleMove = (ev: PointerEvent) => {\n if (!draggingRef.current) {\n return;\n }\n pointerXRef.current = ev.clientX;\n pointerYRef.current = ev.clientY;\n if (scrollRafRef.current === undefined) {\n scrollRafRef.current = requestAnimationFrame(tickEdgeScroll);\n }\n };\n window.addEventListener('pointermove', handleMove);\n return () => {\n window.removeEventListener('pointermove', handleMove);\n if (scrollRafRef.current !== undefined) {\n cancelAnimationFrame(scrollRafRef.current);\n scrollRafRef.current = undefined;\n }\n };\n }, [tickEdgeScroll]);\n\n //\n // Keyboard nav: arrow keys move single selection; shift+arrow expands range.\n //\n const handleKeyDown = useCallback(\n (ev: ReactKeyboardEvent<HTMLDivElement>) => {\n let dx = 0;\n switch (ev.key) {\n case 'ArrowLeft':\n dx = -1;\n break;\n case 'ArrowRight':\n dx = 1;\n break;\n case 'ArrowUp':\n dx = -7;\n break;\n case 'ArrowDown':\n dx = 7;\n break;\n default:\n return;\n }\n ev.preventDefault();\n\n if (ev.shiftKey) {\n // Bootstrap anchor/focus from current state if needed.\n let anchor = anchorRef.current;\n let focus = focusRef.current;\n if (!anchor) {\n // No prior gesture — seed from current selected/range/today.\n if (selected) {\n anchor = startOfDay(selected);\n focus = anchor;\n } else if (range) {\n anchor = range.from;\n focus = range.to;\n } else {\n anchor = startOfDay(today);\n focus = anchor;\n }\n anchorRef.current = anchor;\n focusRef.current = focus;\n }\n const newFocus = addDays(focus ?? anchor, dx);\n updateRangeFromAnchor(newFocus, true);\n scrollIntoView(newFocus);\n } else {\n // Plain arrow — move single selection; clear any range gesture state.\n const current = selected ?? focusRef.current ?? anchorRef.current ?? today;\n const next = addDays(startOfDay(current), dx);\n anchorRef.current = next;\n focusRef.current = next;\n setRange(undefined);\n setPendingRange(undefined);\n setSelected(next);\n onSelect?.({ date: next });\n scrollIntoView(next);\n }\n },\n [onSelect, range, scrollIntoView, selected, setPendingRange, setRange, setSelected, today, updateRangeFromAnchor],\n );\n\n const activeRange = pendingRange ?? range;\n\n const handleScroll = useCallback<NonNullable<ListProps['onScroll']>>((info) => {\n scrollTopRef.current = info.scrollTop;\n setIndex(Math.round(info.scrollTop / size));\n }, []);\n\n const rowRenderer = useCallback<ListRowRenderer>(\n ({ key, index, style }) => {\n // Zebra-stripe alternating months with a subtle neutral overlay over the grid surface, so\n // the banding is independent of (and robust to) surface-token retuning.\n const getBgColor = (date: Date) => (date.getMonth() % 2 === 0 ? 'bg-group-surface' : 'bg-group-alt-surface');\n\n return (\n <div key={key} style={style} className='grid'>\n <div className='grid grid-cols-7 bg-input-surface' style={{ gridTemplateColumns: `repeat(7, ${size}px)` }}>\n {Array.from({ length: 7 }).map((_, i) => {\n const date = getDate(start, index, i, weekStartsOn);\n const inRange = isInRange(date, activeRange);\n const border = isSameDay(date, selected)\n ? 'border-primary-500'\n : isSameDay(date, today)\n ? 'border-amber-500'\n : hasDate(date)\n ? 'border-neutral-700 border-dashed'\n : undefined;\n\n return (\n <div\n key={i}\n data-date={startOfDay(date).toISOString()}\n className={mx(\n 'relative flex justify-center items-center cursor-pointer select-none',\n getBgColor(date),\n )}\n onPointerDown={(ev) => handleDayPointerDown(date, ev)}\n onPointerEnter={() => handleDayPointerEnter(date)}\n onPointerUp={() => handleDayPointerUp(date)}\n >\n {inRange && <div className='absolute inset-0 bg-primary-500/20' />}\n <span className='relative text-description text-sm'>{date.getDate()}</span>\n {!border && date.getDate() === 1 && (\n <span className='absolute top-0 text-xs text-description'>{format(date, 'MMM')}</span>\n )}\n {border && <div className={mx('absolute inset-1 border-2 rounded-full', border)} />}\n </div>\n );\n })}\n </div>\n </div>\n );\n },\n [activeRange, handleDayPointerDown, handleDayPointerEnter, handleDayPointerUp, hasDate, selected, weekStartsOn],\n );\n\n return (\n <div\n {...composableProps(props, {\n role: 'none',\n classNames: ['flex flex-col h-full w-full justify-center overflow-hidden outline-hidden', classNames],\n })}\n ref={(node: HTMLDivElement | null) => {\n gridRef.current = node;\n if (typeof forwardedRef === 'function') {\n forwardedRef(node);\n } else if (forwardedRef) {\n (forwardedRef as React.MutableRefObject<HTMLDivElement | null>).current = node;\n }\n }}\n tabIndex={0}\n onKeyDown={handleKeyDown}\n >\n {/* Day of week labels */}\n <div className='grid w-full grid-cols-7' style={{ width: defaultWidth }}>\n {days.map((date, i) => (\n <div key={i} className='flex justify-center p-2 text-sm font-thin'>\n {date}\n </div>\n ))}\n </div>\n\n {/* Grid */}\n <div className='flex flex-col h-full w-full justify-center overflow-hidden' ref={containerRef}>\n <List\n ref={listRef}\n role='none'\n className='scrollbar-none outline-hidden'\n width={width}\n height={maxHeight ?? height}\n rowCount={maxRows}\n rowHeight={size}\n rowRenderer={rowRenderer}\n scrollToAlignment='start'\n onScroll={handleScroll}\n onRowsRendered={() => setInitialized(true)}\n />\n </div>\n </div>\n );\n },\n);\n\nCalendarGrid.displayName = CALENDAR_GRID_NAME;\n\n//\n// Calendar\n//\n\nexport const Calendar = {\n Root: CalendarRoot,\n Toolbar: CalendarToolbar,\n Grid: CalendarGrid,\n};\n\nexport type { CalendarController, CalendarRootProps, CalendarToolbarProps, CalendarGridProps };\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { type Day, differenceInCalendarDays } from 'date-fns';\n\nexport const getDate = (start: Date, weekNumber: number, dayOfWeek: number, weekStartsOn: Day): Date => {\n const result = new Date(start);\n const startDayOfWeek = start.getDay(); // 0 = Sunday, 1 = Monday, etc.\n const adjustedStartDay = (startDayOfWeek === 0 ? 7 : startDayOfWeek) - weekStartsOn; // Adjust for weekStartsOn.\n result.setDate(start.getDate() - adjustedStartDay + weekNumber * 7 + dayOfWeek);\n return result;\n};\n\n/**\n * Inverse of {@link getDate}: returns the row index for a given date, matching\n * the grid layout (which respects `weekStartsOn`).\n *\n * Uses `differenceInCalendarDays` (DST-safe) — naive ms subtraction silently\n * loses an hour each DST transition, which accumulates over decades and\n * eventually shifts the row boundary by one day. `differenceInWeeks` is also\n * unsuitable because it computes raw 7-day chunks anchored at the start\n * date's weekday rather than the grid's `weekStartsOn` column.\n */\nexport const getRowIndex = (start: Date, date: Date, weekStartsOn: Day): number => {\n const startDayOfWeek = start.getDay();\n const adjustedStartDay = (startDayOfWeek === 0 ? 7 : startDayOfWeek) - weekStartsOn;\n const row0Start = new Date(start);\n row0Start.setDate(start.getDate() - adjustedStartDay);\n return Math.floor(differenceInCalendarDays(date, row0Start) / 7);\n};\n\nexport const isSameDay = (date1: Date, date2: Date | undefined): boolean => {\n return (\n !!date2 &&\n date1.getFullYear() === date2.getFullYear() &&\n date1.getMonth() === date2.getMonth() &&\n date1.getDate() === date2.getDate()\n );\n};\n"],
5
+ "mappings": ";AAIA,SAASA,qBAAqB;AAC9B,SAAmBC,SAASC,QAAQC,YAAYC,mBAAmB;AACnE,OAAOC,SAMLC,YACAC,aACAC,WACAC,qBACAC,SACAC,QACAC,gBACK;AACP,SAASC,yBAAyB;AAClC,SAASC,YAAkD;AAE3D,SAASC,aAAa;AACtB,SAASC,YAAYC,sBAAsB;AAC3C,SAASC,YAAYC,uBAAuB;AAC5C,SAASC,UAAU;AAEnB,SAASC,sBAAsB;;;ACxB/B,SAAmBC,gCAAgC;AAE5C,IAAMC,UAAU,CAACC,QAAaC,YAAoBC,WAAmBC,iBAAAA;AAC1E,QAAMC,SAAS,IAAIC,KAAKL,MAAAA;AACxB,QAAMM,iBAAiBN,OAAMO,OAAM;AACnC,QAAMC,oBAAoBF,mBAAmB,IAAI,IAAIA,kBAAkBH;AACvEC,SAAOK,QAAQT,OAAMD,QAAO,IAAKS,mBAAmBP,aAAa,IAAIC,SAAAA;AACrE,SAAOE;AACT;AAYO,IAAMM,cAAc,CAACV,QAAaW,MAAYR,iBAAAA;AACnD,QAAMG,iBAAiBN,OAAMO,OAAM;AACnC,QAAMC,oBAAoBF,mBAAmB,IAAI,IAAIA,kBAAkBH;AACvE,QAAMS,YAAY,IAAIP,KAAKL,MAAAA;AAC3BY,YAAUH,QAAQT,OAAMD,QAAO,IAAKS,gBAAAA;AACpC,SAAOK,KAAKC,MAAMhB,yBAAyBa,MAAMC,SAAAA,IAAa,CAAA;AAChE;AAEO,IAAMG,YAAY,CAACC,OAAaC,UAAAA;AACrC,SACE,CAAC,CAACA,SACFD,MAAME,YAAW,MAAOD,MAAMC,YAAW,KACzCF,MAAMG,SAAQ,MAAOF,MAAME,SAAQ,KACnCH,MAAMjB,QAAO,MAAO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AAMmH,WAAW;EACtBC,MAAMrK;EACNsK,SAASjJ;EACTkJ,MAAMrH;AACR;",
6
+ "names": ["createContext", "addDays", "format", "startOfDay", "startOfWeek", "React", "forwardRef", "useCallback", "useEffect", "useImperativeHandle", "useMemo", "useRef", "useState", "useResizeDetector", "List", "Event", "IconButton", "useTranslation", "composable", "composableProps", "mx", "translationKey", "differenceInCalendarDays", "getDate", "start", "weekNumber", "dayOfWeek", "weekStartsOn", "result", "Date", "startDayOfWeek", "getDay", "adjustedStartDay", "setDate", "getRowIndex", "date", "row0Start", "Math", "floor", "isSameDay", "date1", "date2", "getFullYear", "getMonth", "maxRows", "start", "Date", "size", "defaultWidth", "EDGE_SCROLL_ZONE", "EDGE_SCROLL_MAX_SPEED", "makeRange", "a", "b", "dayA", "startOfDay", "dayB", "from", "to", "isInRange", "date", "range", "day", "getTime", "cellDate", "el", "current", "document", "body", "iso", "getAttribute", "parentElement", "undefined", "CalendarContextProvider", "useCalendarContext", "createContext", "CalendarRoot", "forwardRef", "children", "weekStartsOn", "forwardedRef", "event", "useMemo", "Event", "selected", "setSelected", "useState", "index", "setIndex", "setRange", "pendingRange", "setPendingRange", "useImperativeHandle", "scrollTo", "emit", "type", "CALENDAR_TOOLBAR_NAME", "CalendarToolbar", "composable", "classNames", "props", "t", "useTranslation", "translationKey", "top", "getDate", "today", "handleToday", "useCallback", "div", "composableProps", "role", "ref", "style", "width", "className", "IconButton", "variant", "icon", "iconOnly", "label", "onClick", "format", "getFullYear", "displayName", "CALENDAR_GRID_NAME", "CalendarGrid", "rows", "dates", "initialDate", "onSelect", "onSelectRange", "containerRef", "height", "useResizeDetector", "maxHeight", "listRef", "useRef", "gridRef", "dateSet", "Set", "map", "toISOString", "hasDate", "has", "initialized", "setInitialized", "useEffect", "getRowIndex", "scrollToRow", "on", "days", "weekStart", "startOfWeek", "Array", "length", "_", "i", "addDays", "anchorRef", "focusRef", "draggingRef", "pointerXRef", "pointerYRef", "scrollTopRef", "scrollRafRef", "scrollIntoView", "targetRow", "visibleHeight", "firstFullyVisibleRow", "Math", "ceil", "lastFullyVisibleRow", "floor", "scrollToPosition", "max", "updateRangeFromAnchor", "focus", "fireRange", "anchor", "isSameDay", "committed", "prevSelectedRef", "handleDayPointerDown", "ev", "preventDefault", "preventScroll", "handleDayPointerEnter", "handleDayPointerUp", "wasDragging", "cancel", "window", "addEventListener", "removeEventListener", "tickEdgeScroll", "rect", "getBoundingClientRect", "y", "delta", "min", "bottom", "newScroll", "elementFromPoint", "requestAnimationFrame", "handleMove", "clientX", "clientY", "cancelAnimationFrame", "handleKeyDown", "dx", "key", "shiftKey", "newFocus", "next", "activeRange", "handleScroll", "info", "scrollTop", "round", "rowRenderer", "getBgColor", "getMonth", "gridTemplateColumns", "inRange", "border", "data-date", "mx", "onPointerDown", "onPointerEnter", "onPointerUp", "span", "node", "tabIndex", "onKeyDown", "List", "rowCount", "rowHeight", "scrollToAlignment", "onScroll", "onRowsRendered", "Calendar", "Root", "Toolbar", "Grid"]
7
7
  }
@@ -1 +1 @@
1
- {"inputs":{"src/components/Calendar/util.ts":{"bytes":2699,"imports":[],"format":"esm"},"src/components/Calendar/Calendar.tsx":{"bytes":29347,"imports":[{"path":"@radix-ui/react-context","kind":"import-statement","external":true},{"path":"date-fns","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react-resize-detector","kind":"import-statement","external":true},{"path":"react-virtualized","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/ui-theme","kind":"import-statement","external":true},{"path":"#translations","kind":"import-statement","external":true},{"path":"src/components/Calendar/util.ts","kind":"import-statement","original":"./util"}],"format":"esm"},"src/components/Calendar/index.ts":{"bytes":376,"imports":[{"path":"src/components/Calendar/Calendar.tsx","kind":"import-statement","original":"./Calendar"}],"format":"esm"},"src/components/index.ts":{"bytes":376,"imports":[{"path":"src/components/Calendar/index.ts","kind":"import-statement","original":"./Calendar"}],"format":"esm"},"src/index.ts":{"bytes":382,"imports":[{"path":"src/components/index.ts","kind":"import-statement","original":"./components"}],"format":"esm"},"src/translations.ts":{"bytes":1105,"imports":[],"format":"esm"}},"outputs":{"dist/lib/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":17459},"dist/lib/browser/index.mjs":{"imports":[{"path":"@radix-ui/react-context","kind":"import-statement","external":true},{"path":"date-fns","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react-resize-detector","kind":"import-statement","external":true},{"path":"react-virtualized","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/ui-theme","kind":"import-statement","external":true},{"path":"#translations","kind":"import-statement","external":true}],"exports":["Calendar"],"entryPoint":"src/index.ts","inputs":{"src/components/Calendar/Calendar.tsx":{"bytesInOutput":7296},"src/components/Calendar/util.ts":{"bytesInOutput":517},"src/components/Calendar/index.ts":{"bytesInOutput":0},"src/components/index.ts":{"bytesInOutput":0},"src/index.ts":{"bytesInOutput":0}},"bytes":7988},"dist/lib/browser/translations.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":582},"dist/lib/browser/translations.mjs":{"imports":[],"exports":["translationKey","translations"],"entryPoint":"src/translations.ts","inputs":{"src/translations.ts":{"bytesInOutput":167}},"bytes":277}}}
1
+ {"inputs":{"src/components/Calendar/util.ts":{"bytes":5384,"imports":[{"path":"date-fns","kind":"import-statement","external":true}],"format":"esm"},"src/components/Calendar/Calendar.tsx":{"bytes":73196,"imports":[{"path":"@radix-ui/react-context","kind":"import-statement","external":true},{"path":"date-fns","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react-resize-detector","kind":"import-statement","external":true},{"path":"react-virtualized","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/ui-theme","kind":"import-statement","external":true},{"path":"#translations","kind":"import-statement","external":true},{"path":"src/components/Calendar/util.ts","kind":"import-statement","original":"./util"}],"format":"esm"},"src/components/Calendar/index.ts":{"bytes":376,"imports":[{"path":"src/components/Calendar/Calendar.tsx","kind":"import-statement","original":"./Calendar"}],"format":"esm"},"src/components/index.ts":{"bytes":376,"imports":[{"path":"src/components/Calendar/index.ts","kind":"import-statement","original":"./Calendar"}],"format":"esm"},"src/index.ts":{"bytes":382,"imports":[{"path":"src/components/index.ts","kind":"import-statement","original":"./components"}],"format":"esm"},"src/translations.ts":{"bytes":1105,"imports":[],"format":"esm"}},"outputs":{"dist/lib/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":40856},"dist/lib/browser/index.mjs":{"imports":[{"path":"@radix-ui/react-context","kind":"import-statement","external":true},{"path":"date-fns","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react-resize-detector","kind":"import-statement","external":true},{"path":"react-virtualized","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/ui-theme","kind":"import-statement","external":true},{"path":"#translations","kind":"import-statement","external":true},{"path":"date-fns","kind":"import-statement","external":true}],"exports":["Calendar"],"entryPoint":"src/index.ts","inputs":{"src/components/Calendar/Calendar.tsx":{"bytesInOutput":15985},"src/components/Calendar/util.ts":{"bytesInOutput":918},"src/components/Calendar/index.ts":{"bytesInOutput":0},"src/components/index.ts":{"bytesInOutput":0},"src/index.ts":{"bytesInOutput":0}},"bytes":17078},"dist/lib/browser/translations.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":582},"dist/lib/browser/translations.mjs":{"imports":[],"exports":["translationKey","translations"],"entryPoint":"src/translations.ts","inputs":{"src/translations.ts":{"bytesInOutput":167}},"bytes":277}}}