@remit/web-client 0.0.230 → 0.0.231

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.
Files changed (36) hide show
  1. package/package.json +1 -1
  2. package/src/components/calendar/CalendarComposePane.stories.tsx +25 -0
  3. package/src/components/calendar/CalendarComposePane.tsx +34 -0
  4. package/src/components/calendar/CalendarEventPane.stories.tsx +81 -0
  5. package/src/components/calendar/CalendarEventPane.tsx +67 -0
  6. package/src/components/calendar/CalendarShell.tsx +83 -0
  7. package/src/components/calendar/CalendarViewPlaceholder.tsx +37 -0
  8. package/src/components/calendar/CalendarWorkspace.stories.tsx +197 -0
  9. package/src/components/calendar/CalendarWorkspace.tsx +162 -0
  10. package/src/components/calendar/OpenCalendarEvent.tsx +39 -0
  11. package/src/components/calendar/calendar-workspace.render.test.ts +193 -0
  12. package/src/components/mail/MailSidebarAdapter.tsx +17 -0
  13. package/src/hooks/useCalendarData.ts +72 -0
  14. package/src/lib/calendar-density.ts +34 -0
  15. package/src/lib/calendar-fixtures.ts +207 -0
  16. package/src/lib/calendar-format.ts +29 -0
  17. package/src/lib/calendar-route.test.ts +210 -0
  18. package/src/lib/calendar-route.ts +183 -0
  19. package/src/lib/search-params.test.ts +77 -0
  20. package/src/lib/search-params.ts +59 -0
  21. package/src/routeTree.gen.ts +199 -0
  22. package/src/router.tsx +5 -0
  23. package/src/routes/calendar/$view.$date/$calendarObjectId/$recurrenceId.tsx +26 -0
  24. package/src/routes/calendar/$view.$date/$calendarObjectId/index.tsx +18 -0
  25. package/src/routes/calendar/$view.$date/$calendarObjectId.tsx +15 -0
  26. package/src/routes/calendar/$view.$date/index.tsx +25 -0
  27. package/src/routes/calendar/$view.$date/new.tsx +20 -0
  28. package/src/routes/calendar/$view.$date.tsx +100 -0
  29. package/src/routes/calendar/-calendar-tree.test.ts +267 -0
  30. package/src/routes/calendar/index.tsx +27 -0
  31. package/src/routes/calendar.tsx +98 -0
  32. package/src/routing/calendar-fragment.test.ts +66 -0
  33. package/src/routing/calendar.ts +139 -0
  34. package/src/routing/fragment.ts +19 -0
  35. package/src/routing/index.ts +10 -0
  36. package/src/routing/nav-selection.ts +2 -0
@@ -27,6 +27,25 @@ export type OverlayPanel = (typeof overlayPanels)[number];
27
27
  export const isOverlayPanel = (panel: PanelFragment): panel is OverlayPanel =>
28
28
  (overlayPanels as readonly PanelFragment[]).includes(panel);
29
29
 
30
+ /**
31
+ * The set an overlay opening or closing leaves behind it.
32
+ *
33
+ * A write states the whole set, so raising the nav slide-over has to say what
34
+ * else is up or it takes it down. The panes stay and the previous overlay goes,
35
+ * because two overlays cannot both be up — which is how a reader crossing from
36
+ * their mail into the calendar and reaching for the folders keeps the rail they
37
+ * arrived with.
38
+ */
39
+ export function panelsWithOverlay(
40
+ open: readonly PanelFragment[],
41
+ overlay: OverlayPanel | undefined,
42
+ ): PanelFragment[] {
43
+ return [
44
+ ...open.filter((panel) => !isOverlayPanel(panel)),
45
+ ...(overlay ? [overlay] : []),
46
+ ];
47
+ }
48
+
30
49
  const panelFragmentSchema = z.enum(panelFragments);
31
50
 
32
51
  /**
@@ -3,6 +3,15 @@ export {
3
3
  useBrowsedList,
4
4
  useOpensDetail,
5
5
  } from "./browsed-list";
6
+ export {
7
+ type CalendarAddress,
8
+ type CalendarNavigation,
9
+ type OpenCalendarEvent,
10
+ useCalendarAddress,
11
+ useCalendarNavigation,
12
+ useIsWritingEvent,
13
+ useOpenCalendarEvent,
14
+ } from "./calendar";
6
15
  export {
7
16
  useAdoptComposeDraft,
8
17
  useCloseCompose,
@@ -18,6 +27,7 @@ export {
18
27
  overlayPanels,
19
28
  type PanelFragment,
20
29
  panelFragments,
30
+ panelsWithOverlay,
21
31
  parseOpenPanels,
22
32
  retainOpenPanelsAtTier,
23
33
  useOpenPanels,
@@ -5,6 +5,7 @@ import { locationIsOnList } from "@/lib/mail-route";
5
5
  * The nav entry the address selects, or `""` where none does.
6
6
  *
7
7
  * - `/settings/*` → "settings"
8
+ * - `/calendar/*` → "calendar"
8
9
  * - `/mail/outbox`, `/mail/flagged`, `/mail/brief` → that list
9
10
  * - `/mail/$mailboxId` → the mailbox id, which is what the sidebar keys on
10
11
  *
@@ -17,6 +18,7 @@ export function useSelectedNavId(): string {
17
18
  const mailbox = useParams({ from: "/mail/$mailboxId", shouldThrow: false });
18
19
 
19
20
  if (locationIsOnList(pathname, "/settings")) return "settings";
21
+ if (locationIsOnList(pathname, "/calendar")) return "calendar";
20
22
  if (locationIsOnList(pathname, "/mail/outbox")) return "outbox";
21
23
  if (locationIsOnList(pathname, "/mail/flagged")) return "flagged";
22
24
  if (locationIsOnList(pathname, "/mail/brief")) return "brief";