@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.
- package/dist/components/app-shell-slotted.js +1 -1
- package/dist/components/app-switcher.d.ts +15 -0
- package/dist/components/app-switcher.js +31 -0
- package/dist/components/calendar-event-popup.d.ts +43 -0
- package/dist/components/calendar-event-popup.js +18 -0
- package/dist/components/calendar-event-sidebar.d.ts +45 -0
- package/dist/components/calendar-event-sidebar.js +19 -0
- package/dist/components/calendar-grid.d.ts +11 -7
- package/dist/components/calendar-grid.js +55 -109
- package/dist/components/calendar-guests.d.ts +80 -0
- package/dist/components/calendar-guests.js +102 -0
- package/dist/components/calendar-popover.d.ts +25 -0
- package/dist/components/calendar-popover.js +84 -0
- package/dist/components/calendar-quick-create.d.ts +53 -0
- package/dist/components/calendar-quick-create.js +43 -0
- package/dist/components/calendar-screen-toolbar.d.ts +30 -0
- package/dist/components/calendar-screen-toolbar.js +24 -0
- package/dist/components/calendar-sheet.d.ts +14 -0
- package/dist/components/calendar-sheet.js +34 -0
- package/dist/components/calendar-side-pane.d.ts +20 -0
- package/dist/components/calendar-side-pane.js +11 -0
- package/dist/components/calendar-suggestion-list.d.ts +11 -0
- package/dist/components/calendar-suggestion-list.js +9 -0
- package/dist/components/calendar-task-popup.d.ts +28 -0
- package/dist/components/calendar-task-popup.js +17 -0
- package/dist/components/calendar-time-grid.d.ts +70 -0
- package/dist/components/calendar-time-grid.js +701 -0
- package/dist/components/calendar-toolbar.d.ts +0 -31
- package/dist/components/calendar-toolbar.js +0 -27
- package/dist/components/calendar-types.d.ts +12 -2
- package/dist/components/calendar-types.js +0 -5
- package/dist/components/calendar-year.d.ts +11 -0
- package/dist/components/calendar-year.js +9 -0
- package/dist/components/compose-fab.js +3 -1
- package/dist/components/event-editor.js +2 -1
- package/dist/components/intelligence-calendar.d.ts +1 -1
- package/dist/components/intelligence-calendar.js +10 -16
- package/dist/components/mini-month.d.ts +19 -0
- package/dist/components/mini-month.js +34 -0
- package/dist/components/recurrence-scope-prompt.d.ts +3 -1
- package/dist/components/recurrence-scope-prompt.js +4 -2
- package/dist/index.d.ts +24 -5
- package/dist/index.js +23 -4
- package/dist/lib/calendar-range.d.ts +10 -0
- package/dist/lib/calendar-range.js +39 -0
- package/dist/lib/calendar-slot-pick.d.ts +29 -0
- package/dist/lib/calendar-slot-pick.js +67 -0
- package/dist/lib/event-drag.d.ts +20 -0
- package/dist/lib/event-drag.js +50 -0
- package/dist/lib/grid-keyboard.d.ts +15 -0
- package/dist/lib/grid-keyboard.js +46 -0
- package/dist/lib/guest-list.d.ts +17 -0
- package/dist/lib/guest-list.js +34 -0
- package/dist/lib/iso-week.d.ts +2 -0
- package/dist/lib/iso-week.js +13 -0
- package/dist/lib/long-press.d.ts +25 -0
- package/dist/lib/long-press.js +37 -0
- package/dist/lib/mini-month.d.ts +27 -0
- package/dist/lib/mini-month.js +33 -0
- package/dist/lib/popup-placement.d.ts +22 -0
- package/dist/lib/popup-placement.js +39 -0
- package/dist/lib/time-grid-layout.d.ts +38 -0
- package/dist/lib/time-grid-layout.js +94 -0
- package/package.json +1 -1
- package/dist/components/calendar-suggestion-deck.d.ts +0 -18
- package/dist/components/calendar-suggestion-deck.js +0 -51
- package/dist/components/event-detail.d.ts +0 -38
- package/dist/components/event-detail.js +0 -21
|
@@ -71,5 +71,5 @@ export function AppShellSlotted({ nav, list, reading, intelligence, intelligence
|
|
|
71
71
|
const share = listShare(listBias, density);
|
|
72
72
|
const contentPanes = (_jsxs(ResizablePanelGroup, { direction: "horizontal", className: "min-h-0 flex-1", children: [_jsx(ResizablePanel, { id: "list", order: 1, defaultSize: showReadingPane ? share.size : 100, minSize: 22, maxSize: showReadingPane ? share.max : 100, className: "min-w-0", children: list }), showReadingPane && (_jsxs(_Fragment, { children: [_jsx(ResizableHandle, {}), _jsx(ResizablePanel, { id: "reading", order: 2, minSize: 29, className: "min-w-0", children: _jsx(WholePixelWidth, { className: "h-full", children: reading }) })] })), showIntelligencePanel && (_jsxs(_Fragment, { children: [_jsx(ResizableHandle, {}), _jsx(ResizablePanel, { id: "intelligence", order: 3, defaultSize: 25, minSize: 18, maxSize: 39, className: "min-w-0", children: intelligence })] }))] }, showReadingPane ? "list-reading" : "list-only"));
|
|
73
73
|
const content = (_jsxs("div", { className: "flex min-h-0 min-w-0 flex-1 flex-col", children: [!showNavPane && header && _jsx("div", { className: "shrink-0", children: header }), contentPanes] }));
|
|
74
|
-
return (_jsx(AppShellLayoutCtx.Provider, { value: layoutCtx, children: _jsx("div", { ref: containerRef, className: "safe-area-frame @container flex h-
|
|
74
|
+
return (_jsx(AppShellLayoutCtx.Provider, { value: layoutCtx, children: _jsx("div", { ref: containerRef, className: "safe-area-frame @container flex h-full w-full flex-col overflow-hidden bg-canvas font-sans text-fg", children: isLoading && skeleton ? (skeleton) : (_jsxs(_Fragment, { children: [topBar, navPaneVisible ? (_jsxs(ResizablePanelGroup, { direction: "horizontal", className: "min-h-0 flex-1", children: [_jsx(ResizablePanel, { id: "nav", order: 1, defaultSize: 17, minSize: 12, maxSize: 24, className: "min-w-0", children: nav }), _jsx(ResizableHandle, {}), _jsx(ResizablePanel, { id: "content", order: 2, className: "flex min-w-0 flex-col", children: content })] })) : (content), !showNavPane && (_jsx(Dialog, { open: navOpen, onClose: closeNav, title: "Folders", anchor: "left", children: nav })), overlay] })) }) }));
|
|
75
75
|
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export type AppId = "mail" | "calendar";
|
|
2
|
+
export interface AppSwitchItem {
|
|
3
|
+
id: AppId;
|
|
4
|
+
label: string;
|
|
5
|
+
href: string;
|
|
6
|
+
}
|
|
7
|
+
export interface AppSwitcherProps {
|
|
8
|
+
items: readonly AppSwitchItem[];
|
|
9
|
+
active: AppId;
|
|
10
|
+
/** Runs on a plain click; a modified click follows the link natively. */
|
|
11
|
+
onNavigate: (id: AppId) => void;
|
|
12
|
+
className?: string;
|
|
13
|
+
}
|
|
14
|
+
export declare function AppBar({ items, active, onNavigate, className, }: AppSwitcherProps): import("react").JSX.Element;
|
|
15
|
+
export declare function AppTabBar({ items, active, onNavigate, className, }: AppSwitcherProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { CalendarDays, Mail } from "lucide-react";
|
|
3
|
+
import { useRef } from "react";
|
|
4
|
+
import { cn } from "../lib/cn.js";
|
|
5
|
+
import { useRovingFocus } from "../lib/roving-focus.js";
|
|
6
|
+
const ICONS = { mail: Mail, calendar: CalendarDays };
|
|
7
|
+
const APP_ITEM_SELECTOR = "[data-app-item]";
|
|
8
|
+
const isPlainClick = (click) => click.button === 0 &&
|
|
9
|
+
!click.metaKey &&
|
|
10
|
+
!click.ctrlKey &&
|
|
11
|
+
!click.shiftKey &&
|
|
12
|
+
!click.altKey;
|
|
13
|
+
function AppLink({ item, active, onNavigate, className, iconClassName, }) {
|
|
14
|
+
const Icon = ICONS[item.id];
|
|
15
|
+
return (_jsxs("a", { href: item.href, "data-app-item": "", "aria-current": active ? "page" : undefined, onClick: (click) => {
|
|
16
|
+
if (!isPlainClick(click))
|
|
17
|
+
return;
|
|
18
|
+
click.preventDefault();
|
|
19
|
+
onNavigate(item.id);
|
|
20
|
+
}, className: cn("flex flex-col items-center justify-center gap-0.5 rounded-lg outline-none transition-colors", "focus-visible:ring-2 focus-visible:ring-ring", active
|
|
21
|
+
? "bg-accent-soft text-accent"
|
|
22
|
+
: "text-fg-muted hover:bg-surface-sunken hover:text-fg", className), children: [_jsx(Icon, { className: iconClassName, "aria-hidden": "true" }), _jsx("span", { className: "text-2xs font-medium", children: item.label })] }));
|
|
23
|
+
}
|
|
24
|
+
export function AppBar({ items, active, onNavigate, className, }) {
|
|
25
|
+
const navRef = useRef(null);
|
|
26
|
+
useRovingFocus({ containerRef: navRef, itemSelector: APP_ITEM_SELECTOR });
|
|
27
|
+
return (_jsx("nav", { ref: navRef, "aria-label": "Apps", className: cn("flex w-16 shrink-0 flex-col items-center gap-1 border-r border-line bg-surface py-2", className), children: items.map((item) => (_jsx(AppLink, { item: item, active: item.id === active, onNavigate: onNavigate, className: "size-14", iconClassName: "size-5" }, item.id))) }));
|
|
28
|
+
}
|
|
29
|
+
export function AppTabBar({ items, active, onNavigate, className, }) {
|
|
30
|
+
return (_jsx("nav", { "aria-label": "Apps", className: cn("flex shrink-0 items-stretch justify-around border-t border-line bg-surface px-2 pt-1 pb-[max(0.25rem,env(safe-area-inset-bottom))]", className), children: items.map((item) => (_jsx(AppLink, { item: item, active: item.id === active, onNavigate: onNavigate, className: "min-h-12 min-w-16 flex-1", iconClassName: "size-5" }, item.id))) }));
|
|
31
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { ReactNode, Ref } from "react";
|
|
2
|
+
import type { CalendarColorId } from "./calendar-types.js";
|
|
3
|
+
export interface CalendarFailure {
|
|
4
|
+
text: string;
|
|
5
|
+
reportHref: string;
|
|
6
|
+
onRetry: () => void;
|
|
7
|
+
/** "Try again" unless the way forward is something else. */
|
|
8
|
+
retryLabel?: string;
|
|
9
|
+
}
|
|
10
|
+
/** A failure stated where it happened, with Try again and a prefilled report. */
|
|
11
|
+
export declare function CalendarFailureBlock({ failure, focusRef, }: {
|
|
12
|
+
failure: CalendarFailure;
|
|
13
|
+
focusRef?: Ref<HTMLDivElement>;
|
|
14
|
+
}): import("react").JSX.Element;
|
|
15
|
+
export interface CalendarEventPopupCardProps {
|
|
16
|
+
headingId: string;
|
|
17
|
+
headingRef?: Ref<HTMLHeadingElement>;
|
|
18
|
+
title: string;
|
|
19
|
+
color: CalendarColorId;
|
|
20
|
+
/** "Wednesday, 4 November · 18:00 – 22:00". */
|
|
21
|
+
when: string;
|
|
22
|
+
location: string;
|
|
23
|
+
calendarName: string;
|
|
24
|
+
/** "Busy" or "Free". */
|
|
25
|
+
availability: string;
|
|
26
|
+
/** Absent on a read-only calendar. */
|
|
27
|
+
onEdit?: () => void;
|
|
28
|
+
onDelete?: () => void;
|
|
29
|
+
deleting?: boolean;
|
|
30
|
+
onClose: () => void;
|
|
31
|
+
failure?: CalendarFailure;
|
|
32
|
+
failureRef?: Ref<HTMLDivElement>;
|
|
33
|
+
/** Shown under the details: the recurrence scope question. */
|
|
34
|
+
children?: ReactNode;
|
|
35
|
+
}
|
|
36
|
+
/** What the event popup says about one stored event. */
|
|
37
|
+
export declare function CalendarEventPopupCard({ headingId, headingRef, title, color, when, location, calendarName, availability, onEdit, onDelete, deleting, onClose, failure, failureRef, children, }: CalendarEventPopupCardProps): import("react").JSX.Element;
|
|
38
|
+
/** The popup for an event the address names that is no longer stored. */
|
|
39
|
+
export declare function CalendarEventGone({ headingId, onClose, closeRef, }: {
|
|
40
|
+
headingId: string;
|
|
41
|
+
onClose: () => void;
|
|
42
|
+
closeRef?: Ref<HTMLButtonElement>;
|
|
43
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { CalendarDays, MapPin, Pencil, Trash2, X } from "lucide-react";
|
|
3
|
+
import { calendarColorClasses } from "../lib/calendar-color.js";
|
|
4
|
+
import { cn } from "../lib/cn.js";
|
|
5
|
+
/** A failure stated where it happened, with Try again and a prefilled report. */
|
|
6
|
+
export function CalendarFailureBlock({ failure, focusRef, }) {
|
|
7
|
+
return (_jsxs("div", { ref: focusRef, role: "alert", tabIndex: -1, className: "flex flex-col gap-2 rounded-md border border-danger/40 bg-danger-soft p-3 text-sm outline-none", children: [_jsx("p", { className: "text-danger", children: failure.text }), _jsxs("div", { className: "flex items-center gap-3", children: [_jsx("button", { type: "button", onClick: failure.onRetry, className: "rounded-md border border-line bg-surface px-3 py-1 text-sm font-medium hover:bg-surface-sunken focus-visible:ring-2 focus-visible:ring-ring", children: failure.retryLabel ?? "Try again" }), _jsx("a", { href: failure.reportHref, target: "_blank", rel: "noreferrer", className: "text-sm font-medium text-accent hover:underline", children: "Report an issue" })] })] }));
|
|
8
|
+
}
|
|
9
|
+
const iconButton = "flex size-9 items-center justify-center rounded-full text-fg-muted outline-none hover:bg-surface-sunken hover:text-fg focus-visible:ring-2 focus-visible:ring-ring disabled:opacity-40";
|
|
10
|
+
/** What the event popup says about one stored event. */
|
|
11
|
+
export function CalendarEventPopupCard({ headingId, headingRef, title, color, when, location, calendarName, availability, onEdit, onDelete, deleting = false, onClose, failure, failureRef, children, }) {
|
|
12
|
+
const hue = calendarColorClasses(color);
|
|
13
|
+
return (_jsxs("div", { className: "flex flex-col gap-3 p-3", children: [_jsxs("div", { className: "flex justify-end gap-1", children: [onEdit && (_jsx("button", { type: "button", "aria-label": "Edit", onClick: onEdit, className: iconButton, children: _jsx(Pencil, { className: "size-4" }) })), onDelete && (_jsx("button", { type: "button", "aria-label": "Delete", onClick: onDelete, disabled: deleting, className: iconButton, children: _jsx(Trash2, { className: "size-4" }) })), _jsx("button", { type: "button", "aria-label": "Close", onClick: onClose, className: iconButton, children: _jsx(X, { className: "size-4" }) })] }), _jsxs("div", { className: "flex gap-3 px-2", children: [_jsx("span", { className: cn("mt-1.5 size-3.5 shrink-0 rounded-sm", hue.solid), "aria-hidden": "true" }), _jsxs("div", { className: "min-w-0", children: [_jsx("h2", { id: headingId, ref: headingRef, tabIndex: -1, className: "text-xl font-normal break-words text-fg outline-none", children: title === "" ? "(No title)" : title }), _jsx("p", { className: "mt-1 text-sm text-fg-muted", children: when })] })] }), _jsxs("dl", { className: "flex flex-col gap-2 px-2 text-sm", children: [location !== "" && (_jsxs("div", { className: "flex gap-3", children: [_jsx("dt", { children: _jsx(MapPin, { className: "size-4 text-fg-subtle", "aria-label": "Location" }) }), _jsx("dd", { className: "min-w-0 break-words", children: location })] })), _jsxs("div", { className: "flex gap-3", children: [_jsx("dt", { children: _jsx(CalendarDays, { className: "size-4 text-fg-subtle", "aria-label": "Calendar" }) }), _jsxs("dd", { children: [calendarName, " \u00B7 ", availability] })] })] }), children, failure && (_jsx(CalendarFailureBlock, { failure: failure, focusRef: failureRef }))] }));
|
|
14
|
+
}
|
|
15
|
+
/** The popup for an event the address names that is no longer stored. */
|
|
16
|
+
export function CalendarEventGone({ headingId, onClose, closeRef, }) {
|
|
17
|
+
return (_jsxs("div", { className: "flex flex-col gap-3 p-4", children: [_jsx("h2", { id: headingId, className: "text-base font-medium text-fg", children: "This event was deleted or moved" }), _jsx("button", { ref: closeRef, type: "button", onClick: onClose, className: "self-end rounded-md border border-line px-3 py-1.5 text-sm font-medium hover:bg-surface-sunken focus-visible:ring-2 focus-visible:ring-ring", children: "Close" })] }));
|
|
18
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { ReactNode, Ref } from "react";
|
|
2
|
+
import { type CalendarFailure } from "./calendar-event-popup.js";
|
|
3
|
+
import { type CalendarSender, type GuestSuggestion } from "./calendar-guests.js";
|
|
4
|
+
import type { CalendarDescriptor, EventDraft } from "./calendar-types.js";
|
|
5
|
+
export interface CalendarEventSidebarProps {
|
|
6
|
+
heading: string;
|
|
7
|
+
draft: EventDraft;
|
|
8
|
+
onChange: (draft: EventDraft) => void;
|
|
9
|
+
/** Only the calendars that accept writes. */
|
|
10
|
+
calendars: readonly CalendarDescriptor[];
|
|
11
|
+
/** A stored event stays in its calendar. */
|
|
12
|
+
calendarEditable: boolean;
|
|
13
|
+
repeatEditable: boolean;
|
|
14
|
+
timeZone: string;
|
|
15
|
+
timeZones: readonly string[];
|
|
16
|
+
onTimeZone: (timeZone: string) => void;
|
|
17
|
+
busy: boolean;
|
|
18
|
+
onBusy: (busy: boolean) => void;
|
|
19
|
+
onSave: () => void;
|
|
20
|
+
onCancel: () => void;
|
|
21
|
+
saving?: boolean;
|
|
22
|
+
/** The save button, "Save" unless the form adds something. */
|
|
23
|
+
saveLabel?: string;
|
|
24
|
+
/** Why the draft cannot be saved yet. */
|
|
25
|
+
problem?: string;
|
|
26
|
+
failure?: CalendarFailure;
|
|
27
|
+
failureRef?: Ref<HTMLDivElement>;
|
|
28
|
+
titleRef?: Ref<HTMLInputElement>;
|
|
29
|
+
/** A phone shows the editor over the whole screen with thumb-sized controls. */
|
|
30
|
+
touch?: boolean;
|
|
31
|
+
/** The scope question or the discard confirm, over the form. */
|
|
32
|
+
children?: ReactNode;
|
|
33
|
+
/** Absent where the reader cannot change the guest list: an invitation from someone else. */
|
|
34
|
+
guests?: {
|
|
35
|
+
suggestions: readonly GuestSuggestion[];
|
|
36
|
+
onQuery: (query: string) => void;
|
|
37
|
+
senders: readonly CalendarSender[];
|
|
38
|
+
sender: string;
|
|
39
|
+
onSender: (accountId: string) => void;
|
|
40
|
+
/** A stored event keeps the organizer it was sent from. */
|
|
41
|
+
senderEditable: boolean;
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
/** The full editor beside the grid, after Google Calendar's event page. */
|
|
45
|
+
export declare function CalendarEventSidebar({ heading, draft, onChange, calendars, calendarEditable, repeatEditable, timeZone, timeZones, onTimeZone, busy, onBusy, onSave, onCancel, saving, saveLabel, problem, failure, failureRef, titleRef, touch, children, guests, }: CalendarEventSidebarProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { X } from "lucide-react";
|
|
3
|
+
import { cn } from "../lib/cn.js";
|
|
4
|
+
import { invalidGuest } from "../lib/guest-list.js";
|
|
5
|
+
import { CalendarFailureBlock, } from "./calendar-event-popup.js";
|
|
6
|
+
import { CalendarGuestsField, CalendarSenderField, } from "./calendar-guests.js";
|
|
7
|
+
import { EventField, EventRepeatField, EventWhenField, endsBeforeStart, } from "./event-editor.js";
|
|
8
|
+
const control = "h-9 w-full rounded-md border border-line bg-surface-sunken px-2 text-sm text-fg outline-none focus-visible:border-line-strong focus-visible:ring-2 focus-visible:ring-ring/30 disabled:opacity-60";
|
|
9
|
+
/** The full editor beside the grid, after Google Calendar's event page. */
|
|
10
|
+
export function CalendarEventSidebar({ heading, draft, onChange, calendars, calendarEditable, repeatEditable, timeZone, timeZones, onTimeZone, busy, onBusy, onSave, onCancel, saving = false, saveLabel = "Save", problem = "", failure, failureRef, titleRef, touch = false, children, guests, }) {
|
|
11
|
+
const field = cn(control, touch && "h-11");
|
|
12
|
+
const backwards = endsBeforeStart(draft);
|
|
13
|
+
const blocked = guests !== undefined && invalidGuest(draft.guests) !== undefined;
|
|
14
|
+
return (_jsxs("form", { "aria-label": heading, "data-event-sidebar": "", className: "flex h-full min-h-0 flex-col bg-surface", onSubmit: (event) => {
|
|
15
|
+
event.preventDefault();
|
|
16
|
+
if (!saving && !backwards && !blocked)
|
|
17
|
+
onSave();
|
|
18
|
+
}, children: [_jsxs("div", { className: "flex shrink-0 items-center justify-between border-b border-line px-4 py-2", children: [_jsx("h2", { className: "text-base font-medium text-fg", children: heading }), _jsx("button", { type: "button", "aria-label": "Close", onClick: onCancel, className: cn("flex items-center justify-center rounded-full text-fg-muted outline-none hover:bg-surface-sunken focus-visible:ring-2 focus-visible:ring-ring", touch ? "size-11" : "size-8"), children: _jsx(X, { className: "size-4" }) })] }), _jsxs("div", { className: "flex min-h-0 flex-1 flex-col gap-4 overflow-y-auto px-4 py-4", children: [_jsx("input", { ref: titleRef, "aria-label": "Title", placeholder: "Add title", value: draft.title, onChange: (event) => onChange({ ...draft, title: event.target.value }), className: "border-b-2 border-line bg-transparent pb-1 text-xl text-fg outline-none placeholder:text-fg-subtle focus:border-accent" }), _jsx(EventWhenField, { draft: draft, onChange: onChange, touch: touch }), _jsx(EventField, { label: "Time zone", children: _jsx("select", { "aria-label": "Time zone", value: timeZone, onChange: (event) => onTimeZone(event.target.value), className: field, children: timeZones.map((zone) => (_jsx("option", { value: zone, children: zone }, zone))) }) }), _jsx(EventField, { label: "Repeat", children: _jsx(EventRepeatField, { draft: draft, onChange: onChange, touch: touch, repeatEditable: repeatEditable }) }), _jsx(EventField, { label: "Calendar", children: _jsx("select", { "aria-label": "Calendar", value: draft.calendarId, disabled: !calendarEditable, onChange: (event) => onChange({ ...draft, calendarId: event.target.value }), className: field, children: calendars.map((calendar) => (_jsx("option", { value: calendar.id, children: calendar.name }, calendar.id))) }) }), _jsx(EventField, { label: "Location", children: _jsx("input", { "aria-label": "Location", placeholder: "Add location", value: draft.location, onChange: (event) => onChange({ ...draft, location: event.target.value }), className: field }) }), _jsx(EventField, { label: "Show as", children: _jsxs("select", { "aria-label": "Show as", value: busy ? "busy" : "free", onChange: (event) => onBusy(event.target.value === "busy"), className: field, children: [_jsx("option", { value: "busy", children: "Busy" }), _jsx("option", { value: "free", children: "Free" })] }) }), _jsx(EventField, { label: "Description", children: _jsx("textarea", { "aria-label": "Description", placeholder: "Add description", rows: 5, value: draft.notes, onChange: (event) => onChange({ ...draft, notes: event.target.value }), className: "w-full rounded-md border border-line bg-surface-sunken px-3 py-2 text-sm text-fg outline-none focus-visible:ring-2 focus-visible:ring-ring/30" }) }), guests && (_jsx(EventField, { label: "Guests", children: _jsx(CalendarGuestsField, { value: draft.guests, onChange: (value) => onChange({ ...draft, guests: value }), suggestions: guests.suggestions, onQuery: guests.onQuery, touch: touch }) })), guests && draft.guests.length > 0 && guests.senders.length > 0 && (_jsxs(EventField, { label: "Send invitations from", children: [_jsx(CalendarSenderField, { label: "Send invitations from", senders: guests.senders, value: guests.sender, onChange: guests.onSender, disabled: !guests.senderEditable, touch: touch }), _jsx("p", { className: "mt-1 text-xs text-fg-muted", children: "Default set in Settings, Calendars" })] })), children] }), _jsxs("div", { className: "flex shrink-0 flex-col gap-2 border-t border-line px-4 py-3", children: [problem !== "" && (_jsx("p", { role: "alert", className: "text-sm text-danger", children: problem })), failure && (_jsx(CalendarFailureBlock, { failure: failure, focusRef: failureRef })), _jsxs("div", { className: "flex justify-end gap-2", children: [_jsx("button", { type: "button", onClick: onCancel, className: cn("rounded-md border border-line px-4 text-sm font-medium hover:bg-surface-sunken focus-visible:ring-2 focus-visible:ring-ring", touch ? "min-h-11" : "h-9"), children: "Cancel" }), _jsx("button", { type: "submit", disabled: saving || backwards || blocked, className: cn("rounded-md bg-accent px-5 text-sm font-medium text-accent-fg hover:bg-accent-hover focus-visible:ring-2 focus-visible:ring-ring disabled:opacity-50", touch ? "min-h-11" : "h-9"), children: saving ? "Saving…" : saveLabel })] })] })] }));
|
|
19
|
+
}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import "../calendar.css";
|
|
2
2
|
import type { Density } from "./app-shell-types.js";
|
|
3
|
-
import type { CalendarColorId, CalendarEventData, CalendarSlotPick,
|
|
3
|
+
import type { CalendarColorId, CalendarEventData, CalendarSlotPick, CalendarTaskData } from "./calendar-types.js";
|
|
4
4
|
export interface CalendarGridProps {
|
|
5
|
-
|
|
6
|
-
/** The day the view is centred on; changing it moves the grid. */
|
|
5
|
+
/** A day in the month on screen; changing it moves the grid. */
|
|
7
6
|
date: string;
|
|
8
7
|
events: CalendarEventData[];
|
|
9
8
|
/** Which calendar owns which hue. Anything missing falls back to cal-1. */
|
|
@@ -12,14 +11,19 @@ export interface CalendarGridProps {
|
|
|
12
11
|
selectedEventId: string;
|
|
13
12
|
/** IANA zone the grid's clock runs on, and the zone a pick is read in. */
|
|
14
13
|
timeZone: string;
|
|
15
|
-
/** The instant the grid calls now: the today marker
|
|
14
|
+
/** The instant the grid calls now: the today marker reads it. */
|
|
16
15
|
now: string;
|
|
17
16
|
onSelectEvent: (eventId: string) => void;
|
|
18
17
|
onPickSlot: (pick: CalendarSlotPick) => void;
|
|
19
|
-
/** The range title the grid computed, e.g. "8 – 14 Jun 2026". */
|
|
20
|
-
onRangeChange: (title: string) => void;
|
|
21
18
|
dayHref: (date: string) => string;
|
|
22
19
|
onZoomDay: (date: string) => void;
|
|
20
|
+
/** Whether an event may be dragged to other days; its calendar takes writes. */
|
|
21
|
+
canMove?: (eventId: string) => boolean;
|
|
22
|
+
/** A stored event dropped on other days, or stretched across more. */
|
|
23
|
+
onMoveEvent?: (eventId: string, range: CalendarSlotPick) => void;
|
|
24
|
+
/** Tasks due in the month, each on its due day. */
|
|
25
|
+
tasks?: readonly CalendarTaskData[];
|
|
26
|
+
onSelectTask?: (calendarTaskId: string) => void;
|
|
23
27
|
className?: string;
|
|
24
28
|
}
|
|
25
|
-
export declare function CalendarGrid({
|
|
29
|
+
export declare function CalendarGrid({ date, events, colorByCalendarId, density, selectedEventId, timeZone, now, onSelectEvent, onPickSlot, dayHref, onZoomDay, canMove, onMoveEvent, tasks, onSelectTask, className, }: CalendarGridProps): import("react").JSX.Element;
|
|
@@ -1,60 +1,23 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import "../calendar.css";
|
|
3
3
|
import FullCalendar from "@fullcalendar/react";
|
|
4
4
|
import dayGridPlugin from "@fullcalendar/react/daygrid";
|
|
5
5
|
import interactionPlugin from "@fullcalendar/react/interaction";
|
|
6
|
-
import listPlugin from "@fullcalendar/react/list";
|
|
7
|
-
import multiMonthPlugin from "@fullcalendar/react/multimonth";
|
|
8
|
-
import timeGridPlugin from "@fullcalendar/react/timegrid";
|
|
9
6
|
import { useEffect, useMemo, useRef } from "react";
|
|
10
7
|
import { calendarEventBodyClasses } from "../lib/calendar-event-shell.js";
|
|
11
8
|
import { isDraggedSelection, pointPick, rangePick, } from "../lib/calendar-slot-pick.js";
|
|
12
9
|
import { cn } from "../lib/cn.js";
|
|
13
10
|
import { CalendarEventChipContent } from "./calendar-event-chip-content.js";
|
|
14
11
|
/**
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
* `*Class` props, so no rule here overrides one of the library's own.
|
|
12
|
+
* A month of days, drawn by the calendar engine and styled entirely through
|
|
13
|
+
* its per-element `*Class` props. The day and the week are the kit's own time
|
|
14
|
+
* grid (`CalendarTimeGrid`); only the month uses the engine.
|
|
19
15
|
*
|
|
20
16
|
* The component is presentational. It holds no events of its own, reads no
|
|
21
17
|
* clock of its own, and every gesture leaves through a callback.
|
|
22
18
|
*/
|
|
23
|
-
const PLUGINS = [
|
|
24
|
-
|
|
25
|
-
timeGridPlugin,
|
|
26
|
-
listPlugin,
|
|
27
|
-
multiMonthPlugin,
|
|
28
|
-
interactionPlugin,
|
|
29
|
-
];
|
|
30
|
-
const FC_VIEW = {
|
|
31
|
-
year: "multiMonthYear",
|
|
32
|
-
month: "dayGridMonth",
|
|
33
|
-
week: "timeGridWeek",
|
|
34
|
-
day: "timeGridDay",
|
|
35
|
-
agenda: "listWeek",
|
|
36
|
-
};
|
|
37
|
-
/* A week or a day names the date in its header. A month grid repeats the same
|
|
38
|
-
seven weekdays down the page, so the header names the weekday and the cells
|
|
39
|
-
own the dates; a year has room for one letter. */
|
|
40
|
-
const DAY_HEADER_FORMAT = {
|
|
41
|
-
year: { weekday: "narrow" },
|
|
42
|
-
month: { weekday: "short" },
|
|
43
|
-
week: { weekday: "short", day: "numeric" },
|
|
44
|
-
day: { weekday: "short", day: "numeric" },
|
|
45
|
-
agenda: { weekday: "short", day: "numeric" },
|
|
46
|
-
};
|
|
47
|
-
/** Views that draw every event as a horizontal pill rather than a block. */
|
|
48
|
-
const ROW_VIEWS = new Set(["year", "month", "agenda"]);
|
|
49
|
-
/**
|
|
50
|
-
* Density is a real change in how much of a day fits on screen, not a padding
|
|
51
|
-
* tweak: a tighter setting halves the slot height and drops the time off short
|
|
52
|
-
* chips.
|
|
53
|
-
*/
|
|
54
|
-
const DENSITY = {
|
|
55
|
-
comfortable: { slotMinutes: 30, slotMinHeight: 26, eventShortHeight: 34 },
|
|
56
|
-
compact: { slotMinutes: 60, slotMinHeight: 15, eventShortHeight: 22 },
|
|
57
|
-
};
|
|
19
|
+
const PLUGINS = [dayGridPlugin, interactionPlugin];
|
|
20
|
+
const MAX_EVENTS = { comfortable: 3, compact: 2 };
|
|
58
21
|
const FALLBACK_COLOR = "cal-1";
|
|
59
22
|
/** The placeholder the engine drags under the pointer, which is not one of ours. */
|
|
60
23
|
const MIRROR_EVENT = {
|
|
@@ -65,15 +28,6 @@ const MIRROR_EVENT = {
|
|
|
65
28
|
isRecurring: false,
|
|
66
29
|
zoneCertainty: "local",
|
|
67
30
|
};
|
|
68
|
-
function toInput(event) {
|
|
69
|
-
return {
|
|
70
|
-
id: event.id,
|
|
71
|
-
title: event.title,
|
|
72
|
-
start: event.start,
|
|
73
|
-
end: event.end,
|
|
74
|
-
allDay: event.allDay,
|
|
75
|
-
};
|
|
76
|
-
}
|
|
77
31
|
const isoDayInZone = (instant, timeZone) => new Intl.DateTimeFormat("en-CA", {
|
|
78
32
|
timeZone,
|
|
79
33
|
year: "numeric",
|
|
@@ -85,15 +39,33 @@ const isModifiedClick = (click) => click.button !== 0 ||
|
|
|
85
39
|
click.ctrlKey ||
|
|
86
40
|
click.shiftKey ||
|
|
87
41
|
click.altKey;
|
|
88
|
-
export function CalendarGrid({
|
|
42
|
+
export function CalendarGrid({ date, events, colorByCalendarId, density, selectedEventId, timeZone, now, onSelectEvent, onPickSlot, dayHref, onZoomDay, canMove = () => false, onMoveEvent, tasks = [], onSelectTask, className, }) {
|
|
89
43
|
const calendarRef = useRef(null);
|
|
90
|
-
useEffect(() => {
|
|
91
|
-
calendarRef.current?.getApi().changeView(FC_VIEW[view]);
|
|
92
|
-
}, [view]);
|
|
93
44
|
useEffect(() => {
|
|
94
45
|
calendarRef.current?.getApi().gotoDate(date);
|
|
95
46
|
}, [date]);
|
|
96
|
-
const
|
|
47
|
+
const taskById = useMemo(() => new Map(tasks.map((task) => [task.calendarTaskId, task])), [tasks]);
|
|
48
|
+
const eventInputs = useMemo(() => [
|
|
49
|
+
...events.map((event) => ({
|
|
50
|
+
id: event.id,
|
|
51
|
+
title: event.title,
|
|
52
|
+
start: event.start,
|
|
53
|
+
end: event.end,
|
|
54
|
+
allDay: event.allDay,
|
|
55
|
+
editable: onMoveEvent !== undefined && canMove(event.id),
|
|
56
|
+
})),
|
|
57
|
+
...tasks.map((task) => ({
|
|
58
|
+
id: task.calendarTaskId,
|
|
59
|
+
title: task.title,
|
|
60
|
+
start: task.due,
|
|
61
|
+
allDay: task.allDay,
|
|
62
|
+
editable: false,
|
|
63
|
+
})),
|
|
64
|
+
], [events, tasks, canMove, onMoveEvent]);
|
|
65
|
+
const dropped = (info) => {
|
|
66
|
+
info.revert();
|
|
67
|
+
onMoveEvent?.(info.event.id, rangePick(info.event.startStr, info.event.endStr === "" ? info.event.startStr : info.event.endStr, info.event.allDay));
|
|
68
|
+
};
|
|
97
69
|
const byId = useMemo(() => new Map(events.map((event) => [
|
|
98
70
|
event.id,
|
|
99
71
|
{
|
|
@@ -105,36 +77,11 @@ export function CalendarGrid({ view, date, events, colorByCalendarId, density, s
|
|
|
105
77
|
zoneCertainty: event.zoneCertainty,
|
|
106
78
|
},
|
|
107
79
|
])), [events, colorByCalendarId]);
|
|
108
|
-
const lookup =
|
|
109
|
-
|
|
110
|
-
/* The event element the engine built, dressed as the body of a
|
|
111
|
-
`CalendarEventChip`: same box, same hue, same states, one definition. A
|
|
112
|
-
grid cell is tight whatever the density does to the slots around it. */
|
|
113
|
-
const eventBody = useMemo(() => (info) => {
|
|
114
|
-
const event = lookup(info.event.id);
|
|
115
|
-
const isRow = isRowEvent(info);
|
|
116
|
-
return cn(calendarEventBodyClasses({
|
|
117
|
-
color: event.color,
|
|
118
|
-
layout: isRow ? "row" : "column",
|
|
119
|
-
density: "compact",
|
|
120
|
-
rsvp: event.rsvp,
|
|
121
|
-
status: event.status,
|
|
122
|
-
selected: info.event.id === selectedEventId,
|
|
123
|
-
stacked: false,
|
|
124
|
-
}), "cursor-pointer outline-none transition-colors", "focus-visible:ring-2 focus-visible:ring-ring",
|
|
125
|
-
/* Tighter than a chip drawn on its own: a grid cell is smaller than
|
|
126
|
-
anywhere else an event lands, and an all-day pill has to fit a band
|
|
127
|
-
one line high. */
|
|
128
|
-
isRow ? "my-px px-1 py-0" : "px-1 py-0.5");
|
|
129
|
-
}, [lookup, isRowEvent, selectedEventId]);
|
|
130
|
-
const slot = DENSITY[density];
|
|
131
|
-
const isTight = density === "compact";
|
|
132
|
-
return (_jsx("div", { "data-testid": "calendar-grid", className: cn("h-full min-h-0 w-full text-fg", className), children: _jsx(FullCalendar, { ref: calendarRef, plugins: PLUGINS, initialView: FC_VIEW[view], initialDate: date, now: now, timeZone: timeZone, height: "100%", headerToolbar: false, firstDay: 1, fixedWeekCount: false, nowIndicator: true, selectable: true, selectMirror: true, editable: false,
|
|
80
|
+
const lookup = (id) => byId.get(id) ?? MIRROR_EVENT;
|
|
81
|
+
return (_jsx("div", { "data-testid": "calendar-grid", className: cn("h-full min-h-0 w-full text-fg", className), children: _jsx(FullCalendar, { ref: calendarRef, plugins: PLUGINS, initialView: "dayGridMonth", initialDate: date, now: now, timeZone: timeZone, height: "100%", headerToolbar: false, firstDay: 1, fixedWeekCount: false, selectable: true, editable: false,
|
|
133
82
|
/* Events take focus and answer Enter, the way the toolbar's controls
|
|
134
83
|
do — the grid is not reachable by pointer only. */
|
|
135
|
-
eventInteractive: true, expandRows: true,
|
|
136
|
-
if (view !== "month")
|
|
137
|
-
return;
|
|
84
|
+
eventInteractive: true, expandRows: true, dayMaxEvents: MAX_EVENTS[density], dayCellTopContent: (info) => {
|
|
138
85
|
const day = isoDayInZone(info.date, timeZone);
|
|
139
86
|
return (_jsx("a", { href: dayHref(day), "aria-label": `Open ${info.date.toLocaleDateString("en-GB", { dateStyle: "full", timeZone })}`, className: "hover:underline", onClick: (click) => {
|
|
140
87
|
if (isModifiedClick(click))
|
|
@@ -143,8 +90,6 @@ export function CalendarGrid({ view, date, events, colorByCalendarId, density, s
|
|
|
143
90
|
onZoomDay(day);
|
|
144
91
|
}, children: Number(day.slice(8)) }));
|
|
145
92
|
}, dayCellDidMount: (info) => {
|
|
146
|
-
if (view !== "month")
|
|
147
|
-
return;
|
|
148
93
|
/* The engine hides a day number from assistive tech unless it is its
|
|
149
94
|
own nav link, and a link inside a hidden wrapper is unreachable. */
|
|
150
95
|
info.el
|
|
@@ -157,33 +102,34 @@ export function CalendarGrid({ view, date, events, colorByCalendarId, density, s
|
|
|
157
102
|
for (const type of ["mousedown", "touchstart", "pointerdown"]) {
|
|
158
103
|
link?.addEventListener(type, (press) => press.stopPropagation());
|
|
159
104
|
}
|
|
160
|
-
}, moreLinkClick: "popover", moreLinkText: (num) => `+${num}`,
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
Acting on both would report a point twice, and the second report
|
|
168
|
-
arrives late — the library finishes a click a task after the pointer
|
|
169
|
-
is up — by which time the pane the first report opened has rebuilt
|
|
170
|
-
the grid and left the second reading a detached cell. */
|
|
105
|
+
}, moreLinkClick: "popover", moreLinkText: (num) => `+${num}`, displayEventEnd: false, eventTimeFormat: { hour: "2-digit", minute: "2-digit", hour12: false }, dayHeaderFormat: { weekday: "short" }, events: eventInputs, eventClick: (info) => taskById.has(info.event.id)
|
|
106
|
+
? onSelectTask?.(info.event.id)
|
|
107
|
+
: onSelectEvent(info.event.id), eventDrop: dropped, eventResize: dropped, eventDidMount: (info) => {
|
|
108
|
+
info.el.setAttribute(taskById.has(info.event.id) ? "data-task-id" : "data-event-id", info.event.id);
|
|
109
|
+
},
|
|
110
|
+
/* A point is `dateClick`'s and a dragged run of days is `select`'s;
|
|
111
|
+
acting on both would report a point twice. */
|
|
171
112
|
dateClick: (info) => onPickSlot(pointPick(info.dateStr, info.allDay)), select: (info) => {
|
|
172
|
-
if (!isDraggedSelection(info.startStr, info.endStr,
|
|
173
|
-
/* The point reading is answering this one. Left alone the
|
|
174
|
-
selection would stay lit under the draft, a slot wide where
|
|
175
|
-
the draft is an hour, until a click somewhere else. */
|
|
113
|
+
if (!isDraggedSelection(info.startStr, info.endStr, true, 0)) {
|
|
176
114
|
info.view.calendar.unselect();
|
|
177
115
|
return;
|
|
178
116
|
}
|
|
179
|
-
onPickSlot(rangePick(info.startStr, info.endStr,
|
|
180
|
-
},
|
|
117
|
+
onPickSlot(rangePick(info.startStr, info.endStr, true));
|
|
118
|
+
},
|
|
181
119
|
/* ---- chrome, all of it ours ---- */
|
|
182
|
-
viewClass: "bg-surface", tableClass: "border-line", tableHeaderClass: "bg-surface", fillerClass: "border-line", dayHeaderRowClass: "h-pane-header", dayHeaderClass: (info) => cn("border-b border-line bg-surface", info.isToday ? "text-accent" : "text-fg-subtle"), dayHeaderInnerClass: "px-1 py-1 text-2xs font-semibold uppercase tracking-wider", dayHeaderDividerClass: "border-b border-line", dayCellClass: (info) => cn("border-line", info.isOther && "bg-surface-sunken"),
|
|
120
|
+
viewClass: "bg-surface", tableClass: "border-line", tableHeaderClass: "bg-surface", fillerClass: "border-line", dayHeaderRowClass: "h-pane-header", dayHeaderClass: (info) => cn("border-b border-line bg-surface", info.isToday ? "text-accent" : "text-fg-subtle"), dayHeaderInnerClass: "px-1 py-1 text-2xs font-semibold uppercase tracking-wider", dayHeaderDividerClass: "border-b border-line", dayCellClass: (info) => cn("border-line", info.isOther && "bg-surface-sunken"), dayCellTopInnerClass: (info) => cn("px-1 py-0.5 text-2xs tabular-nums", info.isToday ? "font-semibold text-accent" : "text-fg-muted"), dayRowClass: "border-line", highlightClass: "bg-accent-soft", moreLinkClass: "rounded-sm bg-surface-sunken text-2xs font-semibold text-fg-muted hover:bg-line hover:text-fg", moreLinkInnerClass: "px-1 py-0.5", popoverClass: "rounded-lg border border-line bg-surface-raised shadow-xl shadow-black/20", popoverCloseClass: "text-fg-subtle hover:text-fg", eventClass: (info) => cn(calendarEventBodyClasses({
|
|
121
|
+
color: lookup(info.event.id).color,
|
|
122
|
+
layout: "row",
|
|
123
|
+
density: "compact",
|
|
124
|
+
rsvp: lookup(info.event.id).rsvp,
|
|
125
|
+
status: lookup(info.event.id).status,
|
|
126
|
+
selected: info.event.id === selectedEventId,
|
|
127
|
+
stacked: false,
|
|
128
|
+
}), "my-px cursor-pointer px-1 py-0 outline-none transition-colors focus-visible:ring-2 focus-visible:ring-ring"), eventContent: (info) => {
|
|
129
|
+
const task = taskById.get(info.event.id);
|
|
130
|
+
if (task)
|
|
131
|
+
return (_jsxs("span", { className: cn("flex min-w-0 items-center gap-1 truncate", task.completed && "line-through opacity-60"), children: [_jsx("span", { "aria-hidden": "true", children: task.completed ? "☑" : "☐" }), _jsx("span", { className: "truncate", children: task.title === "" ? "(No title)" : task.title })] }));
|
|
183
132
|
const event = lookup(info.event.id);
|
|
184
|
-
|
|
185
|
-
both — the title is the one worth keeping. */
|
|
186
|
-
const showTime = info.timeText !== "" && !isTight && !info.isNarrow;
|
|
187
|
-
return (_jsx(CalendarEventChipContent, { title: info.event.title, timeText: showTime ? info.timeText : "", layout: isRowEvent(info) ? "row" : "column", rsvp: event.rsvp, hasThread: event.hasThread, isRecurring: event.isRecurring, zoneCertainty: event.zoneCertainty }));
|
|
133
|
+
return (_jsx(CalendarEventChipContent, { title: info.event.title, timeText: density === "compact" ? "" : info.timeText, layout: "row", rsvp: event.rsvp, hasThread: event.hasThread, isRecurring: event.isRecurring, zoneCertainty: event.zoneCertainty }));
|
|
188
134
|
} }) }));
|
|
189
135
|
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { type GuestEntry } from "../lib/guest-list.js";
|
|
2
|
+
import { type CalendarFailure } from "./calendar-event-popup.js";
|
|
3
|
+
import type { CalendarAttendee, RsvpState } from "./calendar-types.js";
|
|
4
|
+
/** A contact the Guests field offers while the reader types. */
|
|
5
|
+
export interface GuestSuggestion {
|
|
6
|
+
email: string;
|
|
7
|
+
name: string;
|
|
8
|
+
}
|
|
9
|
+
export interface CalendarGuestsFieldProps {
|
|
10
|
+
value: readonly GuestEntry[];
|
|
11
|
+
onChange: (value: GuestEntry[]) => void;
|
|
12
|
+
/** Contacts matching what is being typed. */
|
|
13
|
+
suggestions: readonly GuestSuggestion[];
|
|
14
|
+
/** What is being typed, so the caller can look contacts up. */
|
|
15
|
+
onQuery: (query: string) => void;
|
|
16
|
+
touch?: boolean;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Guests as chips, added by typing an address or picking a contact. An entry
|
|
20
|
+
* that is not an address stays as a chip marked invalid and named under the
|
|
21
|
+
* field, so the reader fixes or removes it before the event can be saved.
|
|
22
|
+
*/
|
|
23
|
+
export declare function CalendarGuestsField({ value, onChange, suggestions, onQuery, touch, }: CalendarGuestsFieldProps): import("react").JSX.Element;
|
|
24
|
+
/** One of the reader's accounts, as a sending-account list offers it. */
|
|
25
|
+
export interface CalendarSender {
|
|
26
|
+
accountId: string;
|
|
27
|
+
email: string;
|
|
28
|
+
}
|
|
29
|
+
export interface CalendarSenderFieldProps {
|
|
30
|
+
label: string;
|
|
31
|
+
senders: readonly CalendarSender[];
|
|
32
|
+
value: string;
|
|
33
|
+
onChange: (accountId: string) => void;
|
|
34
|
+
disabled?: boolean;
|
|
35
|
+
touch?: boolean;
|
|
36
|
+
}
|
|
37
|
+
/** The account an event's invitations go out from. */
|
|
38
|
+
export declare function CalendarSenderField({ label, senders, value, onChange, disabled, touch, }: CalendarSenderFieldProps): import("react").JSX.Element;
|
|
39
|
+
/** How many guests gave each answer, as the server counts them. */
|
|
40
|
+
export interface CalendarGuestCounts {
|
|
41
|
+
accepted: number;
|
|
42
|
+
declined: number;
|
|
43
|
+
tentative: number;
|
|
44
|
+
needsAction: number;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* The guest list in the event popup: how many, how they answered, and who,
|
|
48
|
+
* with the organizer marked. Read-only: the guest list changes in the editor.
|
|
49
|
+
*/
|
|
50
|
+
export declare function CalendarEventGuests({ attendees, counts, }: {
|
|
51
|
+
attendees: readonly CalendarAttendee[];
|
|
52
|
+
counts: CalendarGuestCounts;
|
|
53
|
+
}): import("react").JSX.Element | null;
|
|
54
|
+
/** An answer a guest can give. */
|
|
55
|
+
export type CalendarAnswer = "accepted" | "declined" | "tentative";
|
|
56
|
+
export interface CalendarReplyRowProps {
|
|
57
|
+
/** The answer the reader has given, `noReply` when none yet. */
|
|
58
|
+
current: RsvpState;
|
|
59
|
+
onAnswer: (answer: CalendarAnswer) => void;
|
|
60
|
+
sending?: boolean;
|
|
61
|
+
failure?: CalendarFailure;
|
|
62
|
+
}
|
|
63
|
+
/** `Going?` with Yes, No and Maybe, the current answer pressed. */
|
|
64
|
+
export declare function CalendarReplyRow({ current, onAnswer, sending, failure, }: CalendarReplyRowProps): import("react").JSX.Element;
|
|
65
|
+
export interface CalendarInvitationsNotSentProps {
|
|
66
|
+
/** The guests whose invitation, update or cancellation did not go out. */
|
|
67
|
+
missed: readonly string[];
|
|
68
|
+
onRetry: () => void;
|
|
69
|
+
reportHref: string;
|
|
70
|
+
onDismiss: () => void;
|
|
71
|
+
}
|
|
72
|
+
/** The event is saved; these guests were not reached. */
|
|
73
|
+
export declare function CalendarInvitationsNotSent({ missed, onRetry, reportHref, onDismiss, }: CalendarInvitationsNotSentProps): import("react").JSX.Element | null;
|
|
74
|
+
export interface CalendarCancellationsSentProps {
|
|
75
|
+
/** The guests a deleted event's cancellation is going to. */
|
|
76
|
+
guests: readonly string[];
|
|
77
|
+
onDismiss: () => void;
|
|
78
|
+
}
|
|
79
|
+
/** The event is deleted; these guests are being told. */
|
|
80
|
+
export declare function CalendarCancellationsSent({ guests, onDismiss, }: CalendarCancellationsSentProps): import("react").JSX.Element | null;
|