@remit/ui 0.0.224 → 0.0.226

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 (68) hide show
  1. package/dist/components/app-shell-slotted.js +1 -1
  2. package/dist/components/app-switcher.d.ts +15 -0
  3. package/dist/components/app-switcher.js +31 -0
  4. package/dist/components/calendar-event-popup.d.ts +43 -0
  5. package/dist/components/calendar-event-popup.js +18 -0
  6. package/dist/components/calendar-event-sidebar.d.ts +45 -0
  7. package/dist/components/calendar-event-sidebar.js +19 -0
  8. package/dist/components/calendar-grid.d.ts +11 -7
  9. package/dist/components/calendar-grid.js +55 -109
  10. package/dist/components/calendar-guests.d.ts +80 -0
  11. package/dist/components/calendar-guests.js +102 -0
  12. package/dist/components/calendar-popover.d.ts +25 -0
  13. package/dist/components/calendar-popover.js +84 -0
  14. package/dist/components/calendar-quick-create.d.ts +53 -0
  15. package/dist/components/calendar-quick-create.js +43 -0
  16. package/dist/components/calendar-screen-toolbar.d.ts +30 -0
  17. package/dist/components/calendar-screen-toolbar.js +24 -0
  18. package/dist/components/calendar-sheet.d.ts +14 -0
  19. package/dist/components/calendar-sheet.js +34 -0
  20. package/dist/components/calendar-side-pane.d.ts +20 -0
  21. package/dist/components/calendar-side-pane.js +11 -0
  22. package/dist/components/calendar-suggestion-list.d.ts +11 -0
  23. package/dist/components/calendar-suggestion-list.js +9 -0
  24. package/dist/components/calendar-task-popup.d.ts +28 -0
  25. package/dist/components/calendar-task-popup.js +17 -0
  26. package/dist/components/calendar-time-grid.d.ts +70 -0
  27. package/dist/components/calendar-time-grid.js +701 -0
  28. package/dist/components/calendar-toolbar.d.ts +0 -31
  29. package/dist/components/calendar-toolbar.js +0 -27
  30. package/dist/components/calendar-types.d.ts +12 -2
  31. package/dist/components/calendar-types.js +0 -5
  32. package/dist/components/calendar-year.d.ts +11 -0
  33. package/dist/components/calendar-year.js +9 -0
  34. package/dist/components/compose-fab.js +3 -1
  35. package/dist/components/event-editor.js +2 -1
  36. package/dist/components/intelligence-calendar.d.ts +1 -1
  37. package/dist/components/intelligence-calendar.js +10 -16
  38. package/dist/components/mini-month.d.ts +19 -0
  39. package/dist/components/mini-month.js +34 -0
  40. package/dist/components/recurrence-scope-prompt.d.ts +3 -1
  41. package/dist/components/recurrence-scope-prompt.js +4 -2
  42. package/dist/index.d.ts +24 -5
  43. package/dist/index.js +23 -4
  44. package/dist/lib/calendar-range.d.ts +10 -0
  45. package/dist/lib/calendar-range.js +39 -0
  46. package/dist/lib/calendar-slot-pick.d.ts +29 -0
  47. package/dist/lib/calendar-slot-pick.js +67 -0
  48. package/dist/lib/event-drag.d.ts +20 -0
  49. package/dist/lib/event-drag.js +50 -0
  50. package/dist/lib/grid-keyboard.d.ts +15 -0
  51. package/dist/lib/grid-keyboard.js +46 -0
  52. package/dist/lib/guest-list.d.ts +17 -0
  53. package/dist/lib/guest-list.js +34 -0
  54. package/dist/lib/iso-week.d.ts +2 -0
  55. package/dist/lib/iso-week.js +13 -0
  56. package/dist/lib/long-press.d.ts +25 -0
  57. package/dist/lib/long-press.js +37 -0
  58. package/dist/lib/mini-month.d.ts +27 -0
  59. package/dist/lib/mini-month.js +33 -0
  60. package/dist/lib/popup-placement.d.ts +22 -0
  61. package/dist/lib/popup-placement.js +39 -0
  62. package/dist/lib/time-grid-layout.d.ts +38 -0
  63. package/dist/lib/time-grid-layout.js +94 -0
  64. package/package.json +1 -1
  65. package/dist/components/calendar-suggestion-deck.d.ts +0 -18
  66. package/dist/components/calendar-suggestion-deck.js +0 -51
  67. package/dist/components/event-detail.d.ts +0 -38
  68. package/dist/components/event-detail.js +0 -21
@@ -1,5 +1,3 @@
1
- import { type ReactNode } from "react";
2
- import type { CalendarViewId } from "./calendar-types.js";
3
1
  export interface SegmentOption<T extends string> {
4
2
  value: T;
5
3
  label: string;
@@ -22,32 +20,3 @@ export interface SegmentedProps<T extends string> {
22
20
  className?: string;
23
21
  }
24
22
  export declare function Segmented<T extends string>({ options, value, onChange, touch, ariaLabel, className, }: SegmentedProps<T>): import("react").JSX.Element;
25
- export interface CalendarViewSwitchProps {
26
- value: CalendarViewId;
27
- onChange: (view: CalendarViewId) => void;
28
- /** Restricts the ladder — a phone has no room for a year grid. */
29
- views?: CalendarViewId[];
30
- touch?: boolean;
31
- className?: string;
32
- }
33
- /**
34
- * The zoom ladder. Each step keeps the date in view, so moving between them is
35
- * changing magnification rather than opening a different screen.
36
- */
37
- export declare function CalendarViewSwitch({ value, onChange, views, touch, className, }: CalendarViewSwitchProps): import("react").JSX.Element;
38
- export interface CalendarDateNavProps {
39
- /** The range on screen, already formatted. */
40
- title: string;
41
- onPrev: () => void;
42
- onNext: () => void;
43
- onToday: () => void;
44
- /** Right-hand controls: the view switch, whatever else the view owns. */
45
- children?: ReactNode;
46
- touch?: boolean;
47
- }
48
- /**
49
- * Back, forward, and Today. Today lands on the same target from every view and
50
- * every distance away, so it is a way home rather than a jump whose result
51
- * depends on where you were.
52
- */
53
- export declare function CalendarDateNav({ title, onPrev, onNext, onToday, children, touch, }: CalendarDateNavProps): import("react").JSX.Element;
@@ -1,5 +1,4 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { ChevronLeft, ChevronRight } from "lucide-react";
3
2
  import { useId } from "react";
4
3
  import { cn } from "../lib/cn.js";
5
4
  /**
@@ -16,29 +15,3 @@ export function Segmented({ options, value, onChange, touch, ariaLabel, classNam
16
15
  const group = useId();
17
16
  return (_jsxs("fieldset", { className: cn("inline-flex items-center gap-0.5", className), children: [_jsx("legend", { className: "sr-only", children: ariaLabel }), options.map((option) => (_jsxs("label", { className: cn(segmentClassName(value === option.value), touch ? "min-h-11 flex-1 text-sm" : "h-7 text-xs"), children: [_jsx("input", { type: "radio", name: group, value: option.value, checked: value === option.value, onChange: () => onChange(option.value), className: "sr-only" }), touch ? option.shortLabel : option.label] }, option.value)))] }));
18
17
  }
19
- const VIEW_OPTIONS = [
20
- { value: "year", label: "Year", shortLabel: "Y" },
21
- { value: "month", label: "Month", shortLabel: "M" },
22
- { value: "week", label: "Week", shortLabel: "W" },
23
- { value: "day", label: "Day", shortLabel: "D" },
24
- { value: "agenda", label: "Agenda", shortLabel: "List" },
25
- ];
26
- /**
27
- * The zoom ladder. Each step keeps the date in view, so moving between them is
28
- * changing magnification rather than opening a different screen.
29
- */
30
- export function CalendarViewSwitch({ value, onChange, views, touch, className, }) {
31
- const options = views
32
- ? VIEW_OPTIONS.filter((option) => views.includes(option.value))
33
- : VIEW_OPTIONS;
34
- return (_jsx(Segmented, { ariaLabel: "Calendar view", options: options, value: value, onChange: onChange, touch: touch, className: className }));
35
- }
36
- /**
37
- * Back, forward, and Today. Today lands on the same target from every view and
38
- * every distance away, so it is a way home rather than a jump whose result
39
- * depends on where you were.
40
- */
41
- export function CalendarDateNav({ title, onPrev, onNext, onToday, children, touch, }) {
42
- const stepClass = cn("flex items-center justify-center rounded-md text-fg-muted outline-none transition-colors hover:bg-surface-sunken hover:text-fg focus-visible:ring-2 focus-visible:ring-ring", touch ? "size-11" : "size-7");
43
- return (_jsxs("div", { className: "flex min-w-0 items-center gap-2", children: [_jsx("button", { type: "button", onClick: onPrev, "aria-label": "Previous", className: stepClass, children: _jsx(ChevronLeft, { className: "size-4" }) }), _jsx("button", { type: "button", onClick: onNext, "aria-label": "Next", className: stepClass, children: _jsx(ChevronRight, { className: "size-4" }) }), _jsx("button", { type: "button", onClick: onToday, className: cn("rounded-md border border-line px-2.5 font-medium text-fg outline-none transition-colors hover:bg-surface-sunken focus-visible:ring-2 focus-visible:ring-ring", touch ? "min-h-11 text-sm" : "h-7 text-xs"), children: "Today" }), _jsx("h2", { className: "min-w-0 flex-1 truncate text-sm font-semibold text-fg", children: title }), children] }));
44
- }
@@ -1,3 +1,4 @@
1
+ import type { GuestEntry } from "../lib/guest-list.js";
1
2
  /**
2
3
  * The shapes the calendar surfaces pass around. Presentational only: a
3
4
  * component here takes one of these and renders it, and every mutation leaves
@@ -72,6 +73,16 @@ export interface CalendarEventData {
72
73
  seriesException: boolean;
73
74
  status: "confirmed" | "tentative";
74
75
  }
76
+ /** A task as the grid draws it: a to-do on its due day, with a checkbox. */
77
+ export interface CalendarTaskData {
78
+ calendarTaskId: string;
79
+ calendarId: string;
80
+ title: string;
81
+ /** `YYYY-MM-DD` on an all-day task, else the due instant. */
82
+ due: string;
83
+ allDay: boolean;
84
+ completed: boolean;
85
+ }
75
86
  /**
76
87
  * One day, with everything on it already sorted and measured. The surfaces that
77
88
  * render a day take this rather than a flat event list, so the arithmetic is
@@ -223,8 +234,7 @@ export interface EventDraft {
223
234
  allDay: boolean;
224
235
  calendarId: string;
225
236
  location: string;
226
- /** Free text, one guest per comma — the prototype does not resolve them. */
227
- guests: string;
237
+ guests: GuestEntry[];
228
238
  notes: string;
229
239
  /** Human-readable rule, empty for a one-off. */
230
240
  repeat: string;
@@ -1,8 +1,3 @@
1
- /**
2
- * The shapes the calendar surfaces pass around. Presentational only: a
3
- * component here takes one of these and renders it, and every mutation leaves
4
- * through a callback. Nothing in this file knows where the data came from.
5
- */
6
1
  export const calendarColorIds = [
7
2
  "cal-1",
8
3
  "cal-2",
@@ -0,0 +1,11 @@
1
+ export interface CalendarYearProps {
2
+ /** Any date in the year to draw. */
3
+ date: string;
4
+ today: string;
5
+ /** Events per day; a dot marks each day that has one. */
6
+ counts: Readonly<Record<string, number>>;
7
+ onPickDay: (date: string) => void;
8
+ className?: string;
9
+ }
10
+ /** Twelve small months with ISO week numbers, today filled and busy days dotted. */
11
+ export declare function CalendarYear({ date, today, counts, onPickDay, className, }: CalendarYearProps): import("react").JSX.Element;
@@ -0,0 +1,9 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { cn } from "../lib/cn.js";
3
+ import { MiniMonth } from "./mini-month.js";
4
+ const MONTHS = Array.from({ length: 12 }, (_, index) => String(index + 1).padStart(2, "0"));
5
+ /** Twelve small months with ISO week numbers, today filled and busy days dotted. */
6
+ export function CalendarYear({ date, today, counts, onPickDay, className, }) {
7
+ const year = date.slice(0, 4);
8
+ return (_jsx("div", { "data-calendar-year": "", className: cn("grid h-full content-start gap-x-8 gap-y-6 overflow-y-auto p-6 [grid-template-columns:repeat(auto-fill,minmax(15rem,1fr))]", className), children: MONTHS.map((month) => (_jsx(MiniMonth, { month: `${year}-${month}-01`, today: today, onPickDay: onPickDay, counts: counts }, month))) }));
9
+ }
@@ -1,5 +1,7 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { Pencil } from "lucide-react";
3
3
  export function ComposeFab({ onCompose }) {
4
- return (_jsx("button", { type: "button", onClick: onCompose, "aria-label": "Compose new message", className: "lg:hidden fixed right-4 z-30 h-14 w-14 rounded-full bg-accent text-accent-fg shadow-lg flex items-center justify-center hover:opacity-90 active:scale-95 transition-all", style: { bottom: "calc(env(safe-area-inset-bottom, 0) + 1rem)" }, children: _jsx(Pencil, { className: "size-6" }) }));
4
+ return (_jsx("button", { type: "button", onClick: onCompose, "aria-label": "Compose new message", className: "lg:hidden fixed right-4 z-30 h-14 w-14 rounded-full bg-accent text-accent-fg shadow-lg flex items-center justify-center hover:opacity-90 active:scale-95 transition-all", style: {
5
+ bottom: "calc(var(--app-tab-bar, 0px) + env(safe-area-inset-bottom, 0px) + 1rem)",
6
+ }, children: _jsx(Pencil, { className: "size-6" }) }));
5
7
  }
@@ -6,6 +6,7 @@ import { calendarColorClasses } from "../lib/calendar-color.js";
6
6
  import { cn } from "../lib/cn.js";
7
7
  import { NO_REPEAT, repeatChoices } from "../lib/recurrence.js";
8
8
  import { Button } from "./button.js";
9
+ import { CalendarGuestsField } from "./calendar-guests.js";
9
10
  import { Input } from "./input.js";
10
11
  import { Select } from "./select.js";
11
12
  const NOTES_CLASS = "w-full rounded-md border border-line bg-surface-sunken px-3 py-2 text-sm text-fg outline-none placeholder:text-fg-subtle focus-visible:border-line-strong focus-visible:ring-2 focus-visible:ring-ring/30";
@@ -95,7 +96,7 @@ export function EventLocationField({ draft, onChange, touch, }) {
95
96
  return (_jsx(Input, { value: draft.location, placeholder: "Location", "aria-label": "Location", onChange: (e) => setField({ draft, onChange }, "location", e.target.value), className: touch ? "min-h-11" : "" }));
96
97
  }
97
98
  export function EventGuestsField({ draft, onChange, touch }) {
98
- return (_jsx(Input, { value: draft.guests, placeholder: "Guests, comma separated", "aria-label": "Guests", onChange: (e) => setField({ draft, onChange }, "guests", e.target.value), className: touch ? "min-h-11" : "" }));
99
+ return (_jsx(CalendarGuestsField, { value: draft.guests, onChange: (guests) => onChange({ ...draft, guests }), suggestions: [], onQuery: () => undefined, touch: touch }));
99
100
  }
100
101
  export function EventNotesField({ draft, onChange, layout = "compact", }) {
101
102
  return (_jsx("textarea", { value: draft.notes, placeholder: "Notes", "aria-label": "Notes", onChange: (e) => setField({ draft, onChange }, "notes", e.target.value), rows: layout === "pane" ? 6 : 3, className: NOTES_CLASS }));
@@ -64,7 +64,7 @@ export interface IntelligenceCalendarData {
64
64
  day: CalendarDayEntry[];
65
65
  /** The day those entries sit on, in words. */
66
66
  dayLabel: string;
67
- /** An answer to the top reading is on its way to the server. */
67
+ /** An answer to one of the readings is on its way to the server. */
68
68
  suggestionsBusy?: boolean;
69
69
  /** What the tab could not read. Empty when it read everything. */
70
70
  failure?: string;
@@ -7,16 +7,13 @@ import { CalendarEventChip } from "./calendar-event-chip.js";
7
7
  import { CalendarFailureNote } from "./calendar-failure-note.js";
8
8
  import { CalendarInviteCard } from "./calendar-invite-card.js";
9
9
  import { CalendarSlotOffers } from "./calendar-slot-offers.js";
10
- import { CalendarSuggestionDeck } from "./calendar-suggestion-deck.js";
11
- import { EventSuggestionCard, settleZone, ZONE_UNSETTLED_REASON, } from "./event-suggestion-card.js";
10
+ import { CalendarSuggestionList } from "./calendar-suggestion-list.js";
11
+ import { EventSuggestionCard } from "./event-suggestion-card.js";
12
12
  import { IntelligenceSection } from "./intelligence-section.js";
13
13
  export function IntelligenceCalendar({ data, actions, selectedEventId = "", touch, className, }) {
14
14
  const { invite, prose, suggestions, day, dayLabel, suggestionsBusy = false, failure = "", suggestionsFailure = "", reportHref, addBlocked, } = data;
15
15
  const { onReviewSuggestion, onOpenThread } = actions;
16
16
  const [zoneChoices, setZoneChoices] = useState({});
17
- const top = suggestions[0];
18
- const topChoice = top === undefined ? "" : (zoneChoices[top.suggestion.id] ?? "");
19
- const topSettlement = top === undefined ? undefined : settleZone(top.suggestion, topChoice);
20
17
  const picked = new Set(prose?.picked ?? []);
21
18
  const nothingToSay = failure === "" &&
22
19
  invite === undefined &&
@@ -29,15 +26,12 @@ export function IntelligenceCalendar({ data, actions, selectedEventId = "", touc
29
26
  ? { sender: invite.sender, onMute: actions.onMuteInvite }
30
27
  : undefined, onAdd: actions.onAddInvite, onTentative: actions.onTentativeInvite, onDecline: actions.onDeclineInvite, onReopen: actions.onReopenInvite, onOfferOtherTimes: actions.onOfferOtherTimes, onRemove: actions.onRemoveInvite, onOpenNewer: actions.onOpenNewerInvite, touch: touch }) })), prose && (_jsxs(IntelligenceSection, { label: prose.proposals.length > 0
31
28
  ? `Times named · ${prose.dayLabel}`
32
- : `Other times · ${prose.dayLabel}`, children: [_jsx("ul", { className: cn("flex flex-col gap-1", prose.proposals.length === 0 && "hidden"), children: prose.proposals.map((proposal) => (_jsxs("li", { className: "flex items-baseline gap-2 text-xs", children: [_jsx("span", { className: "w-24 shrink-0 truncate tabular-nums text-fg", children: proposal.phrase }), proposal.clashTitle === "" ? (_jsx("span", { className: "min-w-0 flex-1 truncate text-positive", children: "Nothing booked" })) : (_jsxs("span", { className: "min-w-0 flex-1 truncate text-danger", children: [proposal.clashTitle, " is already there"] }))] }, proposal.id))) }), _jsx("p", { className: "mt-3 pb-1.5 text-2xs uppercase tracking-wider text-fg-subtle", children: "Free, half an hour each" }), _jsx(CalendarSlotOffers, { slots: prose.slots, picked: picked, onToggle: actions.onToggleSlot, touch: touch, scroll: true }), actions.onReplyWithSlots ? (_jsxs("div", { className: "mt-2 flex flex-col gap-1.5", children: [_jsx(Button, { variant: "secondary", size: touch ? "md" : "sm", icon: _jsx(Reply, { className: "size-3.5" }), onClick: actions.onReplyWithSlots, disabled: picked.size === 0, className: cn("self-start", touch && "min-h-11"), children: "Reply with these times" }), _jsx("p", { className: "text-2xs text-fg-subtle", children: "Picked slots go into the reply as plain text. Nothing is booked." })] })) : (_jsx("p", { className: "mt-1.5 text-2xs text-fg-subtle", children: "Picked slots go into the reply as plain text. Nothing is booked." }))] })), suggestions.length > 0 && (_jsxs(IntelligenceSection, { label: "Read out of this thread", children: [_jsx(CalendarSuggestionDeck, { hasCard: top !== undefined, remaining: suggestions.length, blocked: topSettlement !== undefined && !topSettlement.settled, blockedReason: ZONE_UNSETTLED_REASON, onConfirm: () => {
33
- if (top && topSettlement?.settled && addBlocked === undefined)
34
- actions.onAddSuggestion(top.suggestion.id, topSettlement.timeZone);
35
- }, onReject: () => {
36
- if (top)
37
- actions.onDismissSuggestion(top.suggestion.id);
38
- }, children: top && (_jsx(EventSuggestionCard, { suggestion: top.suggestion, whenText: top.whenText, addLabel: "Add to calendar", zoneChoice: topChoice, onZoneChoice: (timeZone) => setZoneChoices((prev) => ({
39
- ...prev,
40
- [top.suggestion.id]: timeZone,
41
- })), onAdd: (timeZone) => actions.onAddSuggestion(top.suggestion.id, timeZone), onReview: onReviewSuggestion &&
42
- ((timeZone) => onReviewSuggestion(top.suggestion.id, timeZone)), onDismiss: () => actions.onDismissSuggestion(top.suggestion.id), onOpenThread: onOpenThread && (() => onOpenThread(top.suggestion.threadId)), busy: suggestionsBusy, addBlocked: addBlocked !== undefined, touch: touch })) }), addBlocked !== undefined && (_jsx("div", { className: "mt-2 rounded-md border border-warning/40 bg-warning-soft p-2 text-xs text-fg", children: addBlocked })), suggestionsFailure !== "" && (_jsx(CalendarFailureNote, { text: suggestionsFailure, reportHref: reportHref, className: "mt-2" })), _jsx("p", { className: "mt-2 text-2xs text-fg-subtle", children: "None of this is on your calendar, and none of it will be until you say so." })] })), day.length > 0 && (_jsx(IntelligenceSection, { label: dayLabel, className: "border-b-0", children: _jsx("ul", { className: "flex flex-col gap-1", children: day.map((entry) => (_jsx("li", { children: _jsx(CalendarEventChip, { title: entry.event.title, timeText: entry.timeText, color: entry.color, layout: "row", density: "compact", rsvp: entry.event.myRsvp, status: entry.event.status, hasThread: entry.event.threadId !== "", isRecurring: entry.event.recurrenceRule !== "", zoneCertainty: entry.event.zoneCertainty, selected: entry.event.id === selectedEventId, onClick: () => actions.onSelectEvent(entry.event.id) }) }, entry.event.id))) }) }))] }));
29
+ : `Other times · ${prose.dayLabel}`, children: [_jsx("ul", { className: cn("flex flex-col gap-1", prose.proposals.length === 0 && "hidden"), children: prose.proposals.map((proposal) => (_jsxs("li", { className: "flex items-baseline gap-2 text-xs", children: [_jsx("span", { className: "w-24 shrink-0 truncate tabular-nums text-fg", children: proposal.phrase }), proposal.clashTitle === "" ? (_jsx("span", { className: "min-w-0 flex-1 truncate text-positive", children: "Nothing booked" })) : (_jsxs("span", { className: "min-w-0 flex-1 truncate text-danger", children: [proposal.clashTitle, " is already there"] }))] }, proposal.id))) }), _jsx("p", { className: "mt-3 pb-1.5 text-2xs uppercase tracking-wider text-fg-subtle", children: "Free, half an hour each" }), _jsx(CalendarSlotOffers, { slots: prose.slots, picked: picked, onToggle: actions.onToggleSlot, touch: touch, scroll: true }), actions.onReplyWithSlots ? (_jsxs("div", { className: "mt-2 flex flex-col gap-1.5", children: [_jsx(Button, { variant: "secondary", size: touch ? "md" : "sm", icon: _jsx(Reply, { className: "size-3.5" }), onClick: actions.onReplyWithSlots, disabled: picked.size === 0, className: cn("self-start", touch && "min-h-11"), children: "Reply with these times" }), _jsx("p", { className: "text-2xs text-fg-subtle", children: "Picked slots go into the reply as plain text. Nothing is booked." })] })) : (_jsx("p", { className: "mt-1.5 text-2xs text-fg-subtle", children: "Picked slots go into the reply as plain text. Nothing is booked." }))] })), suggestions.length > 0 && (_jsxs(IntelligenceSection, { label: "Read out of this thread", children: [_jsx(CalendarSuggestionList, { items: suggestions.map(({ suggestion, whenText }) => ({
30
+ id: suggestion.id,
31
+ card: (_jsx(EventSuggestionCard, { suggestion: suggestion, whenText: whenText, addLabel: "Add to calendar", zoneChoice: zoneChoices[suggestion.id] ?? "", onZoneChoice: (timeZone) => setZoneChoices((prev) => ({
32
+ ...prev,
33
+ [suggestion.id]: timeZone,
34
+ })), onAdd: (timeZone) => actions.onAddSuggestion(suggestion.id, timeZone), onReview: onReviewSuggestion &&
35
+ ((timeZone) => onReviewSuggestion(suggestion.id, timeZone)), onDismiss: () => actions.onDismissSuggestion(suggestion.id), onOpenThread: onOpenThread && (() => onOpenThread(suggestion.threadId)), busy: suggestionsBusy, addBlocked: addBlocked !== undefined, touch: touch })),
36
+ })) }), addBlocked !== undefined && (_jsx("div", { className: "mt-2 rounded-md border border-warning/40 bg-warning-soft p-2 text-xs text-fg", children: addBlocked })), suggestionsFailure !== "" && (_jsx(CalendarFailureNote, { text: suggestionsFailure, reportHref: reportHref, className: "mt-2" })), _jsx("p", { className: "mt-2 text-2xs text-fg-subtle", children: "None of this is on your calendar, and none of it will be until you say so." })] })), day.length > 0 && (_jsx(IntelligenceSection, { label: dayLabel, className: "border-b-0", children: _jsx("ul", { className: "flex flex-col gap-1", children: day.map((entry) => (_jsx("li", { children: _jsx(CalendarEventChip, { title: entry.event.title, timeText: entry.timeText, color: entry.color, layout: "row", density: "compact", rsvp: entry.event.myRsvp, status: entry.event.status, hasThread: entry.event.threadId !== "", isRecurring: entry.event.recurrenceRule !== "", zoneCertainty: entry.event.zoneCertainty, selected: entry.event.id === selectedEventId, onClick: () => actions.onSelectEvent(entry.event.id) }) }, entry.event.id))) }) }))] }));
43
37
  }
@@ -0,0 +1,19 @@
1
+ export interface MiniMonthProps {
2
+ /** Any date in the month on show. */
3
+ month: string;
4
+ today: string;
5
+ /** The range on the grid, inclusive; empty for none. */
6
+ rangeStart?: string;
7
+ rangeEnd?: string;
8
+ onPickDay: (date: string) => void;
9
+ /** Moves the mini month; absent hides its arrows. */
10
+ onShowMonth?: (month: string) => void;
11
+ /** Events per day: a dot marks each day with one, and the day's name counts them. */
12
+ counts?: Readonly<Record<string, number>>;
13
+ className?: string;
14
+ }
15
+ /**
16
+ * A small month with ISO week numbers down the side. Today is filled and the
17
+ * range on the grid is shaded, as in Google Calendar's side pane.
18
+ */
19
+ export declare function MiniMonth({ month, today, rangeStart, rangeEnd, onPickDay, onShowMonth, counts, className, }: MiniMonthProps): import("react").JSX.Element;
@@ -0,0 +1,34 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { ChevronLeft, ChevronRight } from "lucide-react";
3
+ import { cn } from "../lib/cn.js";
4
+ import { miniMonthWeeks, shiftMonth } from "../lib/mini-month.js";
5
+ const WEEKDAYS = ["M", "T", "W", "T", "F", "S", "S"];
6
+ const fullDate = (date) => new Intl.DateTimeFormat(undefined, {
7
+ weekday: "long",
8
+ day: "numeric",
9
+ month: "long",
10
+ year: "numeric",
11
+ timeZone: "UTC",
12
+ }).format(new Date(`${date}T00:00:00Z`));
13
+ const monthTitle = (date) => new Intl.DateTimeFormat(undefined, {
14
+ month: "long",
15
+ year: "numeric",
16
+ timeZone: "UTC",
17
+ }).format(new Date(`${date.slice(0, 7)}-01T00:00:00Z`));
18
+ /**
19
+ * A small month with ISO week numbers down the side. Today is filled and the
20
+ * range on the grid is shaded, as in Google Calendar's side pane.
21
+ */
22
+ export function MiniMonth({ month, today, rangeStart = "", rangeEnd = "", onPickDay, onShowMonth, counts, className, }) {
23
+ const weeks = miniMonthWeeks({ month, today, rangeStart, rangeEnd });
24
+ const title = monthTitle(month);
25
+ return (_jsxs("section", { "aria-label": title, className: cn("select-none", className), children: [_jsxs("div", { className: "flex items-center justify-between px-1 pb-1", children: [_jsx("h2", { className: "text-sm font-medium text-fg", children: title }), onShowMonth && (_jsxs("div", { className: "flex", children: [_jsx("button", { type: "button", "aria-label": "Previous month", onClick: () => onShowMonth(shiftMonth(month, -1)), className: "flex size-7 items-center justify-center rounded-full text-fg-muted outline-none hover:bg-surface-sunken focus-visible:ring-2 focus-visible:ring-ring", children: _jsx(ChevronLeft, { className: "size-4" }) }), _jsx("button", { type: "button", "aria-label": "Next month", onClick: () => onShowMonth(shiftMonth(month, 1)), className: "flex size-7 items-center justify-center rounded-full text-fg-muted outline-none hover:bg-surface-sunken focus-visible:ring-2 focus-visible:ring-ring", children: _jsx(ChevronRight, { className: "size-4" }) })] }))] }), _jsxs("table", { className: "w-full border-collapse text-center text-2xs", children: [_jsx("thead", { children: _jsxs("tr", { className: "text-fg-subtle", children: [_jsx("th", { scope: "col", className: "w-6 font-normal", children: _jsx("span", { className: "sr-only", children: "Week" }) }), WEEKDAYS.map((weekday, index) => (_jsx("th", { scope: "col", className: "h-6 font-normal", children: weekday }, index)))] }) }), _jsx("tbody", { children: weeks.map((week) => (_jsxs("tr", { children: [_jsx("th", { scope: "row", className: "font-normal text-fg-subtle tabular-nums", children: week.weekNumber }), week.days.map((day) => {
26
+ const count = counts?.[day.date] ?? 0;
27
+ const label = counts === undefined
28
+ ? fullDate(day.date)
29
+ : `${fullDate(day.date)}, ${count === 1 ? "1 event" : `${count} events`}`;
30
+ return (_jsx("td", { className: cn("p-0", day.inRange && "bg-accent-soft"), children: _jsxs("button", { type: "button", "aria-label": label, "aria-current": day.isToday ? "date" : undefined, "data-date": day.date, onClick: () => onPickDay(day.date), className: cn("relative mx-auto flex size-7 items-center justify-center rounded-full tabular-nums outline-none transition-colors focus-visible:ring-2 focus-visible:ring-ring", day.isToday
31
+ ? "bg-accent font-semibold text-accent-fg"
32
+ : "hover:bg-surface-sunken", !day.isToday && !day.inMonth && "text-fg-subtle"), children: [day.day, count > 0 && !day.isToday && (_jsx("span", { "aria-hidden": "true", className: "absolute bottom-0.5 size-1 rounded-full bg-accent" }))] }) }, day.date));
33
+ })] }, week.days[0].date))) })] })] }));
34
+ }
@@ -8,6 +8,8 @@ export interface RecurrenceScopePromptProps {
8
8
  instanceText: string;
9
9
  onChoose: (scope: RecurrenceScope) => void;
10
10
  onCancel: () => void;
11
+ /** The scopes offered. An answer to an invitation takes this occurrence or all of them. */
12
+ scopes?: readonly RecurrenceScope[];
11
13
  touch?: boolean;
12
14
  className?: string;
13
15
  }
@@ -17,4 +19,4 @@ export interface RecurrenceScopePromptProps {
17
19
  * settled before the form opens, not confirmed on the way out when the change
18
20
  * has already been typed.
19
21
  */
20
- export declare function RecurrenceScopePrompt({ title, ruleText, instanceText, onChoose, onCancel, touch, className, }: RecurrenceScopePromptProps): import("react").JSX.Element;
22
+ export declare function RecurrenceScopePrompt({ title, ruleText, instanceText, onChoose, onCancel, scopes, touch, className, }: RecurrenceScopePromptProps): import("react").JSX.Element;
@@ -20,6 +20,8 @@ const choices = [
20
20
  * settled before the form opens, not confirmed on the way out when the change
21
21
  * has already been typed.
22
22
  */
23
- export function RecurrenceScopePrompt({ title, ruleText, instanceText, onChoose, onCancel, touch, className, }) {
24
- return (_jsxs("div", { className: cn("flex flex-col gap-3", className), children: [_jsxs("div", { children: [_jsxs("h2", { className: "text-md font-semibold text-fg", children: [title, " repeats"] }), _jsx("p", { className: "text-xs text-fg-muted", children: ruleText }), _jsxs("p", { className: "text-xs text-fg-subtle", children: ["You clicked ", instanceText, "."] })] }), _jsx("p", { className: "text-sm text-fg", children: "What should the change apply to?" }), _jsx("div", { className: "flex flex-col gap-1.5", children: choices.map((choice) => (_jsxs("button", { type: "button", onClick: () => onChoose(choice.scope), className: cn("flex flex-col rounded-md border border-line bg-surface px-3 py-2 text-left outline-none transition-colors hover:border-line-strong hover:bg-surface-sunken focus-visible:ring-2 focus-visible:ring-ring", touch && "min-h-11 justify-center"), children: [_jsx("span", { className: "text-sm font-medium text-fg", children: choice.label }), _jsx("span", { className: "text-2xs text-fg-subtle", children: choice.note })] }, choice.scope))) }), _jsx(Button, { variant: "ghost", size: touch ? "md" : "sm", onClick: onCancel, className: cn("self-start", touch && "min-h-11"), children: "Cancel" })] }));
23
+ export function RecurrenceScopePrompt({ title, ruleText, instanceText, onChoose, onCancel, scopes, touch, className, }) {
24
+ return (_jsxs("div", { className: cn("flex flex-col gap-3", className), children: [_jsxs("div", { children: [_jsxs("h2", { className: "text-md font-semibold text-fg", children: [title, " repeats"] }), _jsx("p", { className: "text-xs text-fg-muted", children: ruleText }), _jsxs("p", { className: "text-xs text-fg-subtle", children: ["You clicked ", instanceText, "."] })] }), _jsx("p", { className: "text-sm text-fg", children: "What should the change apply to?" }), _jsx("div", { className: "flex flex-col gap-1.5", children: choices
25
+ .filter((choice) => scopes === undefined || scopes.includes(choice.scope))
26
+ .map((choice) => (_jsxs("button", { type: "button", onClick: () => onChoose(choice.scope), className: cn("flex flex-col rounded-md border border-line bg-surface px-3 py-2 text-left outline-none transition-colors hover:border-line-strong hover:bg-surface-sunken focus-visible:ring-2 focus-visible:ring-ring", touch && "min-h-11 justify-center"), children: [_jsx("span", { className: "text-sm font-medium text-fg", children: choice.label }), _jsx("span", { className: "text-2xs text-fg-subtle", children: choice.note })] }, choice.scope))) }), _jsx(Button, { variant: "ghost", size: touch ? "md" : "sm", onClick: onCancel, className: cn("self-start", touch && "min-h-11"), children: "Cancel" })] }));
25
27
  }
package/dist/index.d.ts CHANGED
@@ -12,6 +12,7 @@ export { NextUpCard, type NextUpCardProps, } from "./components/agenda-panels.js
12
12
  export { AppPasswordHint, type AppPasswordHintProps, } from "./components/app-password-hint.js";
13
13
  export { type AppShellLayoutContext, AppShellSlotted, type AppShellSlottedProps, useAppShellLayout, } from "./components/app-shell-slotted.js";
14
14
  export { type AppShellProps, type Density, INTELLIGENCE_MIN_WIDTH, type MessageListKeyboard, type MessageListSelection, type NarrowView, type NavAccount, type NavAccountStatus, type NavLinkComponent, type NavLinkRenderProps, type NavMailbox, type NavMailboxRole, type PaneLayout, READING_PANE_MIN_WIDTH, resolvePaneLayout, type ThreadData, type ThreadMessageData, type ThreadRowData, type ThreadSection, type TouchSeed, useContainerWidth, } from "./components/app-shell-types.js";
15
+ export { AppBar, type AppId, type AppSwitcherProps, type AppSwitchItem, AppTabBar, } from "./components/app-switcher.js";
15
16
  export { AppTopBar, type AppTopBarProps } from "./components/app-top-bar.js";
16
17
  export { type AttachmentDownloadState, type AttachmentItem, type AttachmentKind, AttachmentList, type AttachmentListProps, } from "./components/attachment-list.js";
17
18
  export { AttendeeList, type AttendeeListProps, AttendeeRow, type AttendeeRowProps, RsvpBadge, type RsvpBadgeProps, } from "./components/attendee-row.js";
@@ -32,15 +33,26 @@ export { Button, ButtonLink, type ButtonLinkProps, type ButtonProps, } from "./c
32
33
  export { CalendarClashStrip, type CalendarClashStripProps, } from "./components/calendar-clash-strip.js";
33
34
  export { CalendarEventChip, type CalendarEventChipProps, } from "./components/calendar-event-chip.js";
34
35
  export { CalendarEventChipContent, type CalendarEventChipContentProps, } from "./components/calendar-event-chip-content.js";
36
+ export { CalendarEventGone, CalendarEventPopupCard, type CalendarEventPopupCardProps, type CalendarFailure, CalendarFailureBlock, } from "./components/calendar-event-popup.js";
37
+ export { CalendarEventSidebar, type CalendarEventSidebarProps, } from "./components/calendar-event-sidebar.js";
35
38
  export { CalendarFailureNote, type CalendarFailureNoteProps, } from "./components/calendar-failure-note.js";
36
39
  export { CalendarGrid, type CalendarGridProps, } from "./components/calendar-grid.js";
40
+ export { type CalendarAnswer, CalendarCancellationsSent, type CalendarCancellationsSentProps, CalendarEventGuests, type CalendarGuestCounts, CalendarGuestsField, type CalendarGuestsFieldProps, CalendarInvitationsNotSent, type CalendarInvitationsNotSentProps, CalendarReplyRow, type CalendarReplyRowProps, type CalendarSender, CalendarSenderField, type GuestSuggestion, } from "./components/calendar-guests.js";
37
41
  export { CalendarInviteCard, type CalendarInviteCardProps, } from "./components/calendar-invite-card.js";
38
42
  export { CalendarList, type CalendarListProps, } from "./components/calendar-list.js";
39
43
  export { CalendarParseBadge, type CalendarParseBadgeProps, calendarParseLabel, calendarParseNote, } from "./components/calendar-parse-badge.js";
44
+ export { CalendarPopover, type CalendarPopoverProps, } from "./components/calendar-popover.js";
45
+ export { CalendarQuickCreateCard, type CalendarQuickCreateCardProps, type QuickCreateFields, type QuickCreateMode, type QuickTaskFields, } from "./components/calendar-quick-create.js";
46
+ export { CalendarScreenToolbar, type CalendarScreenToolbarProps, } from "./components/calendar-screen-toolbar.js";
47
+ export { CalendarSheet, type CalendarSheetProps, } from "./components/calendar-sheet.js";
48
+ export { CalendarSidePane, type CalendarSidePaneProps, NewEventSquare, type NewEventSquareProps, } from "./components/calendar-side-pane.js";
40
49
  export { CalendarSlotOffers, type CalendarSlotOffersProps, } from "./components/calendar-slot-offers.js";
41
- export { CalendarSuggestionDeck, type CalendarSuggestionDeckProps, } from "./components/calendar-suggestion-deck.js";
42
- export { CalendarDateNav, type CalendarDateNavProps, CalendarViewSwitch, type CalendarViewSwitchProps, Segmented, type SegmentedProps, type SegmentOption, segmentClassName, } from "./components/calendar-toolbar.js";
43
- export { type CalendarAttendee, type CalendarClash, type CalendarColorId, type CalendarDay, type CalendarDescriptor, type CalendarEventData, type CalendarInvite, type CalendarInviteState, type CalendarParseMethod, type CalendarProposal, type CalendarSlotPick, type CalendarViewId, calendarColorIds, type EventDraft, type EventSuggestion, type RecurrenceScope, type RsvpState, type ZoneCertainty, type ZoneOption, type ZoneOptions, } from "./components/calendar-types.js";
50
+ export { CalendarSuggestionList, type CalendarSuggestionListItem, type CalendarSuggestionListProps, } from "./components/calendar-suggestion-list.js";
51
+ export { type CalendarTaskFields, CalendarTaskPopupCard, type CalendarTaskPopupCardProps, } from "./components/calendar-task-popup.js";
52
+ export { CalendarTimeGrid, type CalendarTimeGridProps, describeRange, type GridDraft, type GridGesture, } from "./components/calendar-time-grid.js";
53
+ export { Segmented, type SegmentedProps, type SegmentOption, segmentClassName, } from "./components/calendar-toolbar.js";
54
+ export { type CalendarAttendee, type CalendarClash, type CalendarColorId, type CalendarDay, type CalendarDescriptor, type CalendarEventData, type CalendarInvite, type CalendarInviteState, type CalendarParseMethod, type CalendarProposal, type CalendarSlotPick, type CalendarTaskData, type CalendarViewId, calendarColorIds, type EventDraft, type EventSuggestion, type RecurrenceScope, type RsvpState, type ZoneCertainty, type ZoneOption, type ZoneOptions, } from "./components/calendar-types.js";
55
+ export { CalendarYear, type CalendarYearProps, } from "./components/calendar-year.js";
44
56
  export { Card, CardBody, CardHeader, type CardProps, CardTitle, } from "./components/card.js";
45
57
  export { CategoryBadge, type CategoryBadgeProps, } from "./components/category-badge.js";
46
58
  export { Checkbox, type CheckboxProps } from "./components/checkbox.js";
@@ -65,7 +77,6 @@ export { ErrorBanner, type ErrorBannerAction, type ErrorBannerEntry, type ErrorB
65
77
  export { ErrorBannerStack } from "./components/ErrorBannerStack.js";
66
78
  export { ErrorState, formatErrorMessage } from "./components/ErrorState.js";
67
79
  export type { AuthorDeclarations, EmailFrameVariant, } from "./components/email-frame-css.js";
68
- export { EventDetail, type EventDetailProps, } from "./components/event-detail.js";
69
80
  export { EventEditor, type EventEditorLayout, type EventEditorProps, endsBeforeStart, withAllDay, withStartDate, } from "./components/event-editor.js";
70
81
  export { EventEditorPane, type EventEditorPaneProps, } from "./components/event-editor-pane.js";
71
82
  export { EventSuggestionCard, type EventSuggestionCardProps, settleZone, ZONE_UNSETTLED_REASON, type ZoneSettlement, } from "./components/event-suggestion-card.js";
@@ -103,6 +114,7 @@ export { type FilterReach, type ListState, MessageListEmpty, type MessageListEmp
103
114
  export { MessageReportDialog, type MessageReportDialogProps, } from "./components/message-report-dialog.js";
104
115
  export { type BriefRowComponent, ComfortableRow, ComfortableRowBody, ComfortableRowLeading, ComfortableRowTextContent, CompactRow, CompactRowBody, comfortableRowClass, compactRowClass, type RowSelection, type RowToggleEvent, } from "./components/message-row.js";
105
116
  export { MessageSettlementBadge, type MessageSettlementBadgeProps, MessageSettlementNotice, type MessageSettlementNoticeProps, messageSettlementCopy, type RowSettlement, } from "./components/message-settlement.js";
117
+ export { MiniMonth, type MiniMonthProps } from "./components/mini-month.js";
106
118
  export { type MobileMessageAction, MobileMessageActionBar, type MobileMessageActionBarProps, } from "./components/mobile-message-action-bar.js";
107
119
  export { type MobileReadingMessageActions, MobileReadingPane, type MobileReadingPaneProps, } from "./components/mobile-reading-pane.js";
108
120
  export { MobileSearchView, type MobileSearchViewProps, } from "./components/mobile-search-view.js";
@@ -174,7 +186,8 @@ export { briefChipCategory, briefChipFilters, briefFilterHasTerm, briefQueryCate
174
186
  export { type BriefFilterId, isBriefFilterId, matchesBriefFilters, narrowBriefSections, } from "./lib/brief-filters.js";
175
187
  export { type CalendarColorClasses, calendarColorClasses, } from "./lib/calendar-color.js";
176
188
  export { type CalendarEventShell, calendarEventBodyClasses, } from "./lib/calendar-event-shell.js";
177
- export { DRAFT_MINUTES, isDraggedSelection, pointPick, rangePick, } from "./lib/calendar-slot-pick.js";
189
+ export { calendarRangeTitle, datesFrom, weekStart, } from "./lib/calendar-range.js";
190
+ export { allDayRange, CLICK_THRESHOLD_PX, clickRange, clockAt, DRAFT_MINUTES, isDraggedSelection, minutesOf, pointPick, rangeMinutes, rangePick, SNAP_MINUTES, slotRange, timedRange, } from "./lib/calendar-slot-pick.js";
178
191
  export { buildCidResolver, type CidResolvableBodyPart, type CidResolver, } from "./lib/cid-resolver.js";
179
192
  export { cn } from "./lib/cn.js";
180
193
  export { browserSpellcheckHelp, COMPOSE_LANGUAGE_OPTIONS, type ComposeLanguageOption, defaultComposeLanguages, detectionCodeFor, languageChipLabel, languageLabel, primaryLanguageSubtag, unwrapLanguage, wrapWithLanguage, } from "./lib/compose-language.js";
@@ -185,11 +198,16 @@ export { createEmailSanitizer, detectAuthorBackground, detectAuthorSpacing, type
185
198
  export { addMinutesToClock } from "./lib/event-phrase.js";
186
199
  export { collapseFolderTree, filterFolderTree, folderAncestors, folderDepth, folderLeaf, folderParent, matchesQuery, orderFolderNodes, queryExpandedPaths, withCreateRows, } from "./lib/folder-tree.js";
187
200
  export { findFirstFocusable, findLastFocusable, findNextFocusable, findParentRow, isFocusable, isSelectable, } from "./lib/folder-tree-focus.js";
201
+ export { type GridSlot, initialFocus } from "./lib/grid-keyboard.js";
202
+ export { type GuestEntry, invalidGuest, parseGuest, storedGuest, withGuest, } from "./lib/guest-list.js";
203
+ export { isoWeek } from "./lib/iso-week.js";
188
204
  export { defaultKeyboardHints, KEY_HINT_GROUPS, type KeyboardHint, type KeyHint, type KeyHintGroup, keyboardHintsFor, keysForAction, shortcutHintForAction, type TriageAction, type TriageHandlers, tooltipForAction, } from "./lib/keymap.js";
189
205
  export { type DispatchResult, dispatchKey, isControlTarget, isEditableTarget, type KeyStroke, ROW_ATTRIBUTE, type SequencePrefix, } from "./lib/keymap-dispatch.js";
190
206
  export { isLabelColorValue, type LabelColorValue, labelColorOptions, labelDotClass, } from "./lib/label-color.js";
191
207
  export { DESKTOP_MEDIA_QUERY, DESKTOP_MIN_WIDTH, } from "./lib/layout-breakpoints.js";
208
+ export { miniMonthWeeks, shiftMonth } from "./lib/mini-month.js";
192
209
  export { type OverlayAnswers, type OverlayScopeOptions, overlayStack, resolveAgainstOverlays, useOverlayScope, } from "./lib/overlay-scope.js";
210
+ export { placePopup } from "./lib/popup-placement.js";
193
211
  export { derivePropertyClauses, normalizeSubject, sharedSubjectFragment, } from "./lib/property-prefill.js";
194
212
  export { type CustomRecurrence, defaultCustomRecurrence, defaultEndDate, endDateLabel, formatCustomRecurrence, type MonthlyMode, NO_REPEAT, type RecurrenceEnd, type RecurrenceUnit, readCustomRecurrence, repeatChoices, } from "./lib/recurrence.js";
195
213
  export { LIST_ROW_ATTRIBUTE, LIST_ROW_SELECTOR, type RovingOrientation, rovingNextIndex, type UseRovingFocusOptions, useRovingFocus, } from "./lib/roving-focus.js";
@@ -198,6 +216,7 @@ export { quoteSearchTokenValue, type SearchQueryWord, type SearchTermParts, sear
198
216
  export { type DroppedFacet, type DroppedFacetType, isConvertible, type SearchConversion, searchConversionNotice, } from "./lib/search-rule.js";
199
217
  export { collapsibleDomain, deriveSenderClauses, distinctSenders, dominantSender, senderDomain, senderLabel, } from "./lib/sender-derivation.js";
200
218
  export { type SuggestAction, type SuggestKeyState, suggestKeyAction, } from "./lib/suggest-keys.js";
219
+ export { zonedMoment } from "./lib/time-grid-layout.js";
201
220
  export { type ListCursor, useListCursor } from "./lib/use-list-cursor.js";
202
221
  export { type ListKeyboard, type UseListKeyboardOptions, useListKeyboard, } from "./lib/use-list-keyboard.js";
203
222
  export { type UseLongPressOptions, type UseLongPressResult, useLongPress, } from "./lib/use-long-press.js";
package/dist/index.js CHANGED
@@ -12,6 +12,7 @@ export { NextUpCard, } from "./components/agenda-panels.js";
12
12
  export { AppPasswordHint, } from "./components/app-password-hint.js";
13
13
  export { AppShellSlotted, useAppShellLayout, } from "./components/app-shell-slotted.js";
14
14
  export { INTELLIGENCE_MIN_WIDTH, READING_PANE_MIN_WIDTH, resolvePaneLayout, useContainerWidth, } from "./components/app-shell-types.js";
15
+ export { AppBar, AppTabBar, } from "./components/app-switcher.js";
15
16
  export { AppTopBar } from "./components/app-top-bar.js";
16
17
  export { AttachmentList, } from "./components/attachment-list.js";
17
18
  export { AttendeeList, AttendeeRow, RsvpBadge, } from "./components/attendee-row.js";
@@ -32,15 +33,26 @@ export { Button, ButtonLink, } from "./components/button.js";
32
33
  export { CalendarClashStrip, } from "./components/calendar-clash-strip.js";
33
34
  export { CalendarEventChip, } from "./components/calendar-event-chip.js";
34
35
  export { CalendarEventChipContent, } from "./components/calendar-event-chip-content.js";
36
+ export { CalendarEventGone, CalendarEventPopupCard, CalendarFailureBlock, } from "./components/calendar-event-popup.js";
37
+ export { CalendarEventSidebar, } from "./components/calendar-event-sidebar.js";
35
38
  export { CalendarFailureNote, } from "./components/calendar-failure-note.js";
36
39
  export { CalendarGrid, } from "./components/calendar-grid.js";
40
+ export { CalendarCancellationsSent, CalendarEventGuests, CalendarGuestsField, CalendarInvitationsNotSent, CalendarReplyRow, CalendarSenderField, } from "./components/calendar-guests.js";
37
41
  export { CalendarInviteCard, } from "./components/calendar-invite-card.js";
38
42
  export { CalendarList, } from "./components/calendar-list.js";
39
43
  export { CalendarParseBadge, calendarParseLabel, calendarParseNote, } from "./components/calendar-parse-badge.js";
44
+ export { CalendarPopover, } from "./components/calendar-popover.js";
45
+ export { CalendarQuickCreateCard, } from "./components/calendar-quick-create.js";
46
+ export { CalendarScreenToolbar, } from "./components/calendar-screen-toolbar.js";
47
+ export { CalendarSheet, } from "./components/calendar-sheet.js";
48
+ export { CalendarSidePane, NewEventSquare, } from "./components/calendar-side-pane.js";
40
49
  export { CalendarSlotOffers, } from "./components/calendar-slot-offers.js";
41
- export { CalendarSuggestionDeck, } from "./components/calendar-suggestion-deck.js";
42
- export { CalendarDateNav, CalendarViewSwitch, Segmented, segmentClassName, } from "./components/calendar-toolbar.js";
50
+ export { CalendarSuggestionList, } from "./components/calendar-suggestion-list.js";
51
+ export { CalendarTaskPopupCard, } from "./components/calendar-task-popup.js";
52
+ export { CalendarTimeGrid, describeRange, } from "./components/calendar-time-grid.js";
53
+ export { Segmented, segmentClassName, } from "./components/calendar-toolbar.js";
43
54
  export { calendarColorIds, } from "./components/calendar-types.js";
55
+ export { CalendarYear, } from "./components/calendar-year.js";
44
56
  export { Card, CardBody, CardHeader, CardTitle, } from "./components/card.js";
45
57
  export { CategoryBadge, } from "./components/category-badge.js";
46
58
  export { Checkbox } from "./components/checkbox.js";
@@ -64,7 +76,6 @@ export { EmptyState } from "./components/EmptyState.js";
64
76
  export { ErrorBanner, } from "./components/ErrorBanner.js";
65
77
  export { ErrorBannerStack } from "./components/ErrorBannerStack.js";
66
78
  export { ErrorState, formatErrorMessage } from "./components/ErrorState.js";
67
- export { EventDetail, } from "./components/event-detail.js";
68
79
  export { EventEditor, endsBeforeStart, withAllDay, withStartDate, } from "./components/event-editor.js";
69
80
  export { EventEditorPane, } from "./components/event-editor-pane.js";
70
81
  export { EventSuggestionCard, settleZone, ZONE_UNSETTLED_REASON, } from "./components/event-suggestion-card.js";
@@ -102,6 +113,7 @@ export { MessageListEmpty, MessageListError, MessageListLoading, MessageListLoad
102
113
  export { MessageReportDialog, } from "./components/message-report-dialog.js";
103
114
  export { ComfortableRow, ComfortableRowBody, ComfortableRowLeading, ComfortableRowTextContent, CompactRow, CompactRowBody, comfortableRowClass, compactRowClass, } from "./components/message-row.js";
104
115
  export { MessageSettlementBadge, MessageSettlementNotice, messageSettlementCopy, } from "./components/message-settlement.js";
116
+ export { MiniMonth } from "./components/mini-month.js";
105
117
  export { MobileMessageActionBar, } from "./components/mobile-message-action-bar.js";
106
118
  export { MobileReadingPane, } from "./components/mobile-reading-pane.js";
107
119
  export { MobileSearchView, } from "./components/mobile-search-view.js";
@@ -173,7 +185,8 @@ export { briefChipCategory, briefChipFilters, briefFilterHasTerm, briefQueryCate
173
185
  export { isBriefFilterId, matchesBriefFilters, narrowBriefSections, } from "./lib/brief-filters.js";
174
186
  export { calendarColorClasses, } from "./lib/calendar-color.js";
175
187
  export { calendarEventBodyClasses, } from "./lib/calendar-event-shell.js";
176
- export { DRAFT_MINUTES, isDraggedSelection, pointPick, rangePick, } from "./lib/calendar-slot-pick.js";
188
+ export { calendarRangeTitle, datesFrom, weekStart, } from "./lib/calendar-range.js";
189
+ export { allDayRange, CLICK_THRESHOLD_PX, clickRange, clockAt, DRAFT_MINUTES, isDraggedSelection, minutesOf, pointPick, rangeMinutes, rangePick, SNAP_MINUTES, slotRange, timedRange, } from "./lib/calendar-slot-pick.js";
177
190
  export { buildCidResolver, } from "./lib/cid-resolver.js";
178
191
  export { cn } from "./lib/cn.js";
179
192
  export { browserSpellcheckHelp, COMPOSE_LANGUAGE_OPTIONS, defaultComposeLanguages, detectionCodeFor, languageChipLabel, languageLabel, primaryLanguageSubtag, unwrapLanguage, wrapWithLanguage, } from "./lib/compose-language.js";
@@ -184,11 +197,16 @@ export { createEmailSanitizer, detectAuthorBackground, detectAuthorSpacing, sani
184
197
  export { addMinutesToClock } from "./lib/event-phrase.js";
185
198
  export { collapseFolderTree, filterFolderTree, folderAncestors, folderDepth, folderLeaf, folderParent, matchesQuery, orderFolderNodes, queryExpandedPaths, withCreateRows, } from "./lib/folder-tree.js";
186
199
  export { findFirstFocusable, findLastFocusable, findNextFocusable, findParentRow, isFocusable, isSelectable, } from "./lib/folder-tree-focus.js";
200
+ export { initialFocus } from "./lib/grid-keyboard.js";
201
+ export { invalidGuest, parseGuest, storedGuest, withGuest, } from "./lib/guest-list.js";
202
+ export { isoWeek } from "./lib/iso-week.js";
187
203
  export { defaultKeyboardHints, KEY_HINT_GROUPS, keyboardHintsFor, keysForAction, shortcutHintForAction, tooltipForAction, } from "./lib/keymap.js";
188
204
  export { dispatchKey, isControlTarget, isEditableTarget, ROW_ATTRIBUTE, } from "./lib/keymap-dispatch.js";
189
205
  export { isLabelColorValue, labelColorOptions, labelDotClass, } from "./lib/label-color.js";
190
206
  export { DESKTOP_MEDIA_QUERY, DESKTOP_MIN_WIDTH, } from "./lib/layout-breakpoints.js";
207
+ export { miniMonthWeeks, shiftMonth } from "./lib/mini-month.js";
191
208
  export { overlayStack, resolveAgainstOverlays, useOverlayScope, } from "./lib/overlay-scope.js";
209
+ export { placePopup } from "./lib/popup-placement.js";
192
210
  export { derivePropertyClauses, normalizeSubject, sharedSubjectFragment, } from "./lib/property-prefill.js";
193
211
  export { defaultCustomRecurrence, defaultEndDate, endDateLabel, formatCustomRecurrence, NO_REPEAT, readCustomRecurrence, repeatChoices, } from "./lib/recurrence.js";
194
212
  export { LIST_ROW_ATTRIBUTE, LIST_ROW_SELECTOR, rovingNextIndex, useRovingFocus, } from "./lib/roving-focus.js";
@@ -197,6 +215,7 @@ export { quoteSearchTokenValue, searchTokenTerm, splitSearchTerm, splitSearchWor
197
215
  export { isConvertible, searchConversionNotice, } from "./lib/search-rule.js";
198
216
  export { collapsibleDomain, deriveSenderClauses, distinctSenders, dominantSender, senderDomain, senderLabel, } from "./lib/sender-derivation.js";
199
217
  export { suggestKeyAction, } from "./lib/suggest-keys.js";
218
+ export { zonedMoment } from "./lib/time-grid-layout.js";
200
219
  export { useListCursor } from "./lib/use-list-cursor.js";
201
220
  export { useListKeyboard, } from "./lib/use-list-keyboard.js";
202
221
  export { useLongPress, } from "./lib/use-long-press.js";
@@ -0,0 +1,10 @@
1
+ import type { CalendarViewId } from "../components/calendar-types.js";
2
+ /** The Monday of the week a `YYYY-MM-DD` date falls in. */
3
+ export declare function weekStart(date: string): string;
4
+ /** The `count` dates from `start`, one day apart. */
5
+ export declare function datesFrom(start: string, count: number): string[];
6
+ /**
7
+ * The toolbar's title for a view on a date. A week that crosses a month names
8
+ * both months, the way Google Calendar does.
9
+ */
10
+ export declare function calendarRangeTitle(view: CalendarViewId, date: string, locale?: string): string;
@@ -0,0 +1,39 @@
1
+ const parse = (date) => {
2
+ const [year, month, day] = date.split("-").map(Number);
3
+ return new Date(Date.UTC(year, month - 1, day));
4
+ };
5
+ const iso = (instant) => instant.toISOString().slice(0, 10);
6
+ /** The Monday of the week a `YYYY-MM-DD` date falls in. */
7
+ export function weekStart(date) {
8
+ const day = parse(date);
9
+ day.setUTCDate(day.getUTCDate() - ((day.getUTCDay() + 6) % 7));
10
+ return iso(day);
11
+ }
12
+ /** The `count` dates from `start`, one day apart. */
13
+ export function datesFrom(start, count) {
14
+ const first = parse(start);
15
+ return Array.from({ length: count }, (_, index) => {
16
+ const next = new Date(first);
17
+ next.setUTCDate(first.getUTCDate() + index);
18
+ return iso(next);
19
+ });
20
+ }
21
+ const format = (date, options, locale) => new Intl.DateTimeFormat(locale, { ...options, timeZone: "UTC" }).format(parse(date));
22
+ /**
23
+ * The toolbar's title for a view on a date. A week that crosses a month names
24
+ * both months, the way Google Calendar does.
25
+ */
26
+ export function calendarRangeTitle(view, date, locale) {
27
+ if (view === "year")
28
+ return format(date, { year: "numeric" }, locale);
29
+ if (view === "day")
30
+ return format(date, { weekday: "long", day: "numeric", month: "long", year: "numeric" }, locale);
31
+ if (view !== "week")
32
+ return format(date, { month: "long", year: "numeric" }, locale);
33
+ const [first, , , , , , last] = datesFrom(weekStart(date), 7);
34
+ if (first.slice(0, 7) === last.slice(0, 7))
35
+ return format(first, { month: "long", year: "numeric" }, locale);
36
+ if (first.slice(0, 4) === last.slice(0, 4))
37
+ return `${format(first, { month: "short" }, locale)} – ${format(last, { month: "short", year: "numeric" }, locale)}`;
38
+ return `${format(first, { month: "short", year: "numeric" }, locale)} – ${format(last, { month: "short", year: "numeric" }, locale)}`;
39
+ }
@@ -16,3 +16,32 @@ export declare function pointPick(dateStr: string, allDay: boolean): CalendarSlo
16
16
  * a click leaves behind — and a click is already a pick of its own.
17
17
  */
18
18
  export declare function isDraggedSelection(startStr: string, endStr: string, allDay: boolean, slotMinutes: number): boolean;
19
+ /** Every range on the grid snaps to a quarter hour, as in Google Calendar. */
20
+ export declare const SNAP_MINUTES = 15;
21
+ /** A press that travels less than this is a click, not a drag. */
22
+ export declare const CLICK_THRESHOLD_PX = 4;
23
+ /** Whether a press moved far enough to be a drag. */
24
+ export declare function isDrag(dx: number, dy: number): boolean;
25
+ /** The quarter hour a vertical offset falls in, from midnight. */
26
+ export declare function minuteAt(offsetY: number, hourHeight: number): number;
27
+ /** `HH:MM` for minutes from midnight. */
28
+ export declare function clockAt(minutes: number): string;
29
+ /** Minutes from midnight for `HH:MM`. */
30
+ export declare function minutesOf(clock: string): number;
31
+ /**
32
+ * A timed range dragged in one column, from the slot pressed to the slot the
33
+ * pointer is over, inclusive of both. A drag that runs to the bottom ends at
34
+ * midnight, which is the next day's `00:00`.
35
+ */
36
+ export declare function timedRange(date: string, anchorMinute: number, currentMinute: number): CalendarSlotPick;
37
+ /** A range on one day from minutes, rolling an end at midnight onto the next day. */
38
+ export declare function slotRange(date: string, startMinute: number, endMinute: number): CalendarSlotPick;
39
+ /** The hour a click lands on: from the quarter pressed, an hour long. */
40
+ export declare function clickRange(date: string, minute: number): CalendarSlotPick;
41
+ /** An all-day range across whichever days the drag covered, in either direction. */
42
+ export declare function allDayRange(anchor: string, current: string): CalendarSlotPick;
43
+ /** Minutes the range covers on its first day, end exclusive. */
44
+ export declare function rangeMinutes(range: CalendarSlotPick): {
45
+ start: number;
46
+ end: number;
47
+ };